diff --git a/.cspell.json b/.cspell.json
index d89e5dbaf3d9..6f036d77516b 100644
--- a/.cspell.json
+++ b/.cspell.json
@@ -1,6 +1,14 @@
{
- "version": "0.1",
+ "version": "0.2",
"language": "en",
+ "enableFiletypes": [
+ "markdown",
+ "mdx",
+ "typescript",
+ "typescriptreact",
+ "javascript",
+ "javascriptreact"
+ ],
"ignorePaths": [
".cspell.json",
".github/workflows/**",
@@ -119,7 +127,6 @@
"trpc",
"tsconfigs",
"tseslint",
- "tsutils",
"tsvfs",
"typedef",
"typedefs",
diff --git a/.eslintignore b/.eslintignore
index 1e5cc6e0083b..431bc8030293 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -7,12 +7,11 @@ __snapshots__
.docusaurus
build
-packages/eslint-plugin-tslint/tests
-
-packages/website/**/*.js
-packages/website/**/*.d.ts
-packages/website-eslint/**/*.js
-packages/website-eslint/**/*.d.ts
-
# Files copied as part of the build
packages/types/src/generated/**/*.ts
+
+# Playground types downloaded from the web
+packages/website/src/vendor
+
+# see the file header in eslint-base.test.js for more info
+packages/rule-tester/tests/eslint-base
diff --git a/.eslintrc.js b/.eslintrc.js
index ee9dba8c4d05..9795cfb5792d 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,3 +1,5 @@
+// @ts-check
+/** @type {import('./packages/utils/src/ts-eslint/Linter').Linter.Config} */
module.exports = {
root: true,
plugins: [
@@ -12,21 +14,21 @@ module.exports = {
'unicorn',
],
env: {
- es6: true,
+ es2020: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:eslint-plugin/recommended',
- 'plugin:@typescript-eslint/recommended',
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
+ 'plugin:@typescript-eslint/recommended-type-checked',
+ 'plugin:@typescript-eslint/stylistic-type-checked',
+ // TODO: consider enabling strict-type-checked
],
parserOptions: {
sourceType: 'module',
project: [
'./tsconfig.eslint.json',
'./packages/*/tsconfig.json',
- './tests/integration/tsconfig.json',
/**
* We are currently in the process of transitioning to nx's out of the box structure and
* so need to manually specify converted packages' tsconfig.build.json and tsconfig.spec.json
@@ -51,6 +53,14 @@ module.exports = {
// make sure we're not leveraging any deprecated APIs
'deprecation/deprecation': 'error',
+ // TODO(#7138): Investigate enabling these soon ✨
+ '@typescript-eslint/consistent-indexed-object-style': 'off',
+ '@typescript-eslint/prefer-nullish-coalescing': 'off',
+
+ // TODO(#7130): Investigate changing these in or removing these from presets
+ '@typescript-eslint/no-confusing-void-expression': 'off',
+ '@typescript-eslint/prefer-string-starts-ends-with': 'off',
+
//
// our plugin :D
//
@@ -65,25 +75,18 @@ module.exports = {
minimumDescriptionLength: 5,
},
],
- '@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports', disallowTypeAnnotations: true },
],
- '@typescript-eslint/explicit-function-return-type': 'error',
- '@typescript-eslint/explicit-module-boundary-types': 'off',
- '@typescript-eslint/no-empty-function': [
+ '@typescript-eslint/explicit-function-return-type': [
'error',
- { allow: ['arrowFunctions'] },
+ { allowIIFEs: true },
],
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-var-requires': 'off',
- '@typescript-eslint/prefer-for-of': 'error',
- '@typescript-eslint/prefer-nullish-coalescing': 'error',
- '@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/unbound-method': 'off',
- '@typescript-eslint/prefer-as-const': 'error',
'@typescript-eslint/restrict-template-expressions': [
'error',
{
@@ -95,7 +98,7 @@ module.exports = {
},
],
'@typescript-eslint/no-unused-vars': [
- 'warn',
+ 'error',
{ varsIgnorePattern: '^_', argsIgnorePattern: '^_' },
],
@@ -123,7 +126,7 @@ module.exports = {
'no-console': 'error',
'no-process-exit': 'error',
'no-fallthrough': [
- 'warn',
+ 'error',
{ commentPattern: '.*intentional fallthrough.*' },
],
@@ -157,6 +160,7 @@ module.exports = {
'eslint-disable-line',
'eslint-disable-next-line',
'eslint-enable',
+ 'global',
],
},
],
@@ -205,6 +209,18 @@ module.exports = {
'unicorn/no-typeof-undefined': 'error',
},
overrides: [
+ {
+ files: ['*.js'],
+ extends: ['plugin:@typescript-eslint/disable-type-checked'],
+ rules: {
+ // turn off other type-aware rules
+ 'deprecation/deprecation': 'off',
+ '@typescript-eslint/internal/no-poorly-typed-ts-props': 'off',
+
+ // turn off rules that don't apply to JS code
+ '@typescript-eslint/explicit-function-return-type': 'off',
+ },
+ },
// all test files
{
files: [
@@ -213,20 +229,23 @@ module.exports = {
'./packages/*/tests/**/spec.ts',
'./packages/*/tests/**/test.ts',
'./packages/parser/tests/**/*.ts',
- './tests/integration/**/*.test.ts',
- './tests/integration/integration-test-base.ts',
- './tests/integration/pack-packages.ts',
+ './packages/integration-tests/tools/integration-test-base.ts',
+ './packages/integration-tests/tools/pack-packages.ts',
],
env: {
'jest/globals': true,
},
rules: {
+ '@typescript-eslint/no-empty-function': [
+ 'error',
+ { allow: ['arrowFunctions'] },
+ ],
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'eslint-plugin/consistent-output': 'off', // Might eventually be removed from `eslint-plugin/recommended`: https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/284
- 'jest/no-disabled-tests': 'warn',
+ 'jest/no-disabled-tests': 'error',
'jest/no-focused-tests': 'error',
'jest/no-alias-methods': 'error',
'jest/no-identical-title': 'error',
@@ -234,9 +253,9 @@ module.exports = {
'jest/no-test-prefixes': 'error',
'jest/no-done-callback': 'error',
'jest/no-test-return-statement': 'error',
- 'jest/prefer-to-be': 'warn',
- 'jest/prefer-to-contain': 'warn',
- 'jest/prefer-to-have-length': 'warn',
+ 'jest/prefer-to-be': 'error',
+ 'jest/prefer-to-contain': 'error',
+ 'jest/prefer-to-have-length': 'error',
'jest/prefer-spy-on': 'error',
'jest/valid-expect': 'error',
'jest/no-deprecated-functions': 'error',
@@ -315,7 +334,12 @@ module.exports = {
},
// tools and tests
{
- files: ['**/tools/**/*.ts', '**/tests/**/*.ts'],
+ files: [
+ '**/tools/**/*.*t*',
+ '**/tests/**/*.ts',
+ './packages/repo-tools/**/*.*t*',
+ './packages/integration-tests/**/*.*t*',
+ ],
rules: {
// allow console logs in tools and tests
'no-console': 'off',
@@ -342,6 +366,19 @@ module.exports = {
'@typescript-eslint/sort-type-constituents': 'error',
},
},
+ {
+ files: ['./packages/ast-spec/**/*.ts'],
+ rules: {
+ 'no-restricted-imports': [
+ 'error',
+ {
+ name: '@typescript-eslint/typescript-estree',
+ message:
+ 'To prevent nx build errors, all `typescript-estree` imports should be done via `packages/ast-spec/tests/util/parsers/typescript-estree-import.ts`.',
+ },
+ ],
+ },
+ },
{
files: ['rollup.config.ts'],
rules: {
@@ -349,7 +386,7 @@ module.exports = {
},
},
{
- files: ['./packages/website/'],
+ files: ['./packages/website/**/*.{ts,tsx,mts,cts,js,jsx}'],
extends: [
'plugin:jsx-a11y/recommended',
'plugin:react/recommended',
@@ -357,10 +394,11 @@ module.exports = {
],
plugins: ['jsx-a11y', 'react', 'react-hooks'],
rules: {
+ '@typescript-eslint/internal/prefer-ast-types-enum': 'off',
+ 'import/no-default-export': 'off',
'react/jsx-no-target-blank': 'off',
'react/no-unescaped-entities': 'off',
- '@typescript-eslint/internal/prefer-ast-types-enum': 'off',
- 'react-hooks/exhaustive-deps': 'off', // TODO: enable it later
+ 'react-hooks/exhaustive-deps': 'warn', // TODO: enable it later
},
settings: {
react: {
@@ -376,5 +414,12 @@ module.exports = {
'no-console': 'off',
},
},
+ {
+ files: ['./packages/website-eslint/src/mock/**/*.js', '*.d.ts'],
+ rules: {
+ // mocks and declaration files have to mirror their original package
+ 'import/no-default-export': 'off',
+ },
+ },
],
};
diff --git a/.github/actions/prepare-build/action.yml b/.github/actions/prepare-build/action.yml
index d656587ca56a..227b60733b3e 100644
--- a/.github/actions/prepare-build/action.yml
+++ b/.github/actions/prepare-build/action.yml
@@ -10,13 +10,27 @@ runs:
id: build-cache
with:
path: '**/dist/**'
- key: ${{ runner.os }}-build-${{ github.ref }}
+ key: ${{ runner.os }}-build-${{ github.ref }}-${{ github.run_id }}
+ # We don't want to share builds across runs even for the same branch
+ # because each commit can have different build artifacts and we don't
+ # want to accidentally share artifacts and poison the build output
restore-keys: |
- ${{ runner.os }}-build-
+ ${{ runner.os }}-build-${{ github.ref }}-${{ github.run_id }}
+
+ # If the cache was hit, then we still run the types build because we generate source files
+ - name: Build AST Spec
+ if: steps['build-cache'].outputs.cache-hit == 'true'
+ shell: bash
+ run: |
+ npx nx run types:build
+ env:
+ SKIP_AST_SPEC_REBUILD: true
- # if the cache was hit - this will run in <1s
- name: Build
+ if: steps['build-cache'].outputs.cache-hit != 'true'
shell: bash
# Website will be built by the Netlify GitHub App
run: |
- npx nx run-many --target=build --parallel --exclude website
+ npx nx run-many --target=build --parallel --exclude=website --exclude=website-eslint
+ env:
+ SKIP_AST_SPEC_REBUILD: true
diff --git a/.github/renovate.json5 b/.github/renovate.json5
index f46e34366824..2dda36f75a36 100644
--- a/.github/renovate.json5
+++ b/.github/renovate.json5
@@ -1,10 +1,10 @@
{
enabledManagers: ['github-actions', 'npm'],
ignoreDeps: [
+ // AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70
+ 'ajv',
// globby is ESM so we can't go any higher right now
'globby',
- // this dep now uses package.json exports - we will be removing it next major
- 'eslint-scope',
// this dep is now ESM only
'execa',
// Some kind of weird caching issue:
@@ -20,17 +20,6 @@
'@nrwl/nx-cloud',
'nx-cloud',
'@nrwl/tao',
- '@nx/tao',
- // TODO - once we bump pass the major, we can remove these. Currently renovate is creating broken, immortal PRs
- '@rollup/plugin-babel',
- '@rollup/plugin-commonjs',
- '@rollup/plugin-json',
- '@rollup/plugin-node-resolve',
- '@rollup/plugin-replace',
- '@rollup/plugin-terser',
- '@rollup/pluginutils',
- 'rollup-plugin-terser',
- 'rollup',
],
ignorePaths: [
// integration test package.json's should never be updated as they're purposely fixed tests
@@ -90,11 +79,6 @@
matchPackagePrefixes: ['@types/jest', 'jest-', '@jest/'],
groupName: 'jest',
},
- {
- matchPackagePrefixes: ['@rollup', 'rollup-'],
- matchPackageNames: ['rollup'],
- groupName: 'rollup',
- },
],
postUpdateOptions: [
// run yarn dedupe to cleanup the lockfile after updates
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 19d8514324ef..98af2e8ed085 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -11,7 +11,7 @@ on:
merge_group:
env:
- PRIMARY_NODE_VERSION: 18
+ PRIMARY_NODE_VERSION: 20
# Only set the read-write token if we are on the main branch
NX_CLOUD_ACCESS_TOKEN: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') && secrets.NX_CLOUD_ACCESS_TOKEN || '' }}
@@ -95,6 +95,21 @@ jobs:
- name: Run Check
run: yarn ${{ matrix.lint-task }}
+ stylelint:
+ name: Stylelint
+ needs: [install]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ - name: Install
+ uses: ./.github/actions/prepare-install
+ with:
+ node-version: ${{ env.PRIMARY_NODE_VERSION }}
+ - name: Run stylelint check
+ run: yarn stylelint
+ working-directory: packages/website
+
integration_tests:
name: Run integration tests on primary Node.js version
needs: [build]
@@ -121,7 +136,7 @@ jobs:
strategy:
matrix:
# just run on the oldest and latest supported versions and assume the intermediate versions are good
- node-version: [14, 18]
+ node-version: [16, 20]
package:
[
'ast-spec',
@@ -129,6 +144,8 @@ jobs:
'eslint-plugin-internal',
'eslint-plugin-tslint',
'parser',
+ 'repo-tools',
+ 'rule-schema-to-typescript-types',
'scope-manager',
'type-utils',
'typescript-estree',
diff --git a/.github/workflows/semantic-pr-titles.yml b/.github/workflows/semantic-pr-titles.yml
index 98a7013beb74..fdbc928068c1 100644
--- a/.github/workflows/semantic-pr-titles.yml
+++ b/.github/workflows/semantic-pr-titles.yml
@@ -30,7 +30,6 @@ jobs:
eslint-plugin
eslint-plugin-internal
eslint-plugin-tslint
- experimental-utils
parser
scope-manager
type-utils
diff --git a/.gitignore b/.gitignore
index 7fad8b15206e..fb6fcf441bdd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -81,6 +81,11 @@ _ts4.2
.watchmanconfig
.rollup.cache
+# the downlevel-dts output folders
+_ts3.4
+_ts4.2
+_ts4.3
+
# Files copied as part of the build
packages/types/src/generated/**/*.ts
diff --git a/.prettierignore b/.prettierignore
index e75691bd4a2c..bca745565bed 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,18 +1,14 @@
-**/tests/fixtures/**/*
-!packages/scope-manager/tests/fixtures/**/*
-**/tests/fixture-project/**/*
**/dist
**/coverage
**/.vscode
**/.nyc_output
**/.vs
-packages/eslint-plugin-tslint/tests/test-tslint-rules-directory/alwaysFailRule.js
-packages/eslint-plugin/src/configs/*.json
CONTRIBUTORS.md
packages/ast-spec/src/*/*/fixtures/_error_/*/fixture.ts
+packages/eslint-plugin/tests/fixtures/indent/
-# prettier doesn't yet support auto-accessors
-packages/ast-spec/src/element/AccessorProperty/fixtures
+# prettier errors on this case because it's semantically valid
+packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture.ts
# prettier doesn't yet support `const` modifiers for type parameters
packages/ast-spec/src/special/TSTypeParameter/fixtures
@@ -26,4 +22,6 @@ CHANGELOG.md
packages/website/.docusaurus
packages/website/build
-packages/website/src/vendor
+
+# see the file header in eslint-base.test.js for more info
+packages/rule-tester/tests/eslint-base
diff --git a/.vscode/launch.json b/.vscode/launch.json
index 0e1893db17fd..4cee04bec4a0 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -105,6 +105,42 @@
"${workspaceFolder}/packages/scope-manager/dist/index.js",
],
},
+ {
+ "type": "node",
+ "request": "launch",
+ "name": "Run currently opened rule-tester test",
+ "cwd": "${workspaceFolder}/packages/rule-tester/",
+ "program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
+ "args": [
+ "--runInBand",
+ "--no-cache",
+ "--no-coverage",
+ "${fileBasename}"
+ ],
+ "sourceMaps": true,
+ "console": "integratedTerminal",
+ "internalConsoleOptions": "neverOpen",
+ "skipFiles": [
+ "${workspaceFolder}/packages/utils/src/index.ts",
+ "${workspaceFolder}/packages/utils/dist/index.js",
+ "${workspaceFolder}/packages/utils/src/ts-estree.ts",
+ "${workspaceFolder}/packages/utils/dist/ts-estree.js",
+ "${workspaceFolder}/packages/type-utils/src/ts-estree.ts",
+ "${workspaceFolder}/packages/type-utils/dist/ts-estree.js",
+ "${workspaceFolder}/packages/parser/src/index.ts",
+ "${workspaceFolder}/packages/parser/dist/index.js",
+ "${workspaceFolder}/packages/rule-tester/src/index.ts",
+ "${workspaceFolder}/packages/rule-tester/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",
+ ],
+ },
{
"type": "node",
"request": "launch",
@@ -291,10 +327,6 @@
"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",
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5f1f89e0979d..2b770bca2c92 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,106 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [6.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.62.0...v6.0.0) (2023-07-10)
+
+
+### Bug Fixes
+
+* **ast-spec:** remove more invalid properties ([#6243](https://github.com/typescript-eslint/typescript-eslint/issues/6243)) ([aa20f63](https://github.com/typescript-eslint/typescript-eslint/commit/aa20f63e8f345767bb4693c9d20f751e6998bd65))
+* bumped ts-api-utils to 0.0.39 ([#6497](https://github.com/typescript-eslint/typescript-eslint/issues/6497)) ([217c710](https://github.com/typescript-eslint/typescript-eslint/commit/217c710d99445994b9c8db7b9bee9b9cc63bc4cb))
+* correct handling of additionalProperties in object schemas ([#6939](https://github.com/typescript-eslint/typescript-eslint/issues/6939)) ([489c7a5](https://github.com/typescript-eslint/typescript-eslint/commit/489c7a50ae99ef66df152a68fd447f7e42a23558))
+* correct jest.mock path post merge ([778d254](https://github.com/typescript-eslint/typescript-eslint/commit/778d254eefc5bb08f39e4ce7d691c67977e620ab))
+* correct lint error after merge ([277fdb5](https://github.com/typescript-eslint/typescript-eslint/commit/277fdb5ac76bd761ae6f5d1052445dcff2e848a1))
+* **eslint-plugin:** [explicit-module-boundary-types] remove shouldTrackReferences option from schema ([#5399](https://github.com/typescript-eslint/typescript-eslint/issues/5399)) ([6d32734](https://github.com/typescript-eslint/typescript-eslint/commit/6d32734b1312f60ee7d12d4bb19fc1cf52e7f0a5))
+* **eslint-plugin:** allow parser@^6.0.0 ([#6630](https://github.com/typescript-eslint/typescript-eslint/issues/6630)) ([92908bd](https://github.com/typescript-eslint/typescript-eslint/commit/92908bdd9c102ff599da6a4791e8ad3e6d3dc593))
+* **eslint-plugin:** remove valid-typeof disable in eslint-recommended ([#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381)) ([b82df5e](https://github.com/typescript-eslint/typescript-eslint/commit/b82df5eaed437727566cde2b53410001505f1b13))
+* fix illegal decorator check ([#6723](https://github.com/typescript-eslint/typescript-eslint/issues/6723)) ([c456f8c](https://github.com/typescript-eslint/typescript-eslint/commit/c456f8cdef5a931c631bfbcfc84d8a25caaf019f))
+* rename typeParameters to typeArguments where needed ([#5384](https://github.com/typescript-eslint/typescript-eslint/issues/5384)) ([08d757b](https://github.com/typescript-eslint/typescript-eslint/commit/08d757b26b00d0accea010e61ec42b4f753f993e))
+* replace tsutils with ts-api-tools ([#6428](https://github.com/typescript-eslint/typescript-eslint/issues/6428)) ([79327b4](https://github.com/typescript-eslint/typescript-eslint/commit/79327b4999999cde3003901b40527af002c4906a))
+* **type-utils:** checking of type aliases' type names by `typeMatchesSpecifier` ([#6820](https://github.com/typescript-eslint/typescript-eslint/issues/6820)) ([7ca2c90](https://github.com/typescript-eslint/typescript-eslint/commit/7ca2c900eb07ade771bed43a8eb4a5a97fdfa3b3))
+* **type-utils:** file variant of TypeOrValueSpecifier uses canonical filenames instead of lowercasing ([#6781](https://github.com/typescript-eslint/typescript-eslint/issues/6781)) ([5095d05](https://github.com/typescript-eslint/typescript-eslint/commit/5095d05ac97320e7e50decef58279b01f2bfbd18))
+* **type-utils:** fixed TypeOrValueSpecifier not accounting for scoped DT packages ([#6780](https://github.com/typescript-eslint/typescript-eslint/issues/6780)) ([3350940](https://github.com/typescript-eslint/typescript-eslint/commit/335094064c441573638fda589d10f3b925058d5e))
+* **type-utils:** treat intrinsic types as if they are from lib and never match error types ([#6869](https://github.com/typescript-eslint/typescript-eslint/issues/6869)) ([ecb57de](https://github.com/typescript-eslint/typescript-eslint/commit/ecb57de5eb50511bed163f6e1b27e31b8577344e))
+* **typescript-estree:** account for namespace nesting in AST conversion ([#6272](https://github.com/typescript-eslint/typescript-eslint/issues/6272)) ([09e3877](https://github.com/typescript-eslint/typescript-eslint/commit/09e38776c63fea3328f71df36644ee11dd137cc1))
+* **typescript-estree:** allow writing to deprecated node properties ([#6670](https://github.com/typescript-eslint/typescript-eslint/issues/6670)) ([6652ebe](https://github.com/typescript-eslint/typescript-eslint/commit/6652ebea3e338f05a377f6f124d20520a840b1d5))
+* **typescript-estree:** fix error handling on `ImportExpression` ([#6587](https://github.com/typescript-eslint/typescript-eslint/issues/6587)) ([e8cdd5c](https://github.com/typescript-eslint/typescript-eslint/commit/e8cdd5ce48fa0a2f6f93e6b3ed7c337d042ab45d))
+* **typescript-estree:** forbid `override` on non-constructor function/methods ([#6729](https://github.com/typescript-eslint/typescript-eslint/issues/6729)) ([2f3638f](https://github.com/typescript-eslint/typescript-eslint/commit/2f3638fb00745429d6392a8e6492e83f853e92db))
+* **typescript-estree:** wrap import = declaration in an export node ([#5885](https://github.com/typescript-eslint/typescript-eslint/issues/5885)) ([1c3f470](https://github.com/typescript-eslint/typescript-eslint/commit/1c3f470da75bf63526efbf5b45615772e562dcb5)), closes [#5036](https://github.com/typescript-eslint/typescript-eslint/issues/5036) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5889](https://github.com/typescript-eslint/typescript-eslint/issues/5889) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5883](https://github.com/typescript-eslint/typescript-eslint/issues/5883) [#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863) [#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381) [#5256](https://github.com/typescript-eslint/typescript-eslint/issues/5256)
+* update `exports` field in package.json files ([#6550](https://github.com/typescript-eslint/typescript-eslint/issues/6550)) ([53776c2](https://github.com/typescript-eslint/typescript-eslint/commit/53776c244f8bbdc852d57c7b313b0935e755ddc4))
+* **utils:** removed `TRuleListener` generic from the `createRule` ([#5036](https://github.com/typescript-eslint/typescript-eslint/issues/5036)) ([361f8bc](https://github.com/typescript-eslint/typescript-eslint/commit/361f8bcebe588fc7410a53e002c55118b0bfee85)), closes [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864)
+
+
+### chore
+
+* drop support for node v14.17, v17 ([#5971](https://github.com/typescript-eslint/typescript-eslint/issues/5971)) ([cc62015](https://github.com/typescript-eslint/typescript-eslint/commit/cc62015b8ae5f207912ff8988e2a0b3fe9a79243))
+
+
+### Features
+
+* add new package `rule-tester` ([#6777](https://github.com/typescript-eslint/typescript-eslint/issues/6777)) ([2ce1c1d](https://github.com/typescript-eslint/typescript-eslint/commit/2ce1c1d22c799a1ca027674fcb9b3a7ab0107428))
+* add package.json exports for public packages ([#6458](https://github.com/typescript-eslint/typescript-eslint/issues/6458)) ([d676683](https://github.com/typescript-eslint/typescript-eslint/commit/d6766838a05259556029acaac57dc7839b68c592))
+* bump minimum supported TS version to 4.2.4 ([#5915](https://github.com/typescript-eslint/typescript-eslint/issues/5915)) ([a8e71d5](https://github.com/typescript-eslint/typescript-eslint/commit/a8e71d52169f32ab9e836ec96d980ba52deffe12))
+* bump ts-api-utils to v0.0.21 ([#6459](https://github.com/typescript-eslint/typescript-eslint/issues/6459)) ([3915661](https://github.com/typescript-eslint/typescript-eslint/commit/391566172dbc6013be79952fc68a588bf653fa8d))
+* bump ts-api-utils to v0.0.22 ([#6472](https://github.com/typescript-eslint/typescript-eslint/issues/6472)) ([b88cd23](https://github.com/typescript-eslint/typescript-eslint/commit/b88cd2332921efcca7ec5f4176f19779346d963b))
+* create TSTypeQuery node when TSImportType has isTypeOf ([#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076)) ([2b69b65](https://github.com/typescript-eslint/typescript-eslint/commit/2b69b659d87b58468e413801d31086ae0eeafff4)), closes [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864)
+* drop support for ESLint v6 ([#5972](https://github.com/typescript-eslint/typescript-eslint/issues/5972)) ([bda806d](https://github.com/typescript-eslint/typescript-eslint/commit/bda806d78ee46133587d9383baff52d796a594e5))
+* drop support for node v12 ([#5918](https://github.com/typescript-eslint/typescript-eslint/issues/5918)) ([7e3fe9a](https://github.com/typescript-eslint/typescript-eslint/commit/7e3fe9a67abd394b0a114f2deb466edf5c9759ac))
+* drop support for node v14 and test against node v20 ([#7022](https://github.com/typescript-eslint/typescript-eslint/issues/7022)) ([e6235bf](https://github.com/typescript-eslint/typescript-eslint/commit/e6235bf61b781066653581b57b7cd976c9c4f905))
+* **eslint-plugin:** [prefer-nullish-coalescing]: add support for assignment expressions ([#5234](https://github.com/typescript-eslint/typescript-eslint/issues/5234)) ([4bdbe67](https://github.com/typescript-eslint/typescript-eslint/commit/4bdbe67955fd591c25e58b13e674ba05bf5ed585))
+* **eslint-plugin:** [prefer-optional-chain] handle cases where the first operands are unrelated to the rest of the chain and add type info ([#6397](https://github.com/typescript-eslint/typescript-eslint/issues/6397)) ([02a37c4](https://github.com/typescript-eslint/typescript-eslint/commit/02a37c4c79d9b83998b7ee1376be43b06e12b3a0))
+* **eslint-plugin:** [prefer-readonly-parameter-types] added an optional type allowlist ([#4436](https://github.com/typescript-eslint/typescript-eslint/issues/4436)) ([c9427b7](https://github.com/typescript-eslint/typescript-eslint/commit/c9427b78b69f1a6a2453ef2df2be5bf96b7b00bc))
+* **eslint-plugin:** [restrict-plus-operands] change checkCompoundAssignments to skipCompoundAssignments ([#7027](https://github.com/typescript-eslint/typescript-eslint/issues/7027)) ([dc801d8](https://github.com/typescript-eslint/typescript-eslint/commit/dc801d892ecc1af678ff37166481f4b69186164c))
+* **eslint-plugin:** add config that disables type-aware linting ([#6470](https://github.com/typescript-eslint/typescript-eslint/issues/6470)) ([3b063cf](https://github.com/typescript-eslint/typescript-eslint/commit/3b063cfadce50985f8ec6d8f44f5b1cbd5c1ea57))
+* **eslint-plugin:** apply final v6 changes to configs ([#7110](https://github.com/typescript-eslint/typescript-eslint/issues/7110)) ([c13ce0b](https://github.com/typescript-eslint/typescript-eslint/commit/c13ce0b4f7a74a6d8fecf78d25ebd8181f7a9119))
+* **eslint-plugin:** deprecate no-type-alias ([#6229](https://github.com/typescript-eslint/typescript-eslint/issues/6229)) ([820bdf2](https://github.com/typescript-eslint/typescript-eslint/commit/820bdf2a3934d4186d51186693ced02df64a57ce))
+* **eslint-plugin:** final final config changes for v6 ([#7157](https://github.com/typescript-eslint/typescript-eslint/issues/7157)) ([e35c5c1](https://github.com/typescript-eslint/typescript-eslint/commit/e35c5c1c39f3d76b916ad1c1ac2c7bf05b379193))
+* **eslint-plugin:** rework configs: recommended, strict, stylistic; -type-checked ([#5251](https://github.com/typescript-eslint/typescript-eslint/issues/5251)) ([5346b5b](https://github.com/typescript-eslint/typescript-eslint/commit/5346b5bbdbba81439ba761c282ba9cdcec7b45c8)), closes [#5036](https://github.com/typescript-eslint/typescript-eslint/issues/5036) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5889](https://github.com/typescript-eslint/typescript-eslint/issues/5889) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5883](https://github.com/typescript-eslint/typescript-eslint/issues/5883) [#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863) [#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381) [#5256](https://github.com/typescript-eslint/typescript-eslint/issues/5256) [#5399](https://github.com/typescript-eslint/typescript-eslint/issues/5399)
+* **experimental-utils:** console.warn on import of experimental-utils ([#6179](https://github.com/typescript-eslint/typescript-eslint/issues/6179)) ([0b7476b](https://github.com/typescript-eslint/typescript-eslint/commit/0b7476b4570f5630645420dbb0b8b753e04b5fe1))
+* fork json schema types for better compat with ESLint rule validation ([#6963](https://github.com/typescript-eslint/typescript-eslint/issues/6963)) ([a4967f2](https://github.com/typescript-eslint/typescript-eslint/commit/a4967f2e8cc7b0432d8dfe804772e60042c5384c))
+* improve error location ([#6556](https://github.com/typescript-eslint/typescript-eslint/issues/6556)) ([355adf0](https://github.com/typescript-eslint/typescript-eslint/commit/355adf0b5dcc1b4f5c360722acc1ba8b6f4e4117))
+* improve rule schemas, add test to validate schemas, add tooling to generate schema types ([#6899](https://github.com/typescript-eslint/typescript-eslint/issues/6899)) ([acc1a43](https://github.com/typescript-eslint/typescript-eslint/commit/acc1a43e02a403ff74a54c28c2c495f00d0be038))
+* made BaseNode.parent non-optional ([#5252](https://github.com/typescript-eslint/typescript-eslint/issues/5252)) ([a4768f3](https://github.com/typescript-eslint/typescript-eslint/commit/a4768f38ef4943873c1e9443e8cd101a663ac3c0)), closes [#5036](https://github.com/typescript-eslint/typescript-eslint/issues/5036) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5889](https://github.com/typescript-eslint/typescript-eslint/issues/5889) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5883](https://github.com/typescript-eslint/typescript-eslint/issues/5883) [#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863) [#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381) [#5256](https://github.com/typescript-eslint/typescript-eslint/issues/5256) [#5399](https://github.com/typescript-eslint/typescript-eslint/issues/5399)
+* raise tsconfig target to ES2021 ([#5981](https://github.com/typescript-eslint/typescript-eslint/issues/5981)) ([2a5e20f](https://github.com/typescript-eslint/typescript-eslint/commit/2a5e20fd6733ccfa63dfc137287ae18027d4691a))
+* remove `experimental-utils` ([#6468](https://github.com/typescript-eslint/typescript-eslint/issues/6468)) ([71adbc5](https://github.com/typescript-eslint/typescript-eslint/commit/71adbc5119fa55c29d55747a64e9f4e178374c3c))
+* remove `RuleTester` in `/utils` in favour of the new `/rule-tester` package ([#6816](https://github.com/typescript-eslint/typescript-eslint/issues/6816)) ([c33f497](https://github.com/typescript-eslint/typescript-eslint/commit/c33f497ad8aec7c123c7374f7aff3e24025fe861))
+* remove moduleResolver API ([#6609](https://github.com/typescript-eslint/typescript-eslint/issues/6609)) ([f0f45a9](https://github.com/typescript-eslint/typescript-eslint/commit/f0f45a9d35453c3ec601df770092d236c72d447b))
+* remove partial type-information program ([#6066](https://github.com/typescript-eslint/typescript-eslint/issues/6066)) ([7fc062a](https://github.com/typescript-eslint/typescript-eslint/commit/7fc062abc30a73093cd943c2cb808ae373fe12d9))
+* remove semantically invalid properties from TSEnumDeclaration, TSInterfaceDeclaration and TSModuleDeclaration ([#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863)) ([844875c](https://github.com/typescript-eslint/typescript-eslint/commit/844875cbe933195ff25ba218f82ede3ebde9a0a0))
+* **scope-manager:** ignore ECMA version ([#5889](https://github.com/typescript-eslint/typescript-eslint/issues/5889)) ([f2330f7](https://github.com/typescript-eslint/typescript-eslint/commit/f2330f79739eb93e3c290ccc6e810a01e097eda0)), closes [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5883](https://github.com/typescript-eslint/typescript-eslint/issues/5883)
+* **typescript-estree:** add type checker wrapper APIs to ParserServicesWithTypeInformation ([#6404](https://github.com/typescript-eslint/typescript-eslint/issues/6404)) ([62d5755](https://github.com/typescript-eslint/typescript-eslint/commit/62d57559564fb08512eafe03a2c1b167c4377601))
+* **typescript-estree:** added allowInvalidAST option to not throw on invalid tokens ([#6247](https://github.com/typescript-eslint/typescript-eslint/issues/6247)) ([a3b177d](https://github.com/typescript-eslint/typescript-eslint/commit/a3b177d59adaf8ea76b205befc8b12d86447f1fb))
+* **typescript-estree:** allow providing code as a ts.SourceFile ([#5892](https://github.com/typescript-eslint/typescript-eslint/issues/5892)) ([af41b7f](https://github.com/typescript-eslint/typescript-eslint/commit/af41b7fa7b9b8f3023fdabd40846598d5d4d4f61))
+* **typescript-estree:** check for illegal decorators on function declarations ([#6590](https://github.com/typescript-eslint/typescript-eslint/issues/6590)) ([1b39cfd](https://github.com/typescript-eslint/typescript-eslint/commit/1b39cfd307955deb8e407cf8dd3a6ca1ed1b8df6))
+* **typescript-estree:** check modifiers on every node ([#6615](https://github.com/typescript-eslint/typescript-eslint/issues/6615)) ([62d6230](https://github.com/typescript-eslint/typescript-eslint/commit/62d62304e16b553274a80d8ab2653543a22f2391))
+* **typescript-estree:** deprecate createDefaultProgram ([#5890](https://github.com/typescript-eslint/typescript-eslint/issues/5890)) ([426d6b6](https://github.com/typescript-eslint/typescript-eslint/commit/426d6b647e6df3e312d1cef3e28dadaef6675fd3))
+* **typescript-estree:** forbid members in Mapped Type ([#6802](https://github.com/typescript-eslint/typescript-eslint/issues/6802)) ([b93458f](https://github.com/typescript-eslint/typescript-eslint/commit/b93458f9dfe36409d3a736a081ab69ba749caf24))
+* **typescript-estree:** remove optionality from AST boolean properties ([#6274](https://github.com/typescript-eslint/typescript-eslint/issues/6274)) ([df131e2](https://github.com/typescript-eslint/typescript-eslint/commit/df131e258c93e5714c88c0373cfeb2e1e75afc75))
+* **typescript-estree:** remove parseWithNodeMaps ([#7120](https://github.com/typescript-eslint/typescript-eslint/issues/7120)) ([e2a0a76](https://github.com/typescript-eslint/typescript-eslint/commit/e2a0a768d18a6aed5046946a2b57b219a54dcf3e))
+* **typescript-estree:** strict class heritage clauses check ([#6576](https://github.com/typescript-eslint/typescript-eslint/issues/6576)) ([530185b](https://github.com/typescript-eslint/typescript-eslint/commit/530185bd7e62b05adc673d1f96257dd14bb4d9dc))
+* **typescript-estree:** throw errors for object methods without function bodies ([#6589](https://github.com/typescript-eslint/typescript-eslint/issues/6589)) ([1d78576](https://github.com/typescript-eslint/typescript-eslint/commit/1d78576d41323e35c2d2a2ecc92f6ee76ed61d57))
+* **typescript-estree:** throw errors on interface with implements ([#6551](https://github.com/typescript-eslint/typescript-eslint/issues/6551)) ([67e05c8](https://github.com/typescript-eslint/typescript-eslint/commit/67e05c8f0381ba7065a0257d6038f0a50a3b9888))
+* **typescript-estree:** throw errors when abstract property has initializer ([#6613](https://github.com/typescript-eslint/typescript-eslint/issues/6613)) ([dcdbc76](https://github.com/typescript-eslint/typescript-eslint/commit/dcdbc76d5418a383968d15e32d2eba7a9d2d7e79))
+* **typescript-estree:** warn on deprecated AST property accesses ([#6525](https://github.com/typescript-eslint/typescript-eslint/issues/6525)) ([79c058d](https://github.com/typescript-eslint/typescript-eslint/commit/79c058d69f723ed18a3a7631370009359510d128))
+* **utils:** remove (ts-)eslint-scope types ([#5256](https://github.com/typescript-eslint/typescript-eslint/issues/5256)) ([df54175](https://github.com/typescript-eslint/typescript-eslint/commit/df541751c6510f5d15d863f515cff3748fd9e688))
+* **utils:** remove obsolete `meta.docs.suggestion` rule type ([#5967](https://github.com/typescript-eslint/typescript-eslint/issues/5967)) ([f424b2a](https://github.com/typescript-eslint/typescript-eslint/commit/f424b2a519595283be01149f0e13eb7f869bd247))
+
+
+### BREAKING CHANGES
+
+* Removes `experimental-utils` - we will no longer update this package and it will be forever frozen at v5.x
+* **eslint-plugin:** Adds an additional class of checks to the rule
+* drop support for ESLint v6
+* drops support for node v17
+* **utils:** Removes `meta.docs.suggestion` property
+* Bumps the minimum supported range and removes handling for old versions
+* drops support for node v12
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+
+
+
+
# [5.62.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.61.0...v5.62.0) (2023-07-10)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index a7ae6f2d0680..031a9105d306 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -1,3 +1,12 @@
+
+
# Contributors
Thanks goes to these wonderful people:
diff --git a/docs/Packages.mdx b/docs/Packages.mdx
index 0e34d2815c76..e0eee8cf1781 100644
--- a/docs/Packages.mdx
+++ b/docs/Packages.mdx
@@ -12,6 +12,7 @@ They are:
- [`@typescript-eslint/eslint-plugin`](./packages/ESLint_Plugin.mdx): An ESLint plugin which provides lint rules for TypeScript codebases.
- [`@typescript-eslint/eslint-plugin-tslint`](./packages/ESLint_Plugin_TSLint.mdx): An ESLint plugin that allows running TSLint rules within ESLint to help you migrate from TSLint to ESLint.
- [`@typescript-eslint/parser`](./packages/Parser.mdx): An ESLint parser which allows for ESLint to lint TypeScript source code.
+- [`@typescript-eslint/rule-tester`](./packages/Rule_Tester.mdx): A utility for testing ESLint rules.
- [`@typescript-eslint/scope-manager`](./packages/Scope_Manager.mdx): A fork of [`eslint-scope`](https://github.com/eslint/eslint-scope), enhanced to support TypeScript functionality.
- [`@typescript-eslint/typescript-estree`](./packages/TypeScript_ESTree.mdx): The underlying code used by [`@typescript-eslint/parser`](./packages/Parser.mdx) that converts TypeScript source code into an [ESTree](https://github.com/estree/estree)-compatible form.
- [`@typescript-eslint/utils`](./packages/Utils.mdx): Utilities for working with TypeScript + ESLint together.
diff --git a/docs/developers/Custom_Rules.mdx b/docs/developers/Custom_Rules.mdx
index c2b4087dc638..29ed9adde0ea 100644
--- a/docs/developers/Custom_Rules.mdx
+++ b/docs/developers/Custom_Rules.mdx
@@ -63,7 +63,6 @@ export const rule = createRule({
docs: {
description:
'Function declaration names should start with an upper-case letter.',
- recommended: 'warn',
},
messages: {
uppercase: 'Start this name with an upper-case letter.',
@@ -210,38 +209,40 @@ Read TypeScript's [Compiler APIs > Using the Type Checker](https://github.com/mi
The biggest addition typescript-eslint brings to ESLint rules is the ability to use TypeScript's type checker APIs.
-`@typescript-eslint/utils` exports an `ESLintUtils` namespace containing a `getParserServices` function that takes in an ESLint context and returns a `parserServices` object.
+`@typescript-eslint/utils` exports an `ESLintUtils` namespace containing a `getParserServices` function that takes in an ESLint context and returns a `services` object.
-That `parserServices` object contains:
+That `services` object contains:
-- `program`: A full TypeScript `ts.Program` object
+- `program`: A full TypeScript `ts.Program` object if type checking is enabled, or `null` otherwise
- `esTreeNodeToTSNodeMap`: Map of `@typescript-eslint/estree` `TSESTree.Node` nodes to their TypeScript `ts.Node` equivalents
- `tsNodeToESTreeNodeMap`: Map of TypeScript `ts.Node` nodes to their `@typescript-eslint/estree` `TSESTree.Node` equivalents
-By mapping from ESTree nodes to TypeScript nodes and retrieving the TypeScript program from the parser services, rules are able to ask TypeScript for full type information on those nodes.
+If type checking is enabled, that `services` object additionally contains:
-This rule bans for-of looping over an enum by using the type-checker via typescript-eslint and TypeScript APIs:
+- `getTypeAtLocation`: Wraps the type checker function, with a `TSESTree.Node` parameter instead of a `ts.Node`
+- `getSymbolAtLocation`: Wraps the type checker function, with a `TSESTree.Node` parameter instead of a `ts.Node`
+
+Those additional objects internally map from ESTree nodes to their TypeScript equivalents, then call to the TypeScript program.
+By using the TypeScript program from the parser services, rules are able to ask TypeScript for full type information on those nodes.
+
+This rule bans for-of looping over an enum by using the TypeScript type checker via typescript-eslint's services:
```ts
import { ESLintUtils } from '@typescript-eslint/utils';
+import * as tsutils from 'ts-api-tools';
import * as ts from 'typescript';
-import * as tsutils from 'tsutils';
export const rule = createRule({
create(context) {
return {
ForOfStatement(node) {
- // 1. Grab the TypeScript program from parser services
- const parserServices = ESLintUtils.getParserServices(context);
- const checker = parserServices.program.getTypeChecker();
+ // 1. Grab the parser services for the rule
+ const services = ESLintUtils.getParserServices(context);
- // 2. Find the backing TS node for the ES node, then that TS type
- const originalNode = parserServices.esTreeNodeToTSNodeMap.get(
- node.right,
- );
- const nodeType = checker.getTypeAtLocation(originalNode);
+ // 2. Find the TS type for the ES node
+ const type = services.getTypeAtLocation(node);
- // 3. Check the TS node type using the TypeScript APIs
+ // 3. Check the TS type using the TypeScript APIs
if (tsutils.isTypeFlagSet(nodeType, ts.TypeFlags.EnumLike)) {
context.report({
messageId: 'loopOverEnum',
@@ -254,7 +255,6 @@ export const rule = createRule({
meta: {
docs: {
description: 'Avoid looping over enums.',
- recommended: 'error',
},
messages: {
loopOverEnum: 'Do not loop over enums.',
@@ -267,20 +267,27 @@ export const rule = createRule({
});
```
+:::note
+Rules can retrieve their full backing TypeScript type checker with `services.program.getTypeChecker()`.
+This can be necessary for TypeScript APIs not wrapped by the parser services.
+:::
+
## Testing
-`@typescript-eslint/utils` exports a `RuleTester` with a similar API to the built-in [ESLint `RuleTester`](https://eslint.org/docs/developer-guide/nodejs-api#ruletester).
+`@typescript-eslint/rule-tester` exports a `RuleTester` with a similar API to the built-in ESLint `RuleTester`.
It should be provided with the same `parser` and `parserOptions` you would use in your ESLint configuration.
+Below is a quick-start guide. For more in-depth docs and examples [see the `@typescript-eslint/rule-tester` package documentation](../packages/Rule_Tester.mdx).
+
### Testing Untyped Rules
For rules that don't need type information, passing just the `parser` will do:
```ts
-import { ESLintUtils } from '@typescript-eslint/utils';
+import { RuleTester } from '@typescript-eslint/rule-tester';
import rule from './my-rule';
-const ruleTester = new ESLintUtils.RuleTester({
+const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
});
@@ -300,10 +307,10 @@ For rules that do need type information, `parserOptions` must be passed in as we
Tests must have at least an absolute `tsconfigRootDir` path provided as well as a relative `project` path from that directory:
```ts
-import { ESLintUtils } from '@typescript-eslint/utils';
+import { RuleTester } from '@typescript-eslint/rule-tester';
import rule from './my-typed-rule';
-const ruleTester = new ESLintUtils.RuleTester({
+const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
@@ -322,11 +329,11 @@ ruleTester.run('my-typed-rule', rule, {
```
:::note
-For now, `ESLintUtils.RuleTester` requires the following physical files be present on disk for typed rules:
+For now, `RuleTester` requires the following physical files be present on disk for typed rules:
- `tsconfig.json`: tsconfig used as the test "project"
- One of the following two files:
- `file.ts`: blank test file used for normal TS tests
- - `file.tsx`: blank test file used for tests with `parserOptions: { ecmaFeatures: { jsx: true } }`
+ - `react.tsx`: blank test file used for tests with `parserOptions: { ecmaFeatures: { jsx: true } }`
:::
diff --git a/docs/linting/Configurations.mdx b/docs/linting/Configurations.mdx
index 10d3f6293d54..50bb32858fea 100644
--- a/docs/linting/Configurations.mdx
+++ b/docs/linting/Configurations.mdx
@@ -3,23 +3,60 @@ id: configs
title: Configurations
---
-[ESLint shareable configurations](https://eslint.org/docs/latest/developer-guide/shareable-configs) exist to provide a comprehensive base config for you.
+[ESLint shareable configurations](https://eslint.org/docs/latest/developer-guide/shareable-configs) exist to provide a comprehensive list of rules settings that you can start with.
`@typescript-eslint/eslint-plugin` includes built-in configurations you can extend from to pull in the recommended starting rules.
-> With the exception of `strict`, all configurations are considered "stable".
+> With the exception of `all`, `strict`, and `strict-type-checked`, all configurations are considered "stable".
> Rule additions and removals are treated as breaking changes and will only be done in major version bumps.
+## Getting Started
+
+### Projects Without Type Checking
+
+If your project does not enable [typed linting](./Typed_Linting.mdx), we suggest enabling the [`recommended`](#recommended) and [`stylistic`](#stylistic) configurations to start:
+
+```js title=".eslintrc.js"
+module.exports = {
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:@typescript-eslint/stylistic',
+ ],
+};
+```
+
+> If a majority of developers working on your project are comfortable with TypeScript and typescript-eslint, consider replacing `recommended` with `strict`.
+
+### Projects With Type Checking
+
+If your project enables [typed linting](./Typed_Linting.mdx), we suggest enabling the [`recommended-type-checked`](#recommended-type-checked) and [`stylistic-type-checked`](#stylistic-type-checked) configurations to start:
+
+```js title=".eslintrc.js"
+module.exports = {
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/recommended-type-checked',
+ 'plugin:@typescript-eslint/stylistic-type-checked',
+ ],
+};
+```
+
+> If a majority of developers working on your project are comfortable with TypeScript and typescript-eslint, consider replacing `recommended-type-checked` with `strict-type-checked`.
+
## Recommended Configurations
-Most projects should extend from at least one of:
+We recommend that most projects should extend from one of:
- [`recommended`](#recommended): Recommended rules for code correctness that you can drop in without additional configuration.
-- [`recommended-requiring-type-checking`](#recommended-requiring-type-checking): Additional recommended rules that require type information.
+- [`recommended-type-checked`](#recommended-type-checked): Additional recommended rules that require type information.
- [`strict`](#strict): Additional strict rules that can also catch bugs but are more opinionated than recommended rules.
+- [`strict-type-checked`](#strict-type-checked): Additional strict rules require type information.
-:::tip
-We recommend most projects use [`recommended-requiring-type-checking`](#recommended-requiring-type-checking) (which requires [typed linting](./Typed_Linting.mdx)).
-:::
+Additionally, we provide a [`stylistic`](#stylistic) config that enforces concise and consistent code.
+We recommend that most projects should extend from either:
+
+- [`stylistic`](#stylistic): Stylistic rules you can drop in without additional configuration.
+- [`stylistic-type-checked`](#stylistic-type-checked): Additional stylistic rules that require type information.
:::note
These configurations are our recommended starting points, but **you don't need to use them as-is**.
@@ -31,104 +68,158 @@ See [ESLint's Configuring Rules docs](https://eslint.org/docs/user-guide/configu
Recommended rules for code correctness that you can drop in without additional configuration.
These rules are those whose reports are almost always for a bad practice and/or likely bug.
-`recommended` also disables rules known to conflict with this repository, or cause issues in TypeScript codebases.
+`recommended` also disables core ESLint rules known to conflict with typescript-eslint rules or cause issues in TypeScript codebases.
-```json
-{
- "extends": ["plugin:@typescript-eslint/recommended"]
-}
+```js title=".eslintrc.js"
+module.exports = {
+ extends: ['plugin:@typescript-eslint/recommended'],
+};
```
-See [`configs/recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts) for the exact contents of this config.
+See [`configs/recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/recommended.ts) for the exact contents of this config.
-:::tip
-We strongly recommend all TypeScript projects extend from `plugin:@typescript-eslint/recommended`.
-:::
+### `recommended-type-checked`
+
+Contains all of `recommended` along with additional recommended rules that require type information.
+Rules newly added in this configuration are similarly useful to those in `recommended`.
+
+```js title=".eslintrc.js"
+module.exports = {
+ extends: ['plugin:@typescript-eslint/recommended-type-checked'],
+};
+```
+
+See [`configs/recommended-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/recommended-type-checked.ts) for the exact contents of this config.
-### `recommended-requiring-type-checking`
+### `strict`
-Additional recommended rules that require type information.
-Rules in this configuration are similarly useful to those in `recommended`.
+Contains all of `recommended`, as well as additional strict rules that can also catch bugs.
+Rules added in `strict` are more opinionated than recommended rules and might not apply to all projects.
-```json
-{
- "extends": [
- "plugin:@typescript-eslint/recommended",
- "plugin:@typescript-eslint/recommended-requiring-type-checking"
- ]
-}
+```js title=".eslintrc.js"
+module.exports = {
+ extends: ['plugin:@typescript-eslint/strict'],
+};
```
-See [`configs/recommended-requiring-type-checking.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts) for the exact contents of this config.
+See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/strict.ts) for the exact contents of this config.
-:::tip
-We recommend all TypeScript projects extend from `plugin:@typescript-eslint/recommended-requiring-type-checking`, with the caveat that rules using type information take longer to run.
-See [Linting with Type Information](/linting/typed-linting) for more details.
+:::caution
+We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict` only if a nontrivial percentage of its developers are highly proficient in TypeScript.
:::
-### `strict`
+### `strict-type-checked`
-Additional strict rules that can also catch bugs but are more opinionated than recommended rules.
+Contains all of `recommended`, `recommended-type-checked`, and `strict`, along with additional strict rules that require type information.
+Rules newly added in this configuration are similarly useful (and opinionated) to those in `strict`.
-```json
-{
- "extends": [
- "plugin:@typescript-eslint/recommended",
- "plugin:@typescript-eslint/recommended-requiring-type-checking",
- "plugin:@typescript-eslint/strict"
- ]
-}
+```js title=".eslintrc.js"
+module.exports = {
+ extends: ['plugin:@typescript-eslint/strict-type-checked'],
+};
```
-See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts) for the exact contents of this config.
+See [`configs/strict-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/strict-type-checked.ts) for the exact contents of this config.
:::caution
-We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict` only if a nontrivial percentage of its developers are highly proficient in TypeScript.
+We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict-type-checked` only if a nontrivial percentage of its developers are highly proficient in TypeScript.
:::
+### `stylistic`
+
+Rules considered to be best practice for modern TypeScript codebases, but that do not impact program logic.
+These rules are generally opinionated about enforcing simpler code patterns.
+
+```js title=".eslintrc.js"
+module.exports = {
+ extends: ['plugin:@typescript-eslint/stylistic'],
+};
+```
+
+See [`configs/stylistic.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/stylistic.ts) for the exact contents of this config.
+
+### `stylistic-type-checked`
+
+Contains all of `stylistic`, along with additional stylistic rules that require type information.
+Rules newly added in this configuration are similarly opinionated to those in `stylistic`.
+
+```js title=".eslintrc.js"
+module.exports = {
+ extends: ['plugin:@typescript-eslint/stylistic-type-checked'],
+};
+```
+
+See [`configs/stylistic-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/strict-type-checked.ts) for the exact contents of this config.
+
## Other Configurations
-typescript-eslint includes a scattering of utility configurations used by the recommended configurations.
-We don't recommend using these directly; instead, extend from an earlier recommended rule.
+typescript-eslint includes a few utility configurations.
### `all`
Enables each the rules provided as a part of typescript-eslint.
Note that many rules are not applicable in all codebases, or are meant to be configured.
-See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/all.ts) for the exact contents of this config.
+See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/all.ts) for the exact contents of this config.
:::warning
-We do not recommend a TypeScript projects extend from `plugin:@typescript-eslint/all`.
+We do not recommend TypeScript projects extend from `plugin:@typescript-eslint/all`.
Many rules conflict with each other and/or are intended to be configured per-project.
:::
### `base`
A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint.
-
-
+We don't recommend using this directly; instead, extend from an earlier recommended rule.
This config is automatically included if you use any of the recommended configurations.
+See [`configs/base.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/base.ts) for the exact contents of this config.
+
+### `disable-type-checked`
+
+A utility ruleset that will disable type-aware linting and all type-aware rules available in our project.
+This config is useful if you'd like to have your base config concerned with type-aware linting, and then conditionally use [overrides](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-based-on-glob-patterns) to disable type-aware linting on specific subsets of your codebase.
+
+See [`configs/disable-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/disable-type-checked.ts) for the exact contents of this config.
+
+:::info
+If you use type-aware rules from other plugins, you will need to manually disable these rules or use a premade config they provide to disable them.
+:::
+
+```js title=".eslintrc.js"
+module.exports = {
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/eslint-recommended',
+ ],
+ overrides: [
+ {
+ files: ['*.js'],
+ extends: ['plugin:@typescript-eslint/disable-type-checked'],
+ },
+ ],
+};
+```
+
### `eslint-recommended`
This ruleset is meant to be used after extending `eslint:recommended`.
It disables core ESLint rules that are already checked by the TypeScript compiler.
Additionally, it enables rules that promote using the more modern constructs TypeScript allows for.
-```jsonc
-{
- "extends": [
- "eslint:recommended",
- "plugin:@typescript-eslint/eslint-recommended"
- ]
-}
+```js title=".eslintrc.js"
+module.exports = {
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/eslint-recommended',
+ ],
+};
```
This config is automatically included if you use any of the recommended configurations.
-See [`configs/eslint-recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts) for the exact contents of this config.
+See [`configs/eslint-recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/v6/packages/eslint-plugin/src/configs/eslint-recommended.ts) for the exact contents of this config.
## Suggesting Configuration Changes
diff --git a/docs/linting/Troubleshooting.mdx b/docs/linting/Troubleshooting.mdx
index 7f254c2c51f0..2393a533a1d6 100644
--- a/docs/linting/Troubleshooting.mdx
+++ b/docs/linting/Troubleshooting.mdx
@@ -117,6 +117,42 @@ See our docs on [type aware linting](./Typed_Linting.mdx) for more information.
You're using an outdated version of `@typescript-eslint/parser`.
Update to the latest version to see a more informative version of this error message, explained [above](#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file 'backlink to I get errors telling me ESLint was configured to run ...').
+## How do I turn on a `@typescript-eslint` rule?
+
+First make sure you've read the docs and understand ESLint configuration files:
+
+- [Read our getting started guide](../Getting_Started.mdx) to ensure your config is properly setup to start configuring our rules.
+- [Checkout ESLint's documentation on configuring rules](https://eslint.org/docs/latest/use/configure/rules) to ensure you understand how to configure rules.
+
+Our [rule docs](/rules) detail the options each rule supports under the "Options" heading.
+We use TypeScript types to describe an `Options` tuple type for the rule which you can use to configure the a rule.
+In your config file the keys of the `rules` object are the names of the rules you wish to configure and the values follow the following form:
+
+```ts
+type Severity = 'off' | 'warn' | 'error';
+type RuleConfig =
+ | Severity
+ | [Severity]
+ | [
+ Severiy,
+ // Options is the tuple type from the rule docs
+ ...Options,
+ ];
+```
+
+Some examples
+
+```js title=".eslintrc.js"
+module.exports = {
+ rules: {
+ // turns a rule on with no configuration (i.e. uses the default configuration)
+ '@typescript-eslint/array-type': 'error',
+ // turns on a rule with configuration
+ '@typescript-eslint/no-explicit-any': ['warn', { ignoreRestArgs: true }],
+ },
+};
+```
+
## I use a framework (like Vue) that requires custom file extensions, and I get errors like "You should add `parserOptions.extraFileExtensions` to your config"
You can use `parserOptions.extraFileExtensions` to specify an array of non-TypeScript extensions to allow, for example:
@@ -292,6 +328,28 @@ See [this issue comment](https://github.com/typescript-eslint/typescript-eslint/
See [Changes to one file are not reflected in linting other files in my IDE](#changes-to-one-file-are-not-reflected-when-linting-other-files-in-my-ide).
Rules such as [`no-unsafe-argument`](/rules/no-unsafe-argument), [`no-unsafe-assignment`](/rules/no-unsafe-assignment), and [`no-unsafe-call`](/rules/no-unsafe-call) are often impacted.
+## "The '``' property is deprecated on '``' nodes. Use '``' instead." warnings
+
+If you're seeing this warning, it's likely you're using an ESLint plugin (or other tooling) that hasn't been updated for typescript-eslint v6.
+Make sure you're using the latest versions of each of your ESLint plugins (and other tooling).
+
+If you've using many ESLint plugins, have updated each to their latest version, and you're not sure which one this complaint is coming from, try disabling half of them at a time to narrow down which plugin it is.
+Then make sure each of those plugins has a GitHub issue asking that they release a version supporting typescript-eslint v6.
+
+:::tip
+For developers updating ESLint rules in plugins that still need to support typescript-eslint v5: you may need to `||` fall back to the old property key if the new one doesn't exist:
+
+```diff
+- node.typeParameters
++ node.typeArguments || node.typeParameters
+```
+
+:::
+
+For more context, see the [Some properties named typeParameters instead of typeArguments](https://github.com/typescript-eslint/typescript-eslint/issues/146) issue, and the implementing [fix: rename typeParameters to typeArguments where needed](https://github.com/typescript-eslint/typescript-eslint/pull/5384) pull request.
+
+The [typescript-eslint v6 release post](https://deploy-preview-6515--typescript-eslint.netlify.app/blog/announcing-typescript-eslint-v6-beta) has more information on typescript-eslint v6.
+
## My linting feels really slow
If you think you're having issues with performance, see our [Performance Troubleshooting documentation](./troubleshooting/Performance.mdx).
diff --git a/docs/linting/Typed_Linting.mdx b/docs/linting/Typed_Linting.mdx
index ae21eea641e8..290aca7d3921 100644
--- a/docs/linting/Typed_Linting.mdx
+++ b/docs/linting/Typed_Linting.mdx
@@ -13,7 +13,7 @@ module.exports = {
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
// Add this line
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
+ 'plugin:@typescript-eslint/recommended-type-checked',
],
plugins: ['@typescript-eslint'],
parser: '@typescript-eslint/parser',
@@ -34,7 +34,7 @@ See [our TSConfig inclusion FAQ](./Troubleshooting.mdx#i-get-errors-telling-me-e
In more detail:
-- `plugin:@typescript-eslint/recommended-requiring-type-checking` is another [recommended configuration](./Configurations.mdx) we provide. This one contains recommended rules that additionally require type information.
+- `plugin:@typescript-eslint/recommended-type-checked` is another [recommended configuration](./Configurations.mdx) we provide. This one contains recommended rules that additionally require type information.
- `parserOptions.project` tells our parser how to find the TSConfig for each source file (`true` indicates to find the closest `tsconfig.json` for each source file)
- If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/Monorepos.mdx).
- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser#tsconfigRootDir](../packages/Parser.mdx#tsconfigRootDir)).
@@ -61,7 +61,7 @@ module.exports = {
};
```
-See [the `@typescript-eslint/parser` docs for more details](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/README.md#parseroptionsproject).
+See [the `@typescript-eslint/parser` docs for more details](../packages/Parser.mdx#project).
:::note
If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/Monorepos.mdx).
@@ -69,6 +69,39 @@ If your project is a multi-package monorepo, see [our docs on configuring a mono
## FAQs
+### How can I disable type-aware linting for a subset of files?
+
+You can combine ESLint's [overrides](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-based-on-glob-patterns) config in conjunction with our [`disable-type-checked`](./Configurations.mdx#disable-type-checked) config to turn off type-aware linting on specific subsets of files.
+
+```js title=".eslintrc.js"
+module.exports = {
+ extends: [
+ 'eslint:recommended',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:@typescript-eslint/recommended-type-checked',
+ ],
+ plugins: ['@typescript-eslint'],
+ parser: '@typescript-eslint/parser',
+ parserOptions: {
+ project: true,
+ tsconfigRootDir: __dirname,
+ },
+ root: true,
+ // Added lines start
+ overrides: [
+ {
+ files: ['*.js'],
+ extends: ['plugin:@typescript-eslint/disable-type-checked'],
+ },
+ ],
+ // Added lines end
+};
+```
+
+:::info
+If you use type-aware rules from other plugins, you will need to manually disable these rules or use a premade config they provide to disable them.
+:::
+
### How is performance?
Typed rules come with a catch.
diff --git a/docs/linting/typed-linting/Monorepos.mdx b/docs/linting/typed-linting/Monorepos.mdx
index 19cd0639bc69..43f688062b79 100644
--- a/docs/linting/typed-linting/Monorepos.mdx
+++ b/docs/linting/typed-linting/Monorepos.mdx
@@ -48,7 +48,7 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
+ 'plugin:@typescript-eslint/recommended-type-checked',
],
parser: '@typescript-eslint/parser',
parserOptions: {
@@ -74,7 +74,7 @@ module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
- 'plugin:@typescript-eslint/recommended-requiring-type-checking',
+ 'plugin:@typescript-eslint/recommended-type-checked',
],
parser: '@typescript-eslint/parser',
parserOptions: {
diff --git a/docs/maintenance/Dependency_Version_Upgrades.mdx b/docs/maintenance/Dependency_Version_Upgrades.mdx
index d06a1e854670..25903f3f5352 100644
--- a/docs/maintenance/Dependency_Version_Upgrades.mdx
+++ b/docs/maintenance/Dependency_Version_Upgrades.mdx
@@ -81,7 +81,7 @@ We generally start the process of supporting a new TypeScript version just after
- Change the `SUPPORTED_TYPESCRIPT_VERSIONS` constant's `<` version to the next version of TypeScript
- Change the `SUPPORTED_PRERELEASE_RANGES` constant to equal `['X.Y.2-rc']`
- Rename and update `patches/typescript*` to the new TypeScript version
- - Run `yarn generate:lib` to update `scope-manager`
+ - Run `yarn generate-lib` to update `scope-manager`
1. Once all PRs needed for the RC update PR are merged, merge the RC update PR
1. Once TypeScript releases the stable X.Y version, create and merge a PR with a title like `chore: bump TypeScript from X.YRC to X.Y` and the following changes:
- In the root `package.json`, remove `|| X.Y.2-rc2` from the `dependency` on `typescript`, and bump its `<` version to the next version of TypeScript
diff --git a/docs/packages/Parser.mdx b/docs/packages/Parser.mdx
index 4f09bbbe76b0..b710ec5faca2 100644
--- a/docs/packages/Parser.mdx
+++ b/docs/packages/Parser.mdx
@@ -43,7 +43,6 @@ interface ParserOptions {
jsxFragmentName?: string | null;
jsxPragma?: string | null;
lib?: string[];
- moduleResolver?: string;
program?: import('typescript').Program;
project?: string | string[] | true;
projectFolderIgnoreList?: string[];
@@ -150,31 +149,12 @@ Specifies the TypeScript `lib`s that are available. This is used by the scope an
If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler.
-### `moduleResolver`
-
-> Default `undefined`.
-
-This option allows you to provide a custom module resolution. The value should point to a JS file that default exports (`export default`, or `module.exports =`, or `export =`) a file with the following interface:
-
-```ts
-interface ModuleResolver {
- version: 1;
- resolveModuleNames(
- moduleNames: string[],
- containingFile: string,
- reusedNames: string[] | undefined,
- redirectedReference: ts.ResolvedProjectReference | undefined,
- options: ts.CompilerOptions,
- ): (ts.ResolvedModule | undefined)[];
-}
-```
-
### `program`
> Default `undefined`.
This option allows you to programmatically provide an instance of a TypeScript Program object that will provide type information to rules.
-This will override any programs that would have been computed from `parserOptions.project` or `parserOptions.createDefaultProgram`.
+This will override any programs that would have been computed from `parserOptions.project`.
All linted files must be part of the provided program(s).
[Refer to the TypeScript Wiki for an example on how to write the `resolveModuleNames` function](https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#customizing-module-resolution).
@@ -211,7 +191,7 @@ This option allows you to provide a path to your project's `tsconfig.json`. **Th
- TypeScript will ignore files with duplicate filenames in the same folder (for example, `src/file.ts` and `src/file.js`). TypeScript purposely ignore all but one of the files, only keeping the one file with the highest priority extension (the extension priority order (from highest to lowest) is `.ts`, `.tsx`, `.d.ts`, `.js`, `.jsx`). For more info see #955.
-- Note that if this setting is specified and `createDefaultProgram` is not, you must only lint files that are included in the projects as defined by the provided `tsconfig.json` files. If your existing configuration does not include all of the files you would like to lint, you can create a separate `tsconfig.eslint.json` as follows:
+- Note that if this setting is specified, you must only lint files that are included in the projects as defined by the provided `tsconfig.json` files. If your existing configuration does not include all of the files you would like to lint, you can create a separate `tsconfig.eslint.json` as follows:
```jsonc
{
diff --git a/docs/packages/Rule_Tester.mdx b/docs/packages/Rule_Tester.mdx
new file mode 100644
index 000000000000..8caec346d771
--- /dev/null
+++ b/docs/packages/Rule_Tester.mdx
@@ -0,0 +1,218 @@
+---
+id: rule-tester
+sidebar_label: rule-tester
+---
+
+import CodeBlock from '@theme/CodeBlock';
+
+# `@typescript-eslint/rule-tester`
+
+> A utility for testing ESLint rules
+
+This is a fork of ESLint's built-in `RuleTester` to provide some better types and additional features for testing TypeScript rules.
+
+## Usage
+
+For non-type-aware rules you can test them as follows:
+
+```ts
+import { RuleTester } from '@typescript-eslint/rule-tester';
+import rule from '../src/rules/my-rule.ts';
+
+const ruleTester = new RuleTester({
+ parser: '@typescript-eslint/parser',
+});
+
+ruleTester.run('my-rule', rule, {
+ valid: [
+ // valid tests can be a raw string,
+ 'const x = 1;',
+ // or they can be an object
+ {
+ code: 'const y = 2;',
+ options: [{ ruleOption: true }],
+ },
+
+ // you can enable JSX parsing by passing parserOptions.ecmaFeatures.jsx = true
+ {
+ code: 'const z = ;',
+ parserOptions: {
+ ecmaFeatures: {
+ jsx: true,
+ },
+ },
+ },
+ ],
+ invalid: [
+ // invalid tests must always be an object
+ {
+ code: 'const a = 1;',
+ // invalid tests must always specify the expected errors
+ errors: [
+ {
+ messageId: 'ruleMessage',
+ // If applicable - it's recommended that you also assert the data in
+ // addition to the messageId so that you can ensure the correct message
+ // is generated
+ data: {
+ placeholder1: 'a',
+ },
+ },
+ ],
+ },
+
+ // fixers can be tested using the output parameter
+ {
+ code: 'const b = 1;',
+ output: 'const c = 1;',
+ errors: [
+ /* ... */
+ ],
+ },
+ // passing `output = null` will enforce the code is NOT changed
+ {
+ code: 'const c = 1;',
+ output: null,
+ errors: [
+ /* ... */
+ ],
+ },
+
+ // suggestions can be tested via errors
+ {
+ code: 'const d = 1;',
+ output: null,
+ errors: [
+ {
+ messageId: 'suggestionError',
+ suggestions: [
+ {
+ messageId: 'suggestionOne',
+ output: 'const e = 1;',
+ },
+ ],
+ },
+ ],
+ },
+ // passing `suggestions = null` will enforce there are NO suggestions
+ {
+ code: 'const d = 1;',
+ output: null,
+ errors: [
+ {
+ messageId: 'noSuggestionError',
+ suggestions: null,
+ },
+ ],
+ },
+ ],
+});
+```
+
+### Type-Aware Testing
+
+Type-aware rules can be tested in almost exactly the same way, except you need to create some files on disk.
+We require files on disk due to a limitation with TypeScript in that it requires physical files on disk to initialize the project.
+We suggest creating a `fixture` folder nearby that contains three files:
+
+1. `file.ts` - this should be an empty file.
+2. `react.tsx` - this should be an empty file.
+3. `tsconfig.json` - this should be the config to use for your test, for example:
+ ```json
+ {
+ "compilerOptions": {
+ "strict": true
+ },
+ "include": ["file.ts", "react.tsx"]
+ }
+ ```
+
+:::caution
+It's important to note that both `file.ts` and `react.tsx` must both be empty files!
+The rule tester will automatically use the string content from your tests - the empty files are just there for initialization.
+:::
+
+You can then test your rule by providing the type-aware config:
+
+```ts
+const ruleTester = new RuleTester({
+ parser: '@typescript-eslint/parser',
+ // Added lines start
+ parserOptions: {
+ tsconfigRootDir: './path/to/your/folder/fixture',
+ project: './tsconfig.json',
+ },
+ // Added lines end
+});
+```
+
+With that config the parser will automatically run in type-aware mode and you can write tests just like before.
+
+### Test Dependency Constraints
+
+Sometimes it's desirable to test your rule against multiple versions of a dependency to ensure backwards and forwards compatibility.
+With backwards-compatibility testing there comes a complication in that some tests may not be compatible with an older version of a dependency.
+For example - if you're testing against an older version of TypeScript, certain features might cause a parser error!
+
+import DependencyConstraint from '!!raw-loader!../../packages/rule-tester/src/types/DependencyConstraint.ts';
+
+{DependencyConstraint}
+
+The `RuleTester` allows you to apply dependency constraints at either an individual test or constructor level.
+
+```ts
+const ruleTester = new RuleTester({
+ parser: '@typescript-eslint/parser',
+ // Added lines start
+ dependencyConstraints: {
+ // none of the tests will run unless `my-dependency` matches the semver range `>=1.2.3`
+ 'my-dependency': '1.2.3',
+ // you can also provide granular semver ranges
+ 'my-granular-dep': {
+ // none of the tests will run unless `my-granular-dep` matches the semver range `~3.2.1`
+ range: '~3.2.1',
+ },
+ },
+ // Added lines end
+});
+
+ruleTester.run('my-rule', rule, {
+ valid: [
+ {
+ code: 'const y = 2;',
+ // Added lines start
+ dependencyConstraints: {
+ // this test won't run unless BOTH dependencies match the given ranges
+ first: '1.2.3',
+ second: '3.2.1',
+ },
+ // Added lines end
+ },
+ ],
+ invalid: [
+ /* ... */
+ ],
+});
+```
+
+All dependencies provided in the `dependencyConstraints` object must match their given ranges in order for a test to not be skipped.
+
+## Options
+
+### `RuleTester` constructor options
+
+import RuleTesterConfig from '!!raw-loader!../../packages/rule-tester/src/types/RuleTesterConfig.ts';
+
+{RuleTesterConfig}
+
+### Valid test case options
+
+import ValidTestCase from '!!raw-loader!../../packages/rule-tester/src/types/ValidTestCase.ts';
+
+{ValidTestCase}
+
+### Invalid test case options
+
+import InvalidTestCase from '!!raw-loader!../../packages/rule-tester/src/types/InvalidTestCase.ts';
+
+{InvalidTestCase}
diff --git a/docs/packages/Scope_Manager.mdx b/docs/packages/Scope_Manager.mdx
index af7bd6e27c5c..cd33ac0fc751 100644
--- a/docs/packages/Scope_Manager.mdx
+++ b/docs/packages/Scope_Manager.mdx
@@ -23,13 +23,6 @@ interface AnalyzeOptions {
*/
childVisitorKeys?: Record | null;
- /**
- * Which ECMAScript version is considered.
- * Defaults to `2018`.
- * `'latest'` is converted to 1e8 at parser.
- */
- ecmaVersion?: EcmaVersion | 1e8;
-
/**
* Whether the whole script is executed under node.js environment.
* When enabled, the scope manager adds a function scope immediately following the global scope.
@@ -38,7 +31,7 @@ interface AnalyzeOptions {
globalReturn?: boolean;
/**
- * Implied strict mode (if ecmaVersion >= 5).
+ * Implied strict mode.
* Defaults to `false`.
*/
impliedStrict?: boolean;
@@ -63,7 +56,7 @@ interface AnalyzeOptions {
* This automatically defines a type variable for any types provided by the configured TS libs.
* For more information, see https://www.typescriptlang.org/tsconfig#lib
*
- * Defaults to the lib for the provided `ecmaVersion`.
+ * Defaults to ['esnext'].
*/
lib?: Lib[];
@@ -92,7 +85,6 @@ const ast = parse(code, {
range: true,
});
const scope = analyze(ast, {
- ecmaVersion: 2020,
sourceType: 'module',
});
```
diff --git a/docs/packages/TypeScript_ESTree.mdx b/docs/packages/TypeScript_ESTree.mdx
index 40d426062965..68e2706ca9a1 100644
--- a/docs/packages/TypeScript_ESTree.mdx
+++ b/docs/packages/TypeScript_ESTree.mdx
@@ -31,11 +31,22 @@ Parses the given string of code with the options provided and returns an ESTree-
```ts
interface ParseOptions {
+ /**
+ * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript.
+ * This case only usually occurs when attempting to lint invalid code.
+ */
+ allowInvalidAST?: boolean;
+
/**
* create a top-level comments array containing all comments
*/
comment?: boolean;
+ /**
+ * Whether deprecated AST properties should skip calling console.warn on accesses.
+ */
+ suppressDeprecatedPropertyWarnings?: boolean;
+
/**
* An array of modules to turn explicit debugging on for.
* - 'typescript-eslint' is the same as setting the env var `DEBUG=typescript-eslint:*`
@@ -99,7 +110,6 @@ interface ParseOptions {
const PARSE_DEFAULT_OPTIONS: ParseOptions = {
comment: false,
- errorOnUnknownASTType: false,
filePath: 'estree.ts', // or 'estree.tsx', if you pass jsx: true
jsx: false,
loc: false,
@@ -202,15 +212,10 @@ interface ParseAndGenerateServicesOptions extends ParseOptions {
programs?: Program[];
/**
- ***************************************************************************************
- * IT IS RECOMMENDED THAT YOU DO NOT USE THIS OPTION, AS IT CAUSES PERFORMANCE ISSUES. *
- ***************************************************************************************
- *
- * When passed with `project`, this allows the parser to create a catch-all, default program.
- * This means that if the parser encounters a file not included in any of the provided `project`s,
- * it will not error, but will instead parse the file and its dependencies in a new program.
+ * @deprecated - this flag will be removed in the next major.
+ * Do not rely on the behavior provided by this flag.
*/
- createDefaultProgram?: boolean;
+ DEPRECATED__createDefaultProgram?: boolean;
/**
* ESLint (and therefore typescript-eslint) is used in both "single run"/one-time contexts,
@@ -241,18 +246,12 @@ interface ParseAndGenerateServicesOptions extends ParseOptions {
*/
glob?: number | 'Infinity';
};
-
- /**
- * Path to a file exporting a custom `ModuleResolver`.
- */
- moduleResolver?: string;
}
interface ParserServices {
program: ts.Program;
esTreeNodeToTSNodeMap: WeakMap;
tsNodeToESTreeNodeMap: WeakMap;
- hasFullTypeInformation: boolean;
}
interface ParseAndGenerateServicesResult {
@@ -290,56 +289,6 @@ const { ast, services } = parseAndGenerateServices(code, {
});
```
-##### `ModuleResolver`
-
-The `moduleResolver` option allows you to specify the path to a module with a custom module resolver implementation. The module is expected to adhere to the following interface:
-
-```ts
-interface ModuleResolver {
- version: 1;
- resolveModuleNames(
- moduleNames: string[],
- containingFile: string,
- reusedNames: string[] | undefined,
- redirectedReference: ts.ResolvedProjectReference | undefined,
- options: ts.CompilerOptions,
- ): (ts.ResolvedModule | undefined)[];
-}
-```
-
-#### `parseWithNodeMaps(code, options)`
-
-Parses the given string of code with the options provided and returns both the ESTree-compatible AST as well as the node maps.
-This allows you to work with both ASTs without the overhead of types that may come with `parseAndGenerateServices`.
-
-```ts
-interface ParseWithNodeMapsResult {
- ast: TSESTree.Program;
- esTreeNodeToTSNodeMap: ParserServices['esTreeNodeToTSNodeMap'];
- tsNodeToESTreeNodeMap: ParserServices['tsNodeToESTreeNodeMap'];
-}
-
-declare function parseWithNodeMaps(
- code: string,
- options: ParseOptions = PARSE_DEFAULT_OPTIONS,
-): ParseWithNodeMapsResult;
-```
-
-Example usage:
-
-```js
-import { parseWithNodeMaps } from '@typescript-eslint/typescript-estree';
-
-const code = `const hello: string = 'world';`;
-const { ast, esTreeNodeToTSNodeMap, tsNodeToESTreeNodeMap } = parseWithNodeMaps(
- code,
- {
- loc: true,
- range: true,
- },
-);
-```
-
### `TSESTree`, `AST_NODE_TYPES` and `AST_TOKEN_TYPES`
Types for the AST produced by the parse functions.
diff --git a/docs/packages/Utils.mdx b/docs/packages/Utils.mdx
index 94c19a88407c..df05daa76909 100644
--- a/docs/packages/Utils.mdx
+++ b/docs/packages/Utils.mdx
@@ -15,14 +15,14 @@ Any custom rules you write generally will be as well.
## Exports
-| Name | Description |
-| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| `AST_NODE_TYPES` | An enum with the names of every single _node_ found in `TSESTree`. |
-| `AST_TOKEN_TYPES` | An enum with the names of every single _token_ found in `TSESTree`. |
-| `ASTUtils` | Tools for operating on the ESTree AST. Also includes the [`@eslint-community/eslint-utils`](https://www.npmjs.com/package/@eslint-community/eslint-utils) package, correctly typed to work with the types found in `TSESTree` |
-| `ESLintUtils` | Tools for creating ESLint rules with TypeScript. |
-| `JSONSchema` | Types from the [`@types/json-schema`](https://www.npmjs.com/package/@types/json-schema) package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package. |
-| `ParserServices` | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. |
-| `TSESLint` | Types for ESLint, correctly typed to work with the types found in `TSESTree`. |
-| `TSESLintScope` | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` |
-| `TSESTree` | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. |
+| Name | Description |
+| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| `AST_NODE_TYPES` | An enum with the names of every single _node_ found in `TSESTree`. |
+| `AST_TOKEN_TYPES` | An enum with the names of every single _token_ found in `TSESTree`. |
+| `ASTUtils` | Tools for operating on the ESTree AST. Also includes the [`@eslint-community/eslint-utils`](https://www.npmjs.com/package/@eslint-community/eslint-utils) package, correctly typed to work with the types found in `TSESTree` |
+| `ESLintUtils` | Tools for creating ESLint rules with TypeScript. |
+| `JSONSchema` | Strict types for the JSON Schema v4 spec - the version that ESLint uses to validate all rules with. |
+| `ParserServices` | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. |
+| `TSESLint` | Types for ESLint, correctly typed to work with the types found in `TSESTree`. |
+| `TSESLintScope` | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` |
+| `TSESTree` | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. |
diff --git a/docs/users/Versioning.mdx b/docs/users/Versioning.mdx
index 41b27bd97e66..5f9f9450953f 100644
--- a/docs/users/Versioning.mdx
+++ b/docs/users/Versioning.mdx
@@ -6,6 +6,74 @@ title: Versioning
We follow [semantic versioning (semver)](https://semver.org).
This page exists to help set guidelines around when what we consider to fall within each of the semver categories.
+All of the packages in this project are published with the same version number to make it easier to coordinate both releases and installations.
+
+We publish a canary release on every successful merge to `main`, so **you never need to wait for a new stable version to make use of any updates**.
+
+Additionally, we promote to the `latest` tag on NPM once per week, **on Mondays at 1 pm Eastern**.
+
+The latest version under the `latest` tag is:
+
+
+
+
+
+The latest version under the `canary` tag **(latest commit to `main`)** is:
+
+
+
+
+
+:::note
+The only exception to the automated publishes described above is when we are in the final phases of creating the next major version of the libraries - e.g. going from `1.x.x` to `2.x.x`.
+During these periods, we manually publish `canary` releases until we are happy with the release and promote it to `latest`.
+:::
+
+### ESLint
+
+> The version range of ESLint currently supported is `^6.0.0 || ^7.0.0 || ^8.0.0`.
+
+We generally support at least the latest two major versions of ESLint.
+
+### Node
+
+This project makes an effort to support Active LTS and Maintenance LTS release statuses of Node according to [Node's release document](https://nodejs.org/en/about/releases).
+Support for specific Current status releases are considered periodically.
+
+### TypeScript
+
+> The version range of TypeScript currently supported is `>=4.3.5 <5.1.0`.
+
+Note that we mirror [DefinitelyTyped's version support window](https://github.com/DefinitelyTyped/DefinitelyTyped/#support-window) - meaning we only support versions of TypeScript less than 2 years old.
+
+You may find that our tooling works on older TypeScript versions however we provide no guarantees and **_we will not accept issues against unsupported versions_**.
+
+#### Supporting New TypeScript Releases
+
+With each new TypeScript release we file an issue to track the changes in the new version. The issue should always be pinned, and you can also [find the issues by searching for issues tagged with "New TypeScript Version"](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3A%22New+TypeScript+Version%22+sort%3Acreated-desc). If the issue is open, we do not have official support yet - please be patient.
+
+In terms of what versions we support:
+
+- We do not support the `beta` releases.
+- We _generally_ do not officially support the `rc` releases.
+- We endeavor to support the latest stable TypeScript versions as soon as possible after the release.
+
+Generally we will begin working on supporting the next release when the `rc` version is released.
+
+#### Version Warning Logs
+
+Note that our packages have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.
+
+However if you use a non-supported version of TypeScript, the parser will log a warning to the console.
+If you want to disable this warning, you can configure this in your `parserOptions`.
+See: [Parser > `warnOnUnsupportedTypeScriptVersion`](../packages/Parser.mdx#warnonunsupportedtypescriptversion).
+
## Breaking Changes
When considering whether a change should be counted as "breaking" we first need to consider what package(s) it impacts. For example breaking changes for the parser packages have a different standard to those for the ESLint plugins. This is because not only do they have _very_ different API surfaces, they also are consumed in very different ways.
diff --git a/jest.config.base.js b/jest.config.base.js
index 48c306a70c06..355b70884c96 100644
--- a/jest.config.base.js
+++ b/jest.config.base.js
@@ -11,6 +11,7 @@ module.exports = {
'tsx',
'mts',
'mtsx',
+ 'cjs',
'js',
'jsx',
'mjs',
diff --git a/lerna.json b/lerna.json
index 4b285a4b3c2a..c96412a8497f 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
- "version": "5.62.0",
+ "version": "6.0.0",
"npmClient": "yarn",
"stream": true,
"command": {
diff --git a/nx.json b/nx.json
index 2f9a913a85b4..0d2d9eda53f1 100644
--- a/nx.json
+++ b/nx.json
@@ -26,6 +26,7 @@
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.js",
+ "{workspaceRoot}/yarn.lock",
"{workspaceRoot}/.eslintignore"
]
}
diff --git a/package.json b/package.json
index 113c4ccfe5a0..5891a0ba3c61 100644
--- a/package.json
+++ b/package.json
@@ -16,124 +16,136 @@
"armano2",
"Jed Fox"
],
+ "type": "commonjs",
"license": "BSD-2-Clause",
"repository": "typescript-eslint/typescript-eslint",
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"scripts": {
- "build": "nx run-many --target=build --parallel --exclude website",
+ "build": "nx run-many --target=build --parallel --exclude website --exclude website-eslint",
"check-clean-workspace-after-install": "git diff --quiet --exit-code",
"check-configs": "nx run-many --target=check-configs --parallel",
"check-docs": "nx run-many --target=check-docs --parallel",
"check-format": "prettier --list-different .",
- "check-spelling": "cspell --config=.cspell.json \"**/*.{md,mdx,ts,mts,cts,js,cjs,mjs,tsx,jsx}\"",
+ "check-spelling": "cspell --config=.cspell.json \"**/*.{md,mdx,ts,mts,cts,js,cjs,mjs,tsx,jsx}\" --no-progress --show-context --show-suggestions",
"clean": "lerna clean -y && nx run-many --target=clean",
"format": "prettier --write .",
- "generate-contributors": "yarn tsx ./tools/generate-contributors.ts",
- "generate-sponsors": "yarn tsx ./tools/generate-sponsors.ts",
- "generate-website-dts": "yarn tsx ./tools/generate-website-dts.ts",
- "generate-lib": "nx generate-lib @typescript-eslint/scope-manager",
- "lint-fix": "eslint . --fix",
+ "generate-breaking-changes": "nx run eslint-plugin:generate-breaking-changes",
+ "generate-configs": "nx run eslint-plugin:generate:configs",
+ "generate-contributors": "nx run repo-tools:generate-contributors",
+ "generate-sponsors": "nx run repo-tools:generate-sponsors",
+ "generate-website-dts": "nx run website:generate-website-dts",
+ "generate-lib": "nx run scope-manager:generate-lib",
+ "lint-fix": "yarn lint --fix",
"lint-markdown-fix": "yarn lint-markdown --fix",
"lint-markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore",
"lint": "nx run-many --target=lint --parallel",
- "postinstall": "yarn tsx ./tools/postinstall.ts",
+ "postinstall": "nx run repo-tools:postinstall-script",
"pre-commit": "yarn lint-staged",
"start": "nx run website:start",
- "test": "nx run-many --target=test --parallel",
- "test-integration": "yarn jest -c ./tests/integration/jest.config.js",
+ "test": "nx run-many --target=test --parallel --exclude integration-tests --exclude website --exclude website-eslint",
+ "test-integration": "nx run integration-tests:test",
+ "test-website": "nx run-many --target=test --projects=website,website-eslint",
"typecheck": "nx run-many --target=typecheck --parallel"
},
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": "^16.0.0 || >=18.0.0"
},
"devDependencies": {
"@actions/core": "^1.10.0",
"@actions/github": "^5.1.1",
- "@babel/code-frame": "^7.18.6",
- "@babel/core": "^7.20.2",
- "@babel/eslint-parser": "^7.19.1",
- "@babel/parser": "^7.21.2",
- "@babel/types": "^7.20.2",
+ "@babel/code-frame": "^7.21.4",
+ "@babel/core": "^7.21.4",
+ "@babel/eslint-parser": "^7.21.3",
+ "@babel/parser": "^7.21.4",
+ "@babel/types": "^7.21.4",
+ "@nrwl/jest": "15.7.2",
+ "@nrwl/nx-cloud": "15.0.3",
+ "@nrwl/workspace": "15.7.2",
"@nx/jest": "16.3.2",
"@nx/linter": "16.3.2",
"@nx/workspace": "16.3.2",
- "@swc/core": "^1.3.1",
- "@swc/jest": "^0.2.21",
+ "@swc/core": "^1.3.55",
+ "@swc/jest": "^0.2.26",
"@types/babel__code-frame": "^7.0.3",
+ "@types/babel__core": "^7.1.14",
"@types/debug": "^4.1.7",
- "@types/eslint-visitor-keys": "^1.0.0",
- "@types/glob": "^8.0.0",
+ "@types/glob": "^8.1.0",
"@types/is-glob": "^4.0.2",
- "@types/jest": "29.4.4",
- "@types/jest-specific-snapshot": "^0.5.5",
- "@types/marked": "^4.0.3",
+ "@types/jest-specific-snapshot": "^0.5.6",
+ "@types/jest": "^29.5.1",
+ "@types/lodash": "^4.14.182",
+ "@types/marked": "^4.0.8",
+ "@types/natural-compare": "^1.4.1",
"@types/ncp": "^2.0.5",
- "@types/node": "^18.11.9",
- "@types/prettier": "^2.6.0",
- "@types/rimraf": "^3.0.2",
- "@types/semver": "^7.3.9",
+ "@types/node": "^18.16.1",
+ "@types/prettier": "^2.7.2",
+ "@types/semver": "^7.3.13",
"@types/tmp": "^0.2.3",
"console-fail-test": "^0.2.3",
- "cross-env": "^7.0.3",
"cross-fetch": "^3.1.5",
- "cspell": "^6.0.0",
+ "cspell": "^6.31.1",
"downlevel-dts": ">=0.11.0",
- "eslint": "^8.15.0",
- "eslint-plugin-deprecation": "^1.3.2",
+ "eslint-plugin-deprecation": "^1.4.1",
+ "eslint": "^8.39.0",
"eslint-plugin-eslint-comments": "^3.2.0",
- "eslint-plugin-eslint-plugin": "^5.0.1",
- "eslint-plugin-import": "^2.26.0",
- "eslint-plugin-jest": "^27.0.0",
+ "eslint-plugin-eslint-plugin": "^5.0.8",
+ "eslint-plugin-import": "^2.27.5",
+ "eslint-plugin-jest": "^27.2.1",
+ "eslint-plugin-jsx-a11y": "^6.7.1",
+ "eslint-plugin-react": "^7.32.2",
+ "eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-unicorn": "^46.0.0",
"execa": "5.1.1",
- "glob": "^8.0.1",
- "husky": "^8.0.1",
- "jest": "29.4.3",
- "jest-diff": "^29.0.3",
- "jest-snapshot": "^29.0.3",
+ "glob": "^9.3.4",
+ "husky": "^8.0.3",
+ "jest-diff": "^29.5.0",
+ "jest-snapshot": "^29.5.0",
"jest-specific-snapshot": "^8.0.0",
+ "jest": "^29.5.0",
"lerna": "7.1.0",
- "lint-staged": "^13.0.0",
+ "lint-staged": "^13.2.2",
"make-dir": "^3.1.0",
"markdownlint-cli": "^0.33.0",
"ncp": "^2.0.0",
"netlify": "^13.1.7",
- "nx": "16.3.2",
"nx-cloud": "16.0.5",
+ "nx": "16.3.2",
"patch-package": "^6.4.7",
- "prettier": "2.8.1",
- "pretty-format": "^29.0.3",
- "rimraf": "^4.4.0",
+ "prettier": "^2.8.4",
+ "pretty-format": "^29.5.0",
+ "raw-loader": "^4.0.2",
+ "rimraf": "^5.0.0",
"tmp": "^0.2.1",
"ts-node": "10.7.0",
"tslint": "^6.1.3",
- "tsx": "^3.12.1",
- "typescript": "5.1.6"
+ "tsx": "^3.12.6",
+ "typescript": ">=4.3.5 <5.2.0"
},
"resolutions": {
- "typescript": "5.1.6",
- "@types/node": "^18.11.9",
"@jest/create-cache-key-function": "^29",
"@jest/reporters": "^29",
"@jest/test-result": "^29",
+ "@swc/core-android-arm-eabi": "link:./tools/dummypkg",
+ "@swc/core-android-arm64": "link:./tools/dummypkg",
+ "@swc/core-freebsd-x64": "link:./tools/dummypkg",
+ "@swc/core-linux-arm-gnueabihf": "link:./tools/dummypkg",
+ "@swc/core-linux-arm64-gnu": "link:./tools/dummypkg",
+ "@swc/core-linux-arm64-musl": "link:./tools/dummypkg",
+ "@swc/core-win32-arm64-msvc": "link:./tools/dummypkg",
+ "@swc/core-win32-ia32-msvc": "link:./tools/dummypkg",
+ "@types/eslint-scope": "link:./tools/dummypkg",
+ "@types/eslint": "link:./tools/dummypkg",
+ "@types/estree": "link:./tools/dummypkg",
+ "@types/node": "^18.16.1",
+ "eslint-visitor-keys": "^3.4.1",
"jest-config": "^29",
- "jest-diff": "^29",
- "jest-get-type": "^29",
- "jest-matcher-utils": "^29",
"jest-resolve": "^29",
- "jest-snapshot": "^29",
"jest-util": "^29",
"pretty-format": "^29",
- "@swc/core-android-arm-eabi": "npm:dummypkg-a@1.0.0",
- "@swc/core-android-arm64": "npm:dummypkg-a@1.0.0",
- "@swc/core-freebsd-x64": "npm:dummypkg-a@1.0.0",
- "@swc/core-linux-arm-gnueabihf": "npm:dummypkg-a@1.0.0",
- "@swc/core-linux-arm64-gnu": "npm:dummypkg-a@1.0.0",
- "@swc/core-linux-arm64-musl": "npm:dummypkg-a@1.0.0",
- "@swc/core-win32-arm64-msvc": "npm:dummypkg-a@1.0.0",
- "@swc/core-win32-ia32-msvc": "npm:dummypkg-a@1.0.0"
+ "tsx": "^3.12.1",
+ "typescript": "5.1.6"
}
}
diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md
index 5f211b61bf85..091ae8a95cec 100644
--- a/packages/ast-spec/CHANGELOG.md
+++ b/packages/ast-spec/CHANGELOG.md
@@ -3,6 +3,59 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [6.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.62.0...v6.0.0) (2023-07-10)
+
+
+### Bug Fixes
+
+* **ast-spec:** remove more invalid properties ([#6243](https://github.com/typescript-eslint/typescript-eslint/issues/6243)) ([aa20f63](https://github.com/typescript-eslint/typescript-eslint/commit/aa20f63e8f345767bb4693c9d20f751e6998bd65))
+* fix illegal decorator check ([#6723](https://github.com/typescript-eslint/typescript-eslint/issues/6723)) ([c456f8c](https://github.com/typescript-eslint/typescript-eslint/commit/c456f8cdef5a931c631bfbcfc84d8a25caaf019f))
+* rename typeParameters to typeArguments where needed ([#5384](https://github.com/typescript-eslint/typescript-eslint/issues/5384)) ([08d757b](https://github.com/typescript-eslint/typescript-eslint/commit/08d757b26b00d0accea010e61ec42b4f753f993e))
+* **typescript-estree:** account for namespace nesting in AST conversion ([#6272](https://github.com/typescript-eslint/typescript-eslint/issues/6272)) ([09e3877](https://github.com/typescript-eslint/typescript-eslint/commit/09e38776c63fea3328f71df36644ee11dd137cc1))
+* **typescript-estree:** fix error handling on `ImportExpression` ([#6587](https://github.com/typescript-eslint/typescript-eslint/issues/6587)) ([e8cdd5c](https://github.com/typescript-eslint/typescript-eslint/commit/e8cdd5ce48fa0a2f6f93e6b3ed7c337d042ab45d))
+* **typescript-estree:** forbid `override` on non-constructor function/methods ([#6729](https://github.com/typescript-eslint/typescript-eslint/issues/6729)) ([2f3638f](https://github.com/typescript-eslint/typescript-eslint/commit/2f3638fb00745429d6392a8e6492e83f853e92db))
+* **typescript-estree:** wrap import = declaration in an export node ([#5885](https://github.com/typescript-eslint/typescript-eslint/issues/5885)) ([1c3f470](https://github.com/typescript-eslint/typescript-eslint/commit/1c3f470da75bf63526efbf5b45615772e562dcb5)), closes [#5036](https://github.com/typescript-eslint/typescript-eslint/issues/5036) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5889](https://github.com/typescript-eslint/typescript-eslint/issues/5889) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5883](https://github.com/typescript-eslint/typescript-eslint/issues/5883) [#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863) [#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381) [#5256](https://github.com/typescript-eslint/typescript-eslint/issues/5256)
+
+
+### chore
+
+* drop support for node v14.17, v17 ([#5971](https://github.com/typescript-eslint/typescript-eslint/issues/5971)) ([cc62015](https://github.com/typescript-eslint/typescript-eslint/commit/cc62015b8ae5f207912ff8988e2a0b3fe9a79243))
+
+
+### Features
+
+* add package.json exports for public packages ([#6458](https://github.com/typescript-eslint/typescript-eslint/issues/6458)) ([d676683](https://github.com/typescript-eslint/typescript-eslint/commit/d6766838a05259556029acaac57dc7839b68c592))
+* create TSTypeQuery node when TSImportType has isTypeOf ([#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076)) ([2b69b65](https://github.com/typescript-eslint/typescript-eslint/commit/2b69b659d87b58468e413801d31086ae0eeafff4)), closes [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864)
+* drop support for node v12 ([#5918](https://github.com/typescript-eslint/typescript-eslint/issues/5918)) ([7e3fe9a](https://github.com/typescript-eslint/typescript-eslint/commit/7e3fe9a67abd394b0a114f2deb466edf5c9759ac))
+* drop support for node v14 and test against node v20 ([#7022](https://github.com/typescript-eslint/typescript-eslint/issues/7022)) ([e6235bf](https://github.com/typescript-eslint/typescript-eslint/commit/e6235bf61b781066653581b57b7cd976c9c4f905))
+* **eslint-plugin:** [prefer-optional-chain] handle cases where the first operands are unrelated to the rest of the chain and add type info ([#6397](https://github.com/typescript-eslint/typescript-eslint/issues/6397)) ([02a37c4](https://github.com/typescript-eslint/typescript-eslint/commit/02a37c4c79d9b83998b7ee1376be43b06e12b3a0))
+* **eslint-plugin:** apply final v6 changes to configs ([#7110](https://github.com/typescript-eslint/typescript-eslint/issues/7110)) ([c13ce0b](https://github.com/typescript-eslint/typescript-eslint/commit/c13ce0b4f7a74a6d8fecf78d25ebd8181f7a9119))
+* improve error location ([#6556](https://github.com/typescript-eslint/typescript-eslint/issues/6556)) ([355adf0](https://github.com/typescript-eslint/typescript-eslint/commit/355adf0b5dcc1b4f5c360722acc1ba8b6f4e4117))
+* made BaseNode.parent non-optional ([#5252](https://github.com/typescript-eslint/typescript-eslint/issues/5252)) ([a4768f3](https://github.com/typescript-eslint/typescript-eslint/commit/a4768f38ef4943873c1e9443e8cd101a663ac3c0)), closes [#5036](https://github.com/typescript-eslint/typescript-eslint/issues/5036) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5889](https://github.com/typescript-eslint/typescript-eslint/issues/5889) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5883](https://github.com/typescript-eslint/typescript-eslint/issues/5883) [#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863) [#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381) [#5256](https://github.com/typescript-eslint/typescript-eslint/issues/5256) [#5399](https://github.com/typescript-eslint/typescript-eslint/issues/5399)
+* remove semantically invalid properties from TSEnumDeclaration, TSInterfaceDeclaration and TSModuleDeclaration ([#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863)) ([844875c](https://github.com/typescript-eslint/typescript-eslint/commit/844875cbe933195ff25ba218f82ede3ebde9a0a0))
+* **typescript-estree:** added allowInvalidAST option to not throw on invalid tokens ([#6247](https://github.com/typescript-eslint/typescript-eslint/issues/6247)) ([a3b177d](https://github.com/typescript-eslint/typescript-eslint/commit/a3b177d59adaf8ea76b205befc8b12d86447f1fb))
+* **typescript-estree:** check for illegal decorators on function declarations ([#6590](https://github.com/typescript-eslint/typescript-eslint/issues/6590)) ([1b39cfd](https://github.com/typescript-eslint/typescript-eslint/commit/1b39cfd307955deb8e407cf8dd3a6ca1ed1b8df6))
+* **typescript-estree:** check modifiers on every node ([#6615](https://github.com/typescript-eslint/typescript-eslint/issues/6615)) ([62d6230](https://github.com/typescript-eslint/typescript-eslint/commit/62d62304e16b553274a80d8ab2653543a22f2391))
+* **typescript-estree:** forbid members in Mapped Type ([#6802](https://github.com/typescript-eslint/typescript-eslint/issues/6802)) ([b93458f](https://github.com/typescript-eslint/typescript-eslint/commit/b93458f9dfe36409d3a736a081ab69ba749caf24))
+* **typescript-estree:** remove optionality from AST boolean properties ([#6274](https://github.com/typescript-eslint/typescript-eslint/issues/6274)) ([df131e2](https://github.com/typescript-eslint/typescript-eslint/commit/df131e258c93e5714c88c0373cfeb2e1e75afc75))
+* **typescript-estree:** strict class heritage clauses check ([#6576](https://github.com/typescript-eslint/typescript-eslint/issues/6576)) ([530185b](https://github.com/typescript-eslint/typescript-eslint/commit/530185bd7e62b05adc673d1f96257dd14bb4d9dc))
+* **typescript-estree:** throw errors for object methods without function bodies ([#6589](https://github.com/typescript-eslint/typescript-eslint/issues/6589)) ([1d78576](https://github.com/typescript-eslint/typescript-eslint/commit/1d78576d41323e35c2d2a2ecc92f6ee76ed61d57))
+* **typescript-estree:** throw errors on interface with implements ([#6551](https://github.com/typescript-eslint/typescript-eslint/issues/6551)) ([67e05c8](https://github.com/typescript-eslint/typescript-eslint/commit/67e05c8f0381ba7065a0257d6038f0a50a3b9888))
+* **typescript-estree:** throw errors when abstract property has initializer ([#6613](https://github.com/typescript-eslint/typescript-eslint/issues/6613)) ([dcdbc76](https://github.com/typescript-eslint/typescript-eslint/commit/dcdbc76d5418a383968d15e32d2eba7a9d2d7e79))
+* **typescript-estree:** warn on deprecated AST property accesses ([#6525](https://github.com/typescript-eslint/typescript-eslint/issues/6525)) ([79c058d](https://github.com/typescript-eslint/typescript-eslint/commit/79c058d69f723ed18a3a7631370009359510d128))
+
+
+### BREAKING CHANGES
+
+* drops support for node v17
+* drops support for node v12
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+
+
+
+
# [5.62.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.61.0...v5.62.0) (2023-07-10)
**Note:** Version bump only for package @typescript-eslint/ast-spec
diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json
index bad01bbfcd0c..569758857cfa 100644
--- a/packages/ast-spec/package.json
+++ b/packages/ast-spec/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/ast-spec",
- "version": "5.62.0",
+ "version": "6.0.0",
"description": "Complete specification for the TypeScript-ESTree AST",
"private": true,
"keywords": [
@@ -9,7 +9,7 @@
"estree"
],
"engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
+ "node": "^16.0.0 || >=18.0.0"
},
"files": [
"dist",
@@ -31,7 +31,7 @@
"scripts": {
"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",
+ "postclean": "rimraf dist && rimraf coverage",
"clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "nx lint",
@@ -43,11 +43,11 @@
"url": "https://opencollective.com/typescript-eslint"
},
"devDependencies": {
+ "@babel/code-frame": "*",
"@babel/core": "*",
"@babel/eslint-parser": "*",
"@babel/parser": "*",
"@microsoft/api-extractor": "^7.34.4",
- "@types/babel__core": "*",
"glob": "*",
"jest-diff": "*",
"jest-snapshot": "*",
diff --git a/packages/ast-spec/project.json b/packages/ast-spec/project.json
index c47c9d17693e..60741f21eae1 100644
--- a/packages/ast-spec/project.json
+++ b/packages/ast-spec/project.json
@@ -16,7 +16,8 @@
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
- "lintFilePatterns": ["packages/ast-spec/**/*.ts"]
+ "lintFilePatterns": ["packages/ast-spec/**/*.{mts,cts,ts,tsx}"],
+ "ignorePath": ".eslintignore"
}
}
}
diff --git a/packages/ast-spec/src/base/ClassBase.ts b/packages/ast-spec/src/base/ClassBase.ts
index 4878cfc87b61..595d1393ac48 100644
--- a/packages/ast-spec/src/base/ClassBase.ts
+++ b/packages/ast-spec/src/base/ClassBase.ts
@@ -13,10 +13,8 @@ export interface ClassBase extends BaseNode {
* ```
* abstract class Foo {...}
* ```
- * This is always `undefined` for `ClassExpression`.
*/
- // TODO(#5020) - make this `false` if it is not `abstract`
- abstract?: boolean;
+ abstract: boolean;
/**
* The class body.
*/
@@ -26,21 +24,16 @@ export interface ClassBase extends BaseNode {
* ```
* declare class Foo {...}
* ```
- * This is always `undefined` for `ClassExpression`.
*/
- // TODO(#5020) - make this `false` if it is not `declare`d
- declare?: boolean;
+ declare: boolean;
/**
* The decorators declared for the class.
- * This is `undefined` if there are no decorators.
* ```
* @deco
* class Foo {...}
* ```
- * This is always `undefined` for `ClassExpression`.
*/
- // TODO(#5020) - make this an empty array if there are none declared
- decorators?: Decorator[];
+ decorators: Decorator[];
/**
* The class's name.
* - For a `ClassExpression` this may be `null` if the name is omitted.
@@ -50,21 +43,22 @@ export interface ClassBase extends BaseNode {
id: Identifier | null;
/**
* The implemented interfaces for the class.
- * This is `undefined` if there are no implemented interfaces.
*/
- implements?: TSClassImplements[];
+ implements: TSClassImplements[];
/**
* The super class this class extends.
*/
superClass: LeftHandSideExpression | null;
/**
* The generic type parameters passed to the superClass.
- * This is `undefined` if there are no generic type parameters passed.
*/
- superTypeParameters?: TSTypeParameterInstantiation;
+ superTypeArguments: TSTypeParameterInstantiation | undefined;
+
+ /** @deprecated Use {@link `superTypeArguments`} instead. */
+ superTypeParameters: TSTypeParameterInstantiation | undefined;
+
/**
* The generic type parameters declared for the class.
- * This is `undefined` if there are no generic type parameters declared.
*/
- typeParameters?: TSTypeParameterDeclaration;
+ typeParameters: TSTypeParameterDeclaration | undefined;
}
diff --git a/packages/ast-spec/src/base/FunctionBase.ts b/packages/ast-spec/src/base/FunctionBase.ts
index 56446bc78ba9..035b18a682e9 100644
--- a/packages/ast-spec/src/base/FunctionBase.ts
+++ b/packages/ast-spec/src/base/FunctionBase.ts
@@ -23,15 +23,14 @@ export interface FunctionBase extends BaseNode {
* - For a `TSDeclareFunction` this is always `undefined`.
* - For a `TSEmptyBodyFunctionExpression` this is always `null`.
*/
- body?: BlockStatement | Expression | null;
+ body: BlockStatement | Expression | null | undefined;
/**
* This is only `true` if and only if the node is a `TSDeclareFunction` and it has `declare`:
* ```
* declare function foo(...) {...}
* ```
*/
- // TODO(#5020) - make this always `false` if it is not `declare`d instead of `undefined`
- declare?: boolean;
+ declare: boolean;
/**
* This is only ever `true` if and only the node is an `ArrowFunctionExpression` and the body
* is an expression:
@@ -63,12 +62,10 @@ export interface FunctionBase extends BaseNode {
params: Parameter[];
/**
* The return type annotation for the function.
- * This is `undefined` if there is no return type declared.
*/
- returnType?: TSTypeAnnotation;
+ returnType: TSTypeAnnotation | undefined;
/**
* The generic type parameter declaration for the function.
- * This is `undefined` if there are no generic type parameters declared.
*/
- typeParameters?: TSTypeParameterDeclaration;
+ typeParameters: TSTypeParameterDeclaration | undefined;
}
diff --git a/packages/ast-spec/src/base/MethodDefinitionBase.ts b/packages/ast-spec/src/base/MethodDefinitionBase.ts
index f1f2087ccae8..f2815458d58c 100644
--- a/packages/ast-spec/src/base/MethodDefinitionBase.ts
+++ b/packages/ast-spec/src/base/MethodDefinitionBase.ts
@@ -1,7 +1,6 @@
import type { FunctionExpression } from '../expression/FunctionExpression/spec';
import type { TSEmptyBodyFunctionExpression } from '../expression/TSEmptyBodyFunctionExpression/spec';
import type { Decorator } from '../special/Decorator/spec';
-import type { TSTypeParameterDeclaration } from '../special/TSTypeParameterDeclaration/spec';
import type {
ClassPropertyNameNonComputed,
PropertyName,
@@ -18,11 +17,10 @@ interface MethodDefinitionBase extends BaseNode {
computed: boolean;
static: boolean;
kind: 'constructor' | 'get' | 'method' | 'set';
- optional?: boolean;
- decorators?: Decorator[];
- accessibility?: Accessibility;
- typeParameters?: TSTypeParameterDeclaration;
- override?: boolean;
+ optional: boolean;
+ decorators: Decorator[];
+ accessibility: Accessibility | undefined;
+ override: boolean;
}
export interface MethodDefinitionComputedNameBase extends MethodDefinitionBase {
diff --git a/packages/ast-spec/src/base/PropertyDefinitionBase.ts b/packages/ast-spec/src/base/PropertyDefinitionBase.ts
index f1d5b9cc4402..a379ac922427 100644
--- a/packages/ast-spec/src/base/PropertyDefinitionBase.ts
+++ b/packages/ast-spec/src/base/PropertyDefinitionBase.ts
@@ -16,13 +16,13 @@ interface PropertyDefinitionBase extends BaseNode {
computed: boolean;
static: boolean;
declare: boolean;
- readonly?: boolean;
- decorators?: Decorator[];
- accessibility?: Accessibility;
- optional?: boolean;
- definite?: boolean;
- typeAnnotation?: TSTypeAnnotation;
- override?: boolean;
+ readonly: boolean;
+ decorators: Decorator[];
+ accessibility: Accessibility | undefined;
+ optional: boolean;
+ definite: boolean;
+ typeAnnotation: TSTypeAnnotation | undefined;
+ override: boolean;
}
export interface PropertyDefinitionComputedNameBase
diff --git a/packages/ast-spec/src/base/TSFunctionSignatureBase.ts b/packages/ast-spec/src/base/TSFunctionSignatureBase.ts
index 0da1e7b414d6..afd906f37787 100644
--- a/packages/ast-spec/src/base/TSFunctionSignatureBase.ts
+++ b/packages/ast-spec/src/base/TSFunctionSignatureBase.ts
@@ -5,6 +5,6 @@ import type { BaseNode } from './BaseNode';
export interface TSFunctionSignatureBase extends BaseNode {
params: Parameter[];
- returnType?: TSTypeAnnotation;
- typeParameters?: TSTypeParameterDeclaration;
+ returnType: TSTypeAnnotation | undefined;
+ typeParameters: TSTypeParameterDeclaration | undefined;
}
diff --git a/packages/ast-spec/src/base/TSHeritageBase.ts b/packages/ast-spec/src/base/TSHeritageBase.ts
index 683600ec01d3..dc7f701f0f1a 100644
--- a/packages/ast-spec/src/base/TSHeritageBase.ts
+++ b/packages/ast-spec/src/base/TSHeritageBase.ts
@@ -5,5 +5,8 @@ import type { BaseNode } from './BaseNode';
export interface TSHeritageBase extends BaseNode {
// TODO(#1852) - this should be restricted to MemberExpression | Identifier
expression: Expression;
- typeParameters?: TSTypeParameterInstantiation;
+ typeArguments: TSTypeParameterInstantiation | undefined;
+
+ /** @deprecated Use {@link `typeArguments`} instead. */
+ typeParameters: TSTypeParameterInstantiation | undefined;
}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts
new file mode 100644
index 000000000000..d54b28def836
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/fixture.ts
@@ -0,0 +1 @@
+export class { }
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..f81327f8c1fc
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Babel - Error 1`] = `[SyntaxError: A class name is required. (1:13)]`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..428e6049da8a
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name TSESTree - Error 1`] = `
+"TSError
+> 1 | export class { }
+ | ^^^^^^^^^^^^^^^^ A class declaration without the 'default' modifier must have a name.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..72c44523ffa1
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..f81327f8c1fc
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Babel - Error 1`] = `[SyntaxError: A class name is required. (1:13)]`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..09c3f1034966
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ export-missing-name Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..32918ff7c5f7
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/1-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/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..123225a18253
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-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_/missing-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..4f8ef959d9ba
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ missing-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:9)]`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot
index c17328b32e82..f8cc08dcf675 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ClassDeclaration _error_ missing-body TSESTree - Error 1`] = `[TSError: '{' expected.]`;
+exports[`AST Fixtures declaration ClassDeclaration _error_ missing-body TSESTree - Error 1`] = `
+"TSError
+> 1 | class Foo;
+ | ^ '{' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..18e4442401e0
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ missing-body Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..f84357321316
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ missing-extends-type-param Babel - Error 1`] = `[SyntaxError: Type argument list cannot be empty. (1:17)]`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..35683b841219
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ missing-extends-type-param Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..a14c3c54cac7
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ missing-type-param Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (1:7)]`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..49567ea7a7b5
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ missing-type-param Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..e3a40451c7e4
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
index 7b137a8c5dec..cbf46a94b95e 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `[TSError: '{' expected.]`;
+exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `
+"TSError
+> 1 | class 'Foo' {}
+ | ^ '{' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..098ed5e7a14f
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-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/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..6ef9a4c481a7
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-type-param Babel - Error 1`] = `[SyntaxError: Unexpected token (1:8)]`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
index 0be64ad34736..106f67b99621 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-type-param TSESTree - Error 1`] = `[TSError: Type parameter declaration expected.]`;
+exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-type-param TSESTree - Error 1`] = `
+"TSError
+> 1 | class C<1> {}
+ | ^ Type parameter declaration expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..98c58289073e
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ non-identifier-type-param Error Alignment 1`] = `"Both errored"`;
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
index 556a8358a93b..bbe0a4ac3dfe 100644
--- 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
@@ -17,9 +17,13 @@ Program {
end: { column: 21, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [15, 18],
loc: {
@@ -27,6 +31,7 @@ Program {
end: { column: 18, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 21],
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
index 54a7219ce9a8..b4665912df82 100644
--- 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
@@ -2,5 +2,55 @@
exports[`AST Fixtures declaration ClassDeclaration abstract AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ 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 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+- implements: Array [],
+ 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/declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
index a1d8cdbc4c7a..97f866fa71b8 100644
--- 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
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -17,9 +18,12 @@ Program {
},
},
declare: true,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [14, 17],
loc: {
@@ -27,6 +31,7 @@ Program {
end: { column: 17, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 20],
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
index 9fbaa86d5a24..7b52ed82f8c2 100644
--- 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
@@ -2,5 +2,55 @@
exports[`AST Fixtures declaration ClassDeclaration declare AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [18, 20],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ declare: true,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+- implements: Array [],
+ 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/decorator-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-many/snapshots/1-TSESTree-AST.shot
index c9cc55d95637..c9593be9d1a4 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-many/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,12 +17,15 @@ Program {
end: { column: 12, line: 3 },
},
},
+ declare: false,
decorators: [
Decorator {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "decoratorOne",
+ optional: false,
range: [1, 13],
loc: {
@@ -40,7 +44,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "decoratorTwo",
+ optional: false,
range: [15, 27],
loc: {
@@ -58,7 +64,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [34, 37],
loc: {
@@ -66,6 +74,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [0, 40],
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-many/snapshots/5-AST-Alignment-AST.shot
index 751a6cc951f0..8170c78f09b7 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-many/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,98 @@
exports[`AST Fixtures declaration ClassDeclaration decorator-many AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [38, 40],
+ loc: {
+ start: { column: 10, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+- declare: false,
+ decorators: Array [
+ Decorator {
+ type: 'Decorator',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'decoratorOne',
+- optional: false,
+
+ 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',
+- decorators: Array [],
+ name: 'decoratorTwo',
+- optional: false,
+
+ 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',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [34, 37],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+- implements: Array [],
+ 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/decorator-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-one/snapshots/1-TSESTree-AST.shot
index 589d5478de69..a8e11ccde02e 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-one/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,12 +17,15 @@ Program {
end: { column: 12, line: 2 },
},
},
+ declare: false,
decorators: [
Decorator {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "decorator",
+ optional: false,
range: [1, 10],
loc: {
@@ -39,7 +43,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [17, 20],
loc: {
@@ -47,6 +53,7 @@ Program {
end: { column: 9, line: 2 },
},
},
+ implements: [],
superClass: null,
range: [0, 23],
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-one/snapshots/5-AST-Alignment-AST.shot
index 503bd4f5ad82..373c6c0b6940 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/decorator-one/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,77 @@
exports[`AST Fixtures declaration ClassDeclaration decorator-one AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [21, 23],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+- declare: false,
+ decorators: Array [
+ Decorator {
+ type: 'Decorator',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'decorator',
+- optional: false,
+
+ 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',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [17, 20],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 9, line: 2 },
+ },
+ },
+- implements: Array [],
+ 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/empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot
index 189097a1c6b8..df093f585569 100644
--- 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
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 12, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 12],
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
index 795e34e032cc..230ef4b49bc6 100644
--- 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
@@ -2,5 +2,55 @@
exports[`AST Fixtures declaration ClassDeclaration empty AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [10, 12],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 12, line: 1 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+- implements: Array [],
+ 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/extends-literal/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-literal/snapshots/1-TSESTree-AST.shot
index 53d85a3efcbb..e2d4e3c5b2b2 100644
--- 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
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 28, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: Literal {
type: "Literal",
raw: "'Thing'",
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
index 432a1483eb47..f9a145745111 100644
--- 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
@@ -2,5 +2,65 @@
exports[`AST Fixtures declaration ClassDeclaration extends-literal AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [26, 28],
+ loc: {
+ start: { column: 26, line: 1 },
+ end: { column: 28, line: 1 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+- implements: Array [],
+ 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-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot
index d1b1649faf25..96f7df79dc0d 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 32, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -26,9 +31,12 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "Set",
+ optional: false,
range: [18, 21],
loc: {
@@ -36,7 +44,7 @@ Program {
end: { column: 21, line: 1 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+ superTypeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSStringKeyword {
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot
index d7a16a19520a..64ff14cbc80b 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends-type-param/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,87 @@
exports[`AST Fixtures declaration ClassDeclaration extends-type-param AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [30, 32],
+ loc: {
+ start: { column: 30, line: 1 },
+ end: { column: 32, line: 1 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+- implements: Array [],
+ superClass: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Set',
+- optional: false,
+
+ range: [18, 21],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+- superTypeArguments: TSTypeParameterInstantiation {
++ 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/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/extends/snapshots/1-TSESTree-AST.shot
index 2ce8cf69e4fd..d515d3cc5d03 100644
--- 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
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 27, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -26,9 +31,12 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "Object",
+ optional: false,
range: [18, 24],
loc: {
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
index 7408520a611e..724e995d3583 100644
--- 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
@@ -2,5 +2,66 @@
exports[`AST Fixtures declaration ClassDeclaration extends AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [25, 27],
+ loc: {
+ start: { column: 25, line: 1 },
+ end: { column: 27, line: 1 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+- implements: Array [],
+ superClass: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Object',
+- optional: false,
+
+ 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/implements-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/implements-many/snapshots/1-TSESTree-AST.shot
index ce7ed5710f28..145331d6f602 100644
--- 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
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 48, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -31,7 +36,9 @@ Program {
type: "TSClassImplements",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Object",
+ optional: false,
range: [21, 27],
loc: {
@@ -50,7 +57,9 @@ Program {
type: "TSClassImplements",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Function",
+ optional: false,
range: [29, 37],
loc: {
@@ -69,7 +78,9 @@ Program {
type: "TSClassImplements",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "RegExp",
+ optional: false,
range: [39, 45],
loc: {
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
index 77b0476655c6..d38bcdd0e911 100644
--- 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
@@ -10,6 +10,7 @@ exports[`AST Fixtures declaration ClassDeclaration implements-many AST Alignment
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures declaration ClassDeclaration implements-many AST Alignment
end: { column: 48, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -37,7 +42,9 @@ exports[`AST Fixtures declaration ClassDeclaration implements-many AST Alignment
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Object',
+- optional: false,
range: [21, 27],
loc: {
@@ -58,7 +65,9 @@ exports[`AST Fixtures declaration ClassDeclaration implements-many AST Alignment
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Function',
+- optional: false,
range: [29, 37],
loc: {
@@ -79,7 +88,9 @@ exports[`AST Fixtures declaration ClassDeclaration implements-many AST Alignment
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'RegExp',
+- optional: false,
range: [39, 45],
loc: {
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
index da55fad4be07..0fac21498b63 100644
--- 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
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 30, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -31,7 +36,9 @@ Program {
type: "TSClassImplements",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Object",
+ optional: false,
range: [21, 27],
loc: {
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
index b0aec089f615..e8a1bd9feae8 100644
--- 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
@@ -10,6 +10,7 @@ exports[`AST Fixtures declaration ClassDeclaration implements-one AST Alignment
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures declaration ClassDeclaration implements-one AST Alignment
end: { column: 30, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -37,7 +42,9 @@ exports[`AST Fixtures declaration ClassDeclaration implements-one AST Alignment
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Object',
+- optional: false,
range: [21, 27],
loc: {
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/1-TSESTree-AST.shot
index 5608ba08cb8d..463d9e923660 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 15, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -36,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [10, 11],
loc: {
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/5-AST-Alignment-AST.shot
index 8d97c664397e..f995f9cb827f 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-param/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures declaration ClassDeclaration type-param AST Alignment - AS
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures declaration ClassDeclaration type-param AST Alignment - AS
end: { column: 15, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -30,6 +35,7 @@ exports[`AST Fixtures declaration ClassDeclaration type-param AST Alignment - AS
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -40,7 +46,9 @@ exports[`AST Fixtures declaration ClassDeclaration type-param AST Alignment - AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [10, 11],
- loc: {
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot
index e67ef8863216..449bb1d1903c 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 30, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -26,9 +31,12 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "Set",
+ optional: false,
range: [21, 24],
loc: {
@@ -36,14 +44,16 @@ Program {
end: { column: 24, line: 1 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+ superTypeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [25, 26],
loc: {
@@ -75,7 +85,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [10, 11],
loc: {
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot
index 60e9b202a98e..c370fbf2d484 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-
end: { column: 30, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -30,9 +35,12 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Set',
+- optional: false,
range: [21, 24],
loc: {
@@ -40,14 +48,17 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-
end: { column: 24, line: 1 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+- superTypeArguments: TSTypeParameterInstantiation {
++ superTypeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [25, 26],
loc: {
@@ -79,7 +90,9 @@ exports[`AST Fixtures declaration ClassDeclaration type-parameters-extends-type-
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [10, 11],
- loc: {
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
index 816492fcd483..881f037d0322 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
range: [14, 18],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 6, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -41,9 +48,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -51,6 +62,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 21],
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
index 121e647439e9..24c2998c99cf 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures declaration ClassDeclaration with-member-one AST Alignment
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,9 +18,13 @@ exports[`AST Fixtures declaration ClassDeclaration with-member-one AST Alignment
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop',
+- optional: false,
range: [14, 18],
loc: {
@@ -27,7 +32,9 @@ exports[`AST Fixtures declaration ClassDeclaration with-member-one AST Alignment
end: { column: 6, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -45,9 +52,13 @@ exports[`AST Fixtures declaration ClassDeclaration with-member-one AST Alignment
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -55,6 +66,7 @@ exports[`AST Fixtures declaration ClassDeclaration with-member-one AST Alignment
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 21],
diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..b45b0c8fc850
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ExportAllDeclaration _error_ missing-source Babel - Error 1`] = `[SyntaxError: Unexpected token (1:13)]`;
diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/1-TSESTree-Error.shot
index d3c411c7ec3a..41bd9538e7f8 100644
--- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportAllDeclaration _error_ missing-source TSESTree - Error 1`] = `[TSError: Expression expected.]`;
+exports[`AST Fixtures declaration ExportAllDeclaration _error_ missing-source TSESTree - Error 1`] = `
+"TSError
+> 1 | export * from;
+ | ^ Expression expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..89889f0ae319
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ExportAllDeclaration _error_ missing-source Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..04ccfb73d5bb
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot
index 5f6d97e5f2b1..cea1b9f24689 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportAllDeclaration _error_ named-non-identifier TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration ExportAllDeclaration _error_ named-non-identifier TSESTree - Error 1`] = `
+"TSError
+> 1 | export * as 'foo' from 'module';
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..3e05e98bfafd
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-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_/non-string-source/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..a3d08a7b52a3
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot
index bcf5b40695c1..f3e5cca59233 100644
--- 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
@@ -1,3 +1,8 @@
// 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.]`;
+exports[`AST Fixtures declaration ExportAllDeclaration _error_ non-string-source TSESTree - Error 1`] = `
+"TSError
+> 1 | export * from module;
+ | ^^^^^^ Module specifier must be a string literal.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..3a1a419a8312
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-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/assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot
index d5880f6e82a7..cfc3aa2ff7c5 100644
--- 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
@@ -11,7 +11,9 @@ Program {
type: "ImportAttribute",
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "type",
+ optional: false,
range: [29, 33],
loc: {
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
index 077fe892d338..73bad658c9a9 100644
--- 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
@@ -2,5 +2,75 @@
exports[`AST Fixtures declaration ExportAllDeclaration assertion AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportAllDeclaration {
+ type: 'ExportAllDeclaration',
+ assertions: Array [
+ ImportAttribute {
+ type: 'ImportAttribute',
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'type',
+- optional: false,
+
+ 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/kind-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/1-TSESTree-AST.shot
index 46c322f26487..4ca39e1413a6 100644
--- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/1-TSESTree-AST.shot
@@ -9,7 +9,9 @@ Program {
assertions: [],
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/5-AST-Alignment-AST.shot
index 7d543dbf7590..35ef7eeb190b 100644
--- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/kind-type/snapshots/5-AST-Alignment-AST.shot
@@ -13,7 +13,9 @@ exports[`AST Fixtures declaration ExportAllDeclaration kind-type AST Alignment -
assertions: Array [],
exported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
range: [17, 18],
loc: {
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
index 414f4ad0e4dd..0e45eb9b9ff3 100644
--- 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
@@ -9,7 +9,9 @@ Program {
assertions: [],
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "mod",
+ optional: false,
range: [12, 15],
loc: {
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
index 8aabbae33575..195370c94fce 100644
--- 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
@@ -2,5 +2,53 @@
exports[`AST Fixtures declaration ExportAllDeclaration named AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportAllDeclaration {
+ type: 'ExportAllDeclaration',
+ assertions: Array [],
+ exported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'mod',
+- optional: false,
+
+ 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/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..294c438cb03c
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/1-TSESTree-Error.shot
index c289052b36c9..2d7fc99e0d68 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ enum TSESTree - Error 1`] = `[TSError: Expression expected.]`;
+exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ enum TSESTree - Error 1`] = `
+"TSError
+> 1 | export default enum Foo {}
+ | ^ Expression expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..32a1cb0d3000
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-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/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..a80c32336147
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/1-TSESTree-Error.shot
index d1633569950d..49d3238347f4 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ namespace TSESTree - Error 1`] = `[TSError: ';' expected.]`;
+exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ namespace TSESTree - Error 1`] = `
+"TSError
+> 1 | export default namespace Foo {}
+ | ^ ';' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..7ecaa9bcded4
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-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/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..6afc67d4a5b0
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/1-TSESTree-Error.shot
index bce2c7cd5eee..c9b9a1add352 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ type-alias TSESTree - Error 1`] = `[TSError: ';' expected.]`;
+exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ type-alias TSESTree - Error 1`] = `
+"TSError
+> 1 | export default type Foo = 1;
+ | ^ ';' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..9f4c01a03373
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-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/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..318dee3aacf2
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/1-TSESTree-Error.shot
index 43ab9a3893ec..d8dbfa385498 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ variable-declaration TSESTree - Error 1`] = `[TSError: Expression expected.]`;
+exports[`AST Fixtures declaration ExportDefaultDeclaration _error_ variable-declaration TSESTree - Error 1`] = `
+"TSError
+> 1 | export default const x = 1;
+ | ^ Expression expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..327cd763562b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-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/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-class/snapshots/1-TSESTree-AST.shot
index 39f134981110..b9477b990945 100644
--- 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
@@ -8,6 +8,7 @@ Program {
type: "ExportDefaultDeclaration",
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,7 +19,10 @@ Program {
end: { column: 23, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: null,
+ implements: [],
superClass: null,
range: [15, 23],
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
index 6c6174587332..27fa552a1265 100644
--- 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
@@ -2,5 +2,54 @@
exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-class AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportDefaultDeclaration {
+ type: 'ExportDefaultDeclaration',
+ declaration: ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [21, 23],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 23, line: 1 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: null,
+- implements: Array [],
+ 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-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/anonymous-function/snapshots/1-TSESTree-AST.shot
index b385410a6f48..78e1248e57a3 100644
--- 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
@@ -19,6 +19,7 @@ Program {
end: { column: 29, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
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
index 0472fbccb826..5ccd7cf076e8 100644
--- 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
@@ -2,5 +2,54 @@
exports[`AST Fixtures declaration ExportDefaultDeclaration anonymous-function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ 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 },
+ },
+ },
+- declare: false,
+ 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/class-expression/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class-expression/snapshots/1-TSESTree-AST.shot
index 27c43a096a46..6d1adf5f5c36 100644
--- 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
@@ -8,6 +8,7 @@ Program {
type: "ExportDefaultDeclaration",
declaration: ClassExpression {
type: "ClassExpression",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,9 +19,13 @@ Program {
end: { column: 28, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [22, 25],
loc: {
@@ -28,6 +33,7 @@ Program {
end: { column: 25, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [16, 28],
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
index 4d3dd269c491..f49e8ea492d0 100644
--- 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
@@ -2,5 +2,65 @@
exports[`AST Fixtures declaration ExportDefaultDeclaration class-expression AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportDefaultDeclaration {
+ type: 'ExportDefaultDeclaration',
+ declaration: ClassExpression {
+ type: 'ClassExpression',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [26, 28],
+ loc: {
+ start: { column: 26, line: 1 },
+ end: { column: 28, line: 1 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [22, 25],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 25, line: 1 },
+ },
+ },
+- implements: Array [],
+ 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/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/class/snapshots/1-TSESTree-AST.shot
index 10f61a476b32..5f8ad663f083 100644
--- 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
@@ -8,6 +8,7 @@ Program {
type: "ExportDefaultDeclaration",
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,9 +19,13 @@ Program {
end: { column: 27, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [21, 24],
loc: {
@@ -28,6 +33,7 @@ Program {
end: { column: 24, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [15, 27],
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
index 892ae8987da5..31cfe8a973e8 100644
--- 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
@@ -2,5 +2,65 @@
exports[`AST Fixtures declaration ExportDefaultDeclaration class AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportDefaultDeclaration {
+ type: 'ExportDefaultDeclaration',
+ declaration: ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [25, 27],
+ loc: {
+ start: { column: 25, line: 1 },
+ end: { column: 27, line: 1 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [21, 24],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+- implements: Array [],
+ 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/function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/function/snapshots/1-TSESTree-AST.shot
index 8583f46cc17f..538a6bf0b1be 100644
--- 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
@@ -19,11 +19,14 @@ Program {
end: { column: 32, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [24, 27],
loc: {
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
index 6e67c16fb8bd..d5c74ed1fc0b 100644
--- 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
@@ -2,5 +2,65 @@
exports[`AST Fixtures declaration ExportDefaultDeclaration function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ 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 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ 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/identifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/identifier/snapshots/1-TSESTree-AST.shot
index 2b194f9fe410..e065912d92ed 100644
--- 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
@@ -8,7 +8,9 @@ Program {
type: "ExportDefaultDeclaration",
declaration: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [15, 16],
loc: {
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
index 1fc84e1257d5..5682d50ae12f 100644
--- 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
@@ -2,5 +2,41 @@
exports[`AST Fixtures declaration ExportDefaultDeclaration identifier AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportDefaultDeclaration {
+ type: 'ExportDefaultDeclaration',
+ declaration: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ 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/interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/interface/snapshots/1-TSESTree-AST.shot
index 4f5ff343403a..2375cb57a510 100644
--- 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
@@ -18,9 +18,13 @@ Program {
end: { column: 31, line: 1 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [25, 28],
loc: {
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
index 778b30b15138..5818ff75d813 100644
--- 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
@@ -2,5 +2,62 @@
exports[`AST Fixtures declaration ExportDefaultDeclaration interface AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ 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 },
+ },
+ },
+- declare: false,
+- extends: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ 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/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..dabc7d927d5d
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-TSESTree-Error.shot
index 71841045f6c5..015ff072aa2f 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportNamedDeclaration _error_ aliased-literal TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ aliased-literal TSESTree - Error 1`] = `
+"TSError
+> 1 | export { a as 'a' };
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..efb973998424
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-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/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..b3ebe67f29a9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/1-TSESTree-Error.shot
index 4bb37139b1b5..499868339f53 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class TSESTree - Error 1`] = `
+"TSError
+> 1 | export class {}
+ | ^^^^^^^^^^^^^^^ A class declaration without the 'default' modifier must have a name.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..82e5ade47506
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-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-class/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/3-Alignment-Error.shot
index 82e5ade47506..1f5170139747 100644
--- 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
@@ -1,3 +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"`;
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-class Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..70ef1140faae
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/1-TSESTree-Error.shot
index 9c89f7d7f370..4082dd30023d 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-function-expression TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ anonymous-function-expression TSESTree - Error 1`] = `
+"TSError
+> 1 | export function () {}
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..15aae2856e1b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-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/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..d3a01941b964
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/1-TSESTree-Error.shot
index bc1507d797f0..28d1d2439646 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportNamedDeclaration _error_ arrow-function TSESTree - Error 1`] = `[TSError: Declaration or statement expected.]`;
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ arrow-function TSESTree - Error 1`] = `
+"TSError
+> 1 | export () => {};
+ | ^ Declaration or statement expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..fd6445ddef39
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-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_/assertion/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..873ef0496aac
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ assertion Babel - Error 1`] = `[SyntaxError: A JSON module can only be imported with \`default\`. (1:9)]`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..b75c9eb03cbc
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ assertion Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..59d790cb18df
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/1-TSESTree-Error.shot
index af9eba5ac2cc..ceed78baec4e 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportNamedDeclaration _error_ class-expression TSESTree - Error 1`] = `[TSError: Declaration or statement expected.]`;
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ class-expression TSESTree - Error 1`] = `
+"TSError
+> 1 | export (class Foo {});
+ | ^ Declaration or statement expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..dbe6913aab56
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-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/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..968987af2099
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/1-TSESTree-Error.shot
index 302c6c7c652d..1f563cfbf37e 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportNamedDeclaration _error_ identifier-direct TSESTree - Error 1`] = `[TSError: Declaration or statement expected.]`;
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ identifier-direct TSESTree - Error 1`] = `
+"TSError
+> 1 | export a;
+ | ^ Declaration or statement expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..00f60c625f57
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-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/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..3ba27489473b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-TSESTree-Error.shot
index 7e7d8c008fc2..55c09361565e 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-braced TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-braced TSESTree - Error 1`] = `
+"TSError
+> 1 | export { 'a' };
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..f2d4bb40cc50
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-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/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..cf5a26409d14
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/1-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/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/1-TSESTree-Error.shot
index 9e96ac055223..119a66ed891f 100644
--- 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
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-direct TSESTree - Error 1`] = `[TSError: Declaration or statement expected.]`;
+exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-direct TSESTree - Error 1`] = `
+"TSError
+> 1 | export 'a';
+ | ^ Declaration or statement expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..7d06f41fc053
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-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/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot
index 3d293d479061..4b9ea6313a38 100644
--- 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
@@ -15,7 +15,9 @@ Program {
type: "ExportSpecifier",
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [14, 15],
loc: {
@@ -26,7 +28,9 @@ Program {
exportKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [9, 10],
loc: {
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
index 845f2cb5cfbc..81487c9bfc10 100644
--- 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
@@ -19,7 +19,9 @@ exports[`AST Fixtures declaration ExportNamedDeclaration aliased AST Alignment -
type: 'ExportSpecifier',
exported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [14, 15],
loc: {
@@ -30,7 +32,9 @@ exports[`AST Fixtures declaration ExportNamedDeclaration aliased AST Alignment -
exportKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [9, 10],
loc: {
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
index 38a932b15106..f5bf7d6c3a98 100644
--- 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
@@ -9,6 +9,7 @@ Program {
assertions: [],
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -19,9 +20,13 @@ Program {
end: { column: 19, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [13, 16],
loc: {
@@ -29,6 +34,7 @@ Program {
end: { column: 16, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [7, 19],
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
index cb90ab5e0fbc..1e08010d64dd 100644
--- 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
@@ -2,5 +2,68 @@
exports[`AST Fixtures declaration ExportNamedDeclaration class AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportNamedDeclaration {
+ type: 'ExportNamedDeclaration',
+ assertions: Array [],
+ declaration: ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [17, 19],
+ loc: {
+ start: { column: 17, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [13, 16],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+- implements: Array [],
+ 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/declare-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/declare-function/snapshots/1-TSESTree-AST.shot
index e3bcf1073f7d..47339e03ec4c 100644
--- 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
@@ -15,7 +15,9 @@ Program {
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [24, 27],
loc: {
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
index 9aaae286a11a..b1623c4968c0 100644
--- 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
@@ -19,7 +19,9 @@ exports[`AST Fixtures declaration ExportNamedDeclaration declare-function AST Al
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [24, 27],
loc: {
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
index 52eb4ae3b015..8f25a46494f8 100644
--- 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
@@ -9,9 +9,13 @@ Program {
assertions: [],
declaration: TSEnumDeclaration {
type: "TSEnumDeclaration",
+ const: false,
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [12, 15],
loc: {
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
index 1a21129afb24..cba00ad04c18 100644
--- 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
@@ -2,5 +2,56 @@
exports[`AST Fixtures declaration ExportNamedDeclaration enum AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportNamedDeclaration {
+ type: 'ExportNamedDeclaration',
+ assertions: Array [],
+ declaration: TSEnumDeclaration {
+ type: 'TSEnumDeclaration',
+- const: false,
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ 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/function-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/function-declaration/snapshots/1-TSESTree-AST.shot
index d00e691d3bc6..ba60ee6c0a84 100644
--- 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
@@ -20,11 +20,14 @@ Program {
end: { column: 24, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [16, 19],
loc: {
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
index fe318b3ed6ff..31a4f289f309 100644
--- 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
@@ -2,5 +2,68 @@
exports[`AST Fixtures declaration ExportNamedDeclaration function-declaration AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportNamedDeclaration {
+ type: 'ExportNamedDeclaration',
+ assertions: Array [],
+ declaration: 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 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ 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/identifier-braced/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot
index 24a743aa3e04..72b482685c12 100644
--- 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
@@ -15,7 +15,9 @@ Program {
type: "ExportSpecifier",
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [9, 10],
loc: {
@@ -26,7 +28,9 @@ Program {
exportKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [9, 10],
loc: {
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
index 240f602618f3..d17b88c8cc63 100644
--- 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
@@ -19,7 +19,9 @@ exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced AST A
type: 'ExportSpecifier',
exported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [9, 10],
loc: {
@@ -30,7 +32,9 @@ exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced AST A
exportKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [9, 10],
loc: {
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
index ce7c51c99dc4..cf88a1a29c46 100644
--- 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
@@ -15,7 +15,9 @@ Program {
type: "ExportSpecifier",
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [9, 10],
loc: {
@@ -26,7 +28,9 @@ Program {
exportKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [9, 10],
loc: {
@@ -45,7 +49,9 @@ Program {
type: "ExportSpecifier",
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [12, 13],
loc: {
@@ -56,7 +62,9 @@ Program {
exportKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [12, 13],
loc: {
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
index 8d76dc7c5710..19de4d0f7c2e 100644
--- 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
@@ -19,7 +19,9 @@ exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many AST Ali
type: 'ExportSpecifier',
exported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [9, 10],
loc: {
@@ -30,7 +32,9 @@ exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many AST Ali
exportKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [9, 10],
loc: {
@@ -49,7 +53,9 @@ exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many AST Ali
type: 'ExportSpecifier',
exported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [12, 13],
loc: {
@@ -60,7 +66,9 @@ exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many AST Ali
exportKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [12, 13],
loc: {
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
index de96750e8a2e..490d6d7493d9 100644
--- 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
@@ -19,9 +19,13 @@ Program {
end: { column: 23, line: 1 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [17, 20],
loc: {
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
index 02ddc518379b..4a6ef4e90d4a 100644
--- 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
@@ -23,9 +23,13 @@ exports[`AST Fixtures declaration ExportNamedDeclaration interface AST Alignment
end: { column: 23, line: 1 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [17, 20],
loc: {
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-Babel-AST.shot
new file mode 100644
index 000000000000..494c5144247c
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-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/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot
index fe50a12a050a..073273fe601b 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/1-TSESTree-AST.shot
@@ -19,9 +19,13 @@ Program {
end: { column: 23, line: 1 },
},
},
+ declare: false,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [17, 20],
loc: {
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/2-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/2-Babel-Tokens.shot
new file mode 100644
index 000000000000..0a3d1ca1dee4
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/2-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
index d9b1ab535bb8..f2293b94d195 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot
@@ -23,9 +23,13 @@ exports[`AST Fixtures declaration ExportNamedDeclaration namespace AST Alignment
end: { column: 23, line: 1 },
},
},
+- declare: false,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [17, 20],
loc: {
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
index 9bc7be30c10f..a5080b151db7 100644
--- 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
@@ -9,9 +9,12 @@ Program {
assertions: [],
declaration: TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [12, 13],
loc: {
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
index db70418e9f1d..896628c64828 100644
--- 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
@@ -13,9 +13,12 @@ exports[`AST Fixtures declaration ExportNamedDeclaration type-alias AST Alignmen
assertions: Array [],
declaration: TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [12, 13],
loc: {
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
index a28d27041498..92f70fe2850f 100644
--- 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
@@ -12,9 +12,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [13, 14],
loc: {
@@ -41,6 +44,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [7, 19],
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
index bb45021e9c4a..b265b8c947b4 100644
--- 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
@@ -2,5 +2,78 @@
exports[`AST Fixtures declaration ExportNamedDeclaration variable-declaration AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportNamedDeclaration {
+ type: 'ExportNamedDeclaration',
+ assertions: Array [],
+ declaration: VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ 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 },
+ },
+ },
+ ],
+- declare: false,
+ 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/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..d0110ccac63f
--- /dev/null
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration FunctionDeclaration _error_ missing-id-and-not-exported Babel - Error 1`] = `[SyntaxError: Unexpected token (1:9)]`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/1-TSESTree-Error.shot
index e8630b3f99ce..0956bdc9b2f4 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration FunctionDeclaration _error_ missing-id-and-not-exported TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration FunctionDeclaration _error_ missing-id-and-not-exported TSESTree - Error 1`] = `
+"TSError
+> 1 | function () {}
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..adae3f26337b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration FunctionDeclaration _error_ missing-id-and-not-exported Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..83a2a868f15a
--- /dev/null
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration FunctionDeclaration _error_ missing-type-param Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (1:12)]`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..04a70d3af29f
--- /dev/null
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration FunctionDeclaration _error_ missing-type-param Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..d23f3eff9555
--- /dev/null
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration FunctionDeclaration _error_ non-identifier-name Babel - Error 1`] = `[SyntaxError: Unexpected token (1:9)]`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
index 156bebb725cf..ac2aad35f541 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration FunctionDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration FunctionDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `
+"TSError
+> 1 | function 1() {}
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..f34f77cd1b85
--- /dev/null
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration FunctionDeclaration _error_ non-identifier-name Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..8be1b8d27a37
--- /dev/null
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration FunctionDeclaration _error_ non-identifier-type-param Babel - Error 1`] = `[SyntaxError: Unexpected token (1:13)]`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
index 8c643863afba..13d3d85c2d04 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration FunctionDeclaration _error_ non-identifier-type-param TSESTree - Error 1`] = `[TSError: Type parameter declaration expected.]`;
+exports[`AST Fixtures declaration FunctionDeclaration _error_ non-identifier-type-param TSESTree - Error 1`] = `
+"TSError
+> 1 | function foo<1>() {}
+ | ^ Type parameter declaration expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..f2b863d8647a
--- /dev/null
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration FunctionDeclaration _error_ non-identifier-type-param Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/async/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/async/snapshots/1-TSESTree-AST.shot
index e6fff4485ad5..5db6bc765d6f 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/async/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/async/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 23, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [15, 18],
loc: {
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/async/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/async/snapshots/5-AST-Alignment-AST.shot
index fe3cf227fbae..0d134e323b29 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/async/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/async/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,55 @@
exports[`AST Fixtures declaration FunctionDeclaration async AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: true,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [21, 23],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 23, line: 1 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ params: 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/FunctionDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot
index 5488f802897c..ddeb4088ebab 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 17, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [9, 12],
loc: {
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
index b08265806b56..4d1680384f24 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,55 @@
exports[`AST Fixtures declaration FunctionDeclaration empty AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [15, 17],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [9, 12],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 12, line: 1 },
+ },
+ },
+ params: Array [],
+
+ range: [0, 17],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 18],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/generator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/generator/snapshots/1-TSESTree-AST.shot
index e4e71a2fb49d..67d476e5548c 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/generator/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/generator/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 18, line: 1 },
},
},
+ declare: false,
expression: false,
generator: true,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [10, 13],
loc: {
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/generator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/generator/snapshots/5-AST-Alignment-AST.shot
index e94e87d038a4..37659c98a4ab 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/generator/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/generator/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,55 @@
exports[`AST Fixtures declaration FunctionDeclaration generator AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [16, 18],
+ loc: {
+ start: { column: 16, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: true,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ params: 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/FunctionDeclaration/fixtures/param-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-many/snapshots/1-TSESTree-AST.shot
index 50300869247a..25ed627b8d00 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-many/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 24, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [9, 12],
loc: {
@@ -32,7 +35,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [13, 14],
loc: {
@@ -42,7 +47,9 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [16, 17],
loc: {
@@ -52,7 +59,9 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [19, 20],
loc: {
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-many/snapshots/5-AST-Alignment-AST.shot
index f8b80c46b1e6..8e1fef0e8e0d 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-many/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,92 @@
exports[`AST Fixtures declaration FunctionDeclaration param-many AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ 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 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [9, 12],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 12, line: 1 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [13, 14],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [16, 17],
+ loc: {
+ start: { column: 16, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'c',
+- optional: false,
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ ],
+
+ range: [0, 24],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 25],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-one/snapshots/1-TSESTree-AST.shot
index f2b6eb75bd01..17873554d10a 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-one/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 18, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [9, 12],
loc: {
@@ -32,7 +35,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [13, 14],
loc: {
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-one/snapshots/5-AST-Alignment-AST.shot
index 5c75a74de72a..24d97c68311f 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/param-one/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,68 @@
exports[`AST Fixtures declaration FunctionDeclaration param-one AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [16, 18],
+ loc: {
+ start: { column: 16, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [9, 12],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 12, line: 1 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [13, 14],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 14, 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/FunctionDeclaration/fixtures/returnType/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/returnType/snapshots/1-TSESTree-AST.shot
index 9b4bc22574ac..71e8be80b3c9 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/returnType/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/returnType/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 23, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [9, 12],
loc: {
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/returnType/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/returnType/snapshots/5-AST-Alignment-AST.shot
index d0df21058e9f..50df6aa1bbb1 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/returnType/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/returnType/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,73 @@
exports[`AST Fixtures declaration FunctionDeclaration returnType AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [21, 23],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 23, line: 1 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [9, 12],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 12, line: 1 },
+ },
+ },
+ params: Array [],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSVoidKeyword {
+ type: 'TSVoidKeyword',
+
+ range: [16, 20],
+ loc: {
+ start: { column: 16, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+
+ range: [14, 20],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+
+ 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/FunctionDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
index c0c9374cef98..7ca866c911bf 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 26, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [9, 12],
loc: {
@@ -39,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [13, 14],
loc: {
@@ -61,7 +66,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [16, 17],
loc: {
@@ -83,7 +90,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "V",
+ optional: false,
range: [19, 20],
loc: {
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
index b910a007d541..a51ce3f5843c 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
@@ -21,11 +21,14 @@ exports[`AST Fixtures declaration FunctionDeclaration type-param-many AST Alignm
end: { column: 26, line: 1 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [9, 12],
loc: {
@@ -43,7 +46,9 @@ exports[`AST Fixtures declaration FunctionDeclaration type-param-many AST Alignm
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [13, 14],
- loc: {
@@ -66,7 +71,9 @@ exports[`AST Fixtures declaration FunctionDeclaration type-param-many AST Alignm
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [16, 17],
- loc: {
@@ -89,7 +96,9 @@ exports[`AST Fixtures declaration FunctionDeclaration type-param-many AST Alignm
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'V',
+- optional: false,
-
- range: [19, 20],
- loc: {
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
index 591b41616e64..397c78f0a9b2 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 20, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [9, 12],
loc: {
@@ -39,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [13, 14],
loc: {
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
index d54f1d9b3957..f70efb2f43cd 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
@@ -21,11 +21,14 @@ exports[`AST Fixtures declaration FunctionDeclaration type-param-one AST Alignme
end: { column: 20, line: 1 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [9, 12],
loc: {
@@ -43,7 +46,9 @@ exports[`AST Fixtures declaration FunctionDeclaration type-param-one AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [13, 14],
- loc: {
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/spec.ts b/packages/ast-spec/src/declaration/FunctionDeclaration/spec.ts
index 4fe3d2dc693e..0ede710628c4 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/spec.ts
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/spec.ts
@@ -6,8 +6,7 @@ import type { BlockStatement } from '../../statement/BlockStatement/spec';
interface FunctionDeclarationBase extends FunctionBase {
type: AST_NODE_TYPES.FunctionDeclaration;
body: BlockStatement;
- // TODO(#5020) - make this always `false` if it is not `declare`d instead of `undefined`
- declare?: false;
+ declare: false;
expression: false;
}
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..438c9cdf7501
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ default-non-identifier Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:7)]`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-TSESTree-Error.shot
index 233c225dd505..33e9c446a1ac 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ImportDeclaration _error_ default-non-identifier TSESTree - Error 1`] = `[TSError: Declaration or statement expected.]`;
+exports[`AST Fixtures declaration ImportDeclaration _error_ default-non-identifier TSESTree - Error 1`] = `
+"TSError
+> 1 | import 1 from 'mod';
+ | ^ Declaration or statement expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..2e0bcbec5a5e
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ default-non-identifier Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..9cf4c4b719a9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ named-and-namespace Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "from" (1:12)]`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/1-TSESTree-Error.shot
index d94d399517ff..e5cfc6b43cc0 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ImportDeclaration _error_ named-and-namespace TSESTree - Error 1`] = `[TSError: 'from' expected.]`;
+exports[`AST Fixtures declaration ImportDeclaration _error_ named-and-namespace TSESTree - Error 1`] = `
+"TSError
+> 1 | import { b }, * as a from 'a';
+ | ^ 'from' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..89fae3fa27c3
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ named-and-namespace Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..970528e3253d
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ named-non-identifier Babel - Error 1`] = `[SyntaxError: Unexpected token (1:9)]`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot
index 2ca1651099be..a4b94678f3e0 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ImportDeclaration _error_ named-non-identifier TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration ImportDeclaration _error_ named-non-identifier TSESTree - Error 1`] = `
+"TSError
+> 1 | import { 1 } from 'mod';
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..fefbeef9c524
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ named-non-identifier Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..294d069aacc6
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-default Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "from" (1:13)]`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/1-TSESTree-Error.shot
index 9d2be22fe16f..59a98df1b7c2 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-default TSESTree - Error 1`] = `[TSError: 'from' expected.]`;
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-default TSESTree - Error 1`] = `
+"TSError
+> 1 | import * as b, a from 'mod';
+ | ^ 'from' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..6e491db0e63b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-default Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..605940a84336
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-named Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "from" (1:13)]`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/1-TSESTree-Error.shot
index a2271606e4be..53e838303c47 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-named TSESTree - Error 1`] = `[TSError: 'from' expected.]`;
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-named TSESTree - Error 1`] = `
+"TSError
+> 1 | import * as a, { b } from 'a';
+ | ^ 'from' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..f1e891dbecaf
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-named Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..8efbfcaf5191
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-namespace Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "from" (1:13)]`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/1-TSESTree-Error.shot
index 0a5d4ab3922f..3f80cb253da7 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-namespace TSESTree - Error 1`] = `[TSError: 'from' expected.]`;
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-namespace TSESTree - Error 1`] = `
+"TSError
+> 1 | import * as a, * as b from 'a';
+ | ^ 'from' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..e3c8c7a6288d
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-namespace Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..a511cc6c94d3
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-non-identifier Babel - Error 1`] = `[SyntaxError: Unexpected token (1:12)]`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/1-TSESTree-Error.shot
index fa9ec459a928..4264e2530ef2 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-non-identifier TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-non-identifier TSESTree - Error 1`] = `
+"TSError
+> 1 | import * as 1 from 'mod';
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..f0d97ae32bc8
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-non-identifier Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..49abb8366621
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source Babel - Error 1`] = `[SyntaxError: Unexpected token (1:19)]`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot
index 4cfff84fd98c..9c245972b5d3 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source TSESTree - Error 1`] = `[TSError: Module specifier must be a string literal.]`;
+exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source TSESTree - Error 1`] = `
+"TSError
+> 1 | import * as x from module;
+ | ^^^^^^ Module specifier must be a string literal.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..0d5964ffc24c
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot
index 21520b956797..c47958900194 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot
@@ -11,7 +11,9 @@ Program {
type: "ImportAttribute",
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "type",
+ optional: false,
range: [34, 38],
loc: {
@@ -55,7 +57,9 @@ Program {
type: "ImportNamespaceSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [12, 13],
loc: {
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot
index c7b85e439dad..96cbf1acd91e 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,97 @@
exports[`AST Fixtures declaration ImportDeclaration assertion AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [
+ ImportAttribute {
+ type: 'ImportAttribute',
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'type',
+- optional: false,
+
+ range: [34, 38],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 38, line: 1 },
+ },
+ },
+ value: Literal {
+ type: 'Literal',
+ raw: '\\'json\\'',
+ value: 'json',
+
+ range: [40, 46],
+ loc: {
+ start: { column: 40, line: 1 },
+ end: { column: 46, line: 1 },
+ },
+ },
+
+ range: [34, 46],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 46, line: 1 },
+ },
+ },
+ ],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [19, 24],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ specifiers: Array [
+ ImportNamespaceSpecifier {
+ type: 'ImportNamespaceSpecifier',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [12, 13],
+ loc: {
+ start: { column: 12, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+
+ range: [7, 13],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ ],
+
+ range: [0, 49],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 49, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [0, 50],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/1-TSESTree-AST.shot
index c313d622bce2..8b38359c0e5a 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportDefaultSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [7, 8],
loc: {
@@ -43,7 +45,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [12, 13],
loc: {
@@ -54,7 +58,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [12, 13],
loc: {
@@ -73,7 +79,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [15, 16],
loc: {
@@ -84,7 +92,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [15, 16],
loc: {
@@ -103,7 +113,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "d",
+ optional: false,
range: [18, 19],
loc: {
@@ -114,7 +126,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "d",
+ optional: false,
range: [18, 19],
loc: {
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/5-AST-Alignment-AST.shot
index 5a7d0eb9f83d..c6194ed42716 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-many/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,166 @@
exports[`AST Fixtures declaration ImportDeclaration default-and-named-many AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [27, 32],
+ loc: {
+ start: { column: 27, line: 1 },
+ end: { column: 32, line: 1 },
+ },
+ },
+ specifiers: Array [
+ ImportDefaultSpecifier {
+ type: 'ImportDefaultSpecifier',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ ImportSpecifier {
+ type: 'ImportSpecifier',
+ imported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [12, 13],
+ loc: {
+ start: { column: 12, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ importKind: 'value',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ 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 },
+ },
+ },
+ ImportSpecifier {
+ type: 'ImportSpecifier',
+ imported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'c',
+- optional: false,
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+ importKind: 'value',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'c',
+- optional: false,
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+ ImportSpecifier {
+ type: 'ImportSpecifier',
+ imported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'd',
+- optional: false,
+
+ range: [18, 19],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ importKind: 'value',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'd',
+- optional: false,
+
+ range: [18, 19],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+
+ range: [18, 19],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ ],
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 33, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [0, 34],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/1-TSESTree-AST.shot
index eb772c5560a9..bed5bd1289cb 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportDefaultSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [26, 27],
loc: {
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/5-AST-Alignment-AST.shot
index 77b9d9ec72bc..7d7acd1e28b1 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-none/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,64 @@
exports[`AST Fixtures declaration ImportDeclaration default-and-named-none AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [37, 42],
+ loc: {
+ start: { column: 18, line: 2 },
+ end: { column: 23, line: 2 },
+ },
+ },
+ specifiers: Array [
+ ImportDefaultSpecifier {
+ type: 'ImportDefaultSpecifier',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [26, 27],
+ loc: {
+ start: { column: 7, line: 2 },
+ end: { column: 8, line: 2 },
+ },
+ },
+
+ range: [26, 27],
+ loc: {
+ start: { column: 7, line: 2 },
+ end: { column: 8, line: 2 },
+ },
+ },
+ ],
+
+ range: [19, 43],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 24, line: 2 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [19, 44],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 0, line: 3 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/1-TSESTree-AST.shot
index 1ea4756931ca..f54adf1db18c 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportDefaultSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [7, 8],
loc: {
@@ -43,7 +45,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [12, 13],
loc: {
@@ -54,7 +58,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [12, 13],
loc: {
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/5-AST-Alignment-AST.shot
index 8661b6d43b20..5457bc7111eb 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-named-one/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,98 @@
exports[`AST Fixtures declaration ImportDeclaration default-and-named-one AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [21, 26],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 26, line: 1 },
+ },
+ },
+ specifiers: Array [
+ ImportDefaultSpecifier {
+ type: 'ImportDefaultSpecifier',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ ImportSpecifier {
+ type: 'ImportSpecifier',
+ imported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [12, 13],
+ loc: {
+ start: { column: 12, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ importKind: 'value',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ 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, 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/ImportDeclaration/fixtures/default-and-namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/1-TSESTree-AST.shot
index 34c14d0729c0..ab716a4e00fd 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportDefaultSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [7, 8],
loc: {
@@ -43,7 +45,9 @@ Program {
type: "ImportNamespaceSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [15, 16],
loc: {
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/5-AST-Alignment-AST.shot
index c975ae691183..622ac6c755bf 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default-and-namespace/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,85 @@
exports[`AST Fixtures declaration ImportDeclaration default-and-namespace AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [22, 27],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 27, line: 1 },
+ },
+ },
+ specifiers: Array [
+ ImportDefaultSpecifier {
+ type: 'ImportDefaultSpecifier',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ ImportNamespaceSpecifier {
+ type: 'ImportNamespaceSpecifier',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+
+ range: [10, 16],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+ ],
+
+ range: [0, 28],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 28, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [0, 29],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/1-TSESTree-AST.shot
index d8ef93e2bcf6..50127e55882a 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportDefaultSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [7, 8],
loc: {
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/5-AST-Alignment-AST.shot
index 2524045a8077..4bbe4eb94800 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/default/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,64 @@
exports[`AST Fixtures declaration ImportDeclaration default AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [14, 19],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ specifiers: Array [
+ ImportDefaultSpecifier {
+ type: 'ImportDefaultSpecifier',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ ],
+
+ range: [0, 20],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [0, 21],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/1-TSESTree-AST.shot
index 69d5b7567456..38a4b893dcc1 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [9, 10],
loc: {
@@ -35,7 +37,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [9, 10],
loc: {
@@ -54,7 +58,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [12, 13],
loc: {
@@ -65,7 +71,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [12, 13],
loc: {
@@ -84,7 +92,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [15, 16],
loc: {
@@ -95,7 +105,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [15, 16],
loc: {
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/5-AST-Alignment-AST.shot
index 3f4b4b678e7d..43e854741994 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-many/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,145 @@
exports[`AST Fixtures declaration ImportDeclaration named-many AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [24, 29],
+ loc: {
+ start: { column: 24, line: 1 },
+ end: { column: 29, line: 1 },
+ },
+ },
+ specifiers: Array [
+ ImportSpecifier {
+ type: 'ImportSpecifier',
+ imported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [9, 10],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 10, line: 1 },
+ },
+ },
+ importKind: 'value',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ 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 },
+ },
+ },
+ ImportSpecifier {
+ type: 'ImportSpecifier',
+ imported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [12, 13],
+ loc: {
+ start: { column: 12, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ importKind: 'value',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ 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 },
+ },
+ },
+ ImportSpecifier {
+ type: 'ImportSpecifier',
+ imported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'c',
+- optional: false,
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+ importKind: 'value',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'c',
+- optional: false,
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, 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/ImportDeclaration/fixtures/named-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/1-TSESTree-AST.shot
index e12f543ac79d..1bf7774ca11a 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [9, 10],
loc: {
@@ -35,7 +37,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [9, 10],
loc: {
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/5-AST-Alignment-AST.shot
index a502907e8f62..d9cd9c7eb25d 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-one/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,77 @@
exports[`AST Fixtures declaration ImportDeclaration named-one AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [18, 23],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 23, line: 1 },
+ },
+ },
+ specifiers: Array [
+ ImportSpecifier {
+ type: 'ImportSpecifier',
+ imported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [9, 10],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 10, line: 1 },
+ },
+ },
+ importKind: 'value',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ 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, 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/TSDeclareFunction/fixtures/_error_/async/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..01db37879fb0
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ async Babel - Error 1`] = `[SyntaxError: Missing semicolon. (1:7)]`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..1f36cb0955fb
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ async Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..e56bbb598920
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ declare-with-body Babel - Error 1`] = `[SyntaxError: An implementation cannot be declared in ambient contexts. (1:0)]`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..22b125b56439
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ declare-with-body Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..bb9716addfbd
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ missing-id-and-not-exported Babel - Error 1`] = `[SyntaxError: Unexpected token (1:17)]`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/1-TSESTree-Error.shot
index 53a142d37bec..552e4f76d053 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSDeclareFunction _error_ missing-id-and-not-exported TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration TSDeclareFunction _error_ missing-id-and-not-exported TSESTree - Error 1`] = `
+"TSError
+> 1 | declare function ();
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..7bd554c552ac
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ missing-id-and-not-exported Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..be819649c559
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ missing-type-param Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (1:20)]`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..83fabb4dfc72
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ missing-type-param Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..12fadb8985a9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ non-identifier-name Babel - Error 1`] = `[SyntaxError: Unexpected token (1:17)]`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
index 86f0f5e5e10e..42648fc529ac 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSDeclareFunction _error_ non-identifier-name TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration TSDeclareFunction _error_ non-identifier-name TSESTree - Error 1`] = `
+"TSError
+> 1 | declare function 1();
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..0587657ad4e3
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ non-identifier-name Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..82c36588558a
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ non-identifier-type-param Babel - Error 1`] = `[SyntaxError: Unexpected token (1:19)]`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
index 4b033027f130..cb267be45a90 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSDeclareFunction _error_ non-identifier-type-param TSESTree - Error 1`] = `[TSError: Type parameter declaration expected.]`;
+exports[`AST Fixtures declaration TSDeclareFunction _error_ non-identifier-type-param TSESTree - Error 1`] = `
+"TSError
+> 1 | declare function f<1>(): void;
+ | ^ Type parameter declaration expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..0d57d7e26a4f
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSDeclareFunction _error_ non-identifier-type-param Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/empty/snapshots/1-TSESTree-AST.shot
index 4a3c6fc890fd..02d0f0be04a6 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/empty/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/empty/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [17, 20],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
index 89f8ab5e3471..db8ca71596da 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,45 @@
exports[`AST Fixtures declaration TSDeclareFunction empty AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSDeclareFunction {
+ type: 'TSDeclareFunction',
+ async: false,
+ declare: true,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [17, 20],
+ loc: {
+ start: { column: 17, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ params: 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/TSDeclareFunction/fixtures/generator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/1-TSESTree-AST.shot
index 1a4b2942e3fd..b621f52027bf 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
generator: true,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [18, 21],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/5-AST-Alignment-AST.shot
index e5478271a49b..f2de95210fab 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/generator/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,45 @@
exports[`AST Fixtures declaration TSDeclareFunction generator AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSDeclareFunction {
+ type: 'TSDeclareFunction',
+ async: false,
+ declare: true,
+ expression: false,
+ generator: true,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [18, 21],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+ params: Array [],
+
+ range: [0, 24],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 25],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-many/snapshots/1-TSESTree-AST.shot
index 272852bf6bb1..eef7af8af217 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-many/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [17, 20],
loc: {
@@ -23,7 +25,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [21, 22],
loc: {
@@ -33,7 +37,9 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [24, 25],
loc: {
@@ -43,7 +49,9 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [27, 28],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-many/snapshots/5-AST-Alignment-AST.shot
index cfed52f085e8..a5f9bb2ff413 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-many/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,82 @@
exports[`AST Fixtures declaration TSDeclareFunction param-many AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSDeclareFunction {
+ type: 'TSDeclareFunction',
+ async: false,
+ declare: true,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [17, 20],
+ loc: {
+ start: { column: 17, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [21, 22],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [24, 25],
+ loc: {
+ start: { column: 24, line: 1 },
+ end: { column: 25, line: 1 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'c',
+- optional: false,
+
+ range: [27, 28],
+ loc: {
+ start: { column: 27, line: 1 },
+ end: { column: 28, 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/TSDeclareFunction/fixtures/param-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-one/snapshots/1-TSESTree-AST.shot
index da937eccc13c..7b4383d832f5 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-one/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [17, 20],
loc: {
@@ -23,7 +25,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [21, 22],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-one/snapshots/5-AST-Alignment-AST.shot
index 81f8c45d6564..45d4a64b961b 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/param-one/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,58 @@
exports[`AST Fixtures declaration TSDeclareFunction param-one AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSDeclareFunction {
+ type: 'TSDeclareFunction',
+ async: false,
+ declare: true,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [17, 20],
+ loc: {
+ start: { column: 17, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [21, 22],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ ],
+
+ range: [0, 24],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 25],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/returnType/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/returnType/snapshots/1-TSESTree-AST.shot
index 792faca05354..fa8ec36adb31 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/returnType/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/returnType/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [17, 20],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/returnType/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/returnType/snapshots/5-AST-Alignment-AST.shot
index bddda38b36f0..291cdb6599d4 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/returnType/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/returnType/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,63 @@
exports[`AST Fixtures declaration TSDeclareFunction returnType AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSDeclareFunction {
+ type: 'TSDeclareFunction',
+ async: false,
+ declare: true,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [17, 20],
+ loc: {
+ start: { column: 17, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ params: Array [],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSVoidKeyword {
+ type: 'TSVoidKeyword',
+
+ range: [24, 28],
+ loc: {
+ start: { column: 24, line: 1 },
+ end: { column: 28, line: 1 },
+ },
+ },
+
+ range: [22, 28],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 28, line: 1 },
+ },
+ },
+
+ range: [0, 29],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 29, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 30],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
index 6af698ad0b99..acf12bd81e2d 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [17, 20],
loc: {
@@ -30,7 +32,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [21, 22],
loc: {
@@ -52,7 +56,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [24, 25],
loc: {
@@ -74,7 +80,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "V",
+ optional: false,
range: [27, 28],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
index 711d27f25cf4..6a9a1fce5309 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
@@ -16,7 +16,9 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-many AST Alignmen
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [17, 20],
loc: {
@@ -34,7 +36,9 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-many AST Alignmen
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [21, 22],
- loc: {
@@ -57,8 +61,11 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-many AST Alignmen
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
--
+- optional: false,
++ name: 'U',
+
- range: [24, 25],
- loc: {
- start: { column: 24, line: 1 },
@@ -66,8 +73,7 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-many AST Alignmen
- },
- },
- out: false,
-+ name: 'U',
-
+-
range: [24, 25],
loc: {
start: { column: 24, line: 1 },
@@ -80,7 +86,9 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-many AST Alignmen
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'V',
+- optional: false,
-
- range: [27, 28],
- loc: {
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
index 5ee44430806b..15316bd31a95 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [17, 20],
loc: {
@@ -30,7 +32,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [21, 22],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
index a683f16a8787..e1e39ac6154b 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
@@ -16,7 +16,9 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-one AST Alignment
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [17, 20],
loc: {
@@ -34,7 +36,9 @@ exports[`AST Fixtures declaration TSDeclareFunction type-param-one AST Alignment
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [21, 22],
- loc: {
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/without-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/without-declare/snapshots/1-TSESTree-AST.shot
index dd3182b826a9..98e4d655fb33 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/without-declare/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/without-declare/snapshots/1-TSESTree-AST.shot
@@ -7,11 +7,14 @@ Program {
TSDeclareFunction {
type: "TSDeclareFunction",
async: false,
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [9, 12],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/without-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/without-declare/snapshots/5-AST-Alignment-AST.shot
index 7f5b5b1b141d..3de9bc65960d 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/without-declare/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/without-declare/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,63 @@
exports[`AST Fixtures declaration TSDeclareFunction without-declare AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSDeclareFunction {
+ type: 'TSDeclareFunction',
+ async: false,
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [9, 12],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 12, line: 1 },
+ },
+ },
+ params: Array [],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSVoidKeyword {
+ type: 'TSVoidKeyword',
+
+ range: [16, 20],
+ loc: {
+ start: { column: 16, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+
+ range: [14, 20],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+
+ 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/TSDeclareFunction/spec.ts b/packages/ast-spec/src/declaration/TSDeclareFunction/spec.ts
index ea37a1e874f6..50cc07ec4248 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/spec.ts
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/spec.ts
@@ -5,9 +5,7 @@ import type { BlockStatement } from '../../statement/BlockStatement/spec';
// TODO(#1852) - async + declare are semantically invalid together
export interface TSDeclareFunction extends FunctionBase {
type: AST_NODE_TYPES.TSDeclareFunction;
- // TODO(#1852) - breaking change enforce this is always `null` like `TSEmptyBodyFunctionExpression`
- body?: BlockStatement;
- // TODO(#5020) - make this always `false` if it is not `declare`d instead of `undefined`
- declare?: boolean;
+ body: BlockStatement | undefined;
+ declare: boolean;
expression: false;
}
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts
new file mode 100644
index 000000000000..7f23a59e1c56
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/fixture.ts
@@ -0,0 +1 @@
+@decl enum Test {}
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..fdb865b6c323
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..7e24abcf6f6d
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator TSESTree - Error 1`] = `
+"TSError
+> 1 | @decl enum Test {}
+ | ^^^^^ Decorators are not valid here.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..4851229263b2
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..fdb865b6c323
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..f0a67ebe105d
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..69fc4aef1475
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ missing-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:8)]`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot
index 898964994760..4d532e2b649e 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSEnumDeclaration _error_ missing-body TSESTree - Error 1`] = `[TSError: '{' expected.]`;
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ missing-body TSESTree - Error 1`] = `
+"TSError
+> 1 | enum Foo;
+ | ^ '{' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..4d1d30b58b60
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ missing-body Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..676c0503e372
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ missing-id Babel - Error 1`] = `[SyntaxError: Unexpected token (1:5)]`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
index 0653a9025ef0..31015b7ff4e0 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSEnumDeclaration _error_ missing-id TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ missing-id TSESTree - Error 1`] = `
+"TSError
+> 1 | enum {}
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..5fb97329274d
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ missing-id Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..1cf8f0ab8999
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ non-identifier-name Babel - Error 1`] = `[SyntaxError: Unexpected token (1:5)]`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
index 15a27efccaf5..764dad5e9a48 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSEnumDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `
+"TSError
+> 1 | enum 1 {}
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..dd5c61750081
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSEnumDeclaration _error_ non-identifier-name Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/const/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/const/snapshots/1-TSESTree-AST.shot
index 5f55ba23c4d2..45c1e395be04 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/const/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/const/snapshots/1-TSESTree-AST.shot
@@ -7,9 +7,12 @@ Program {
TSEnumDeclaration {
type: "TSEnumDeclaration",
const: true,
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [11, 14],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/const/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/const/snapshots/5-AST-Alignment-AST.shot
index 95d4c8f6b4a0..c9480e42c3a4 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/const/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/const/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,43 @@
exports[`AST Fixtures declaration TSEnumDeclaration const AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSEnumDeclaration {
+ type: 'TSEnumDeclaration',
+ const: true,
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [11, 14],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ members: Array [],
+
+ range: [0, 17],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 18],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
index 19285542064d..b4e7d92295e5 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
@@ -6,10 +6,13 @@ Program {
body: [
TSEnumDeclaration {
type: "TSEnumDeclaration",
+ const: false,
declare: true,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [13, 16],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
index 5085b6b4609b..3926e3f88cc8 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,43 @@
exports[`AST Fixtures declaration TSEnumDeclaration declare AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSEnumDeclaration {
+ type: 'TSEnumDeclaration',
+- const: false,
+ declare: true,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [13, 16],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+ members: Array [],
+
+ range: [0, 19],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 20],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot
index cf40de4a0f55..2c454bcfcd82 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,13 @@ Program {
body: [
TSEnumDeclaration {
type: "TSEnumDeclaration",
+ const: false,
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [5, 8],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
index 2ce5c714db11..86d2f4844f4a 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,43 @@
exports[`AST Fixtures declaration TSEnumDeclaration empty AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSEnumDeclaration {
+ type: 'TSEnumDeclaration',
+- const: false,
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [5, 8],
+ loc: {
+ start: { column: 5, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ members: Array [],
+
+ range: [0, 11],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 12],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
index 9cfcde23d9c5..29f98e4e129e 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,13 @@ Program {
body: [
TSEnumDeclaration {
type: "TSEnumDeclaration",
+ const: false,
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [5, 8],
loc: {
@@ -19,9 +23,12 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [13, 14],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
index b707fc5d46bb..7137394a11bb 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,66 @@
exports[`AST Fixtures declaration TSEnumDeclaration with-member-one AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSEnumDeclaration {
+ type: 'TSEnumDeclaration',
+- const: false,
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [5, 8],
+ loc: {
+ start: { column: 5, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ members: Array [
+ TSEnumMember {
+ type: 'TSEnumMember',
+- computed: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [13, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 2 },
+ },
+ },
+
+ range: [13, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 2 },
+ },
+ },
+ ],
+
+ range: [0, 17],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 18],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSEnumDeclaration/spec.ts
index 9a0df845c5d8..1625063426c8 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/spec.ts
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/spec.ts
@@ -2,7 +2,6 @@ import type { AST_NODE_TYPES } from '../../ast-node-types';
import type { BaseNode } from '../../base/BaseNode';
import type { TSEnumMember } from '../../element/TSEnumMember/spec';
import type { Identifier } from '../../expression/Identifier/spec';
-import type { Modifier } from '../../unions/Modifier';
export interface TSEnumDeclaration extends BaseNode {
type: AST_NODE_TYPES.TSEnumDeclaration;
@@ -12,16 +11,14 @@ export interface TSEnumDeclaration extends BaseNode {
* const enum Foo {...}
* ```
*/
- // TODO(#5020) - make this `false` if it is not `const`
- const?: boolean;
+ const: boolean;
/**
* Whether this is a `declare`d enum.
* ```
* declare enum Foo {...}
* ```
*/
- // TODO(#5020) - make this `false` if it is not `declare`d
- declare?: boolean;
+ declare: boolean;
/**
* The enum name.
*/
@@ -30,6 +27,4 @@ export interface TSEnumDeclaration extends BaseNode {
* The enum members.
*/
members: TSEnumMember[];
- // TODO(#4759) - breaking change remove this
- modifiers?: Modifier[];
}
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..d5cc0b77735b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ entity-name-invalid Babel - Error 1`] = `[SyntaxError: Unexpected token (1:11)]`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/1-TSESTree-Error.shot
index 3593291fdb2a..7104057f55fe 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ entity-name-invalid TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ entity-name-invalid TSESTree - Error 1`] = `
+"TSError
+> 1 | import F = 1;
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..463142c713f0
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ entity-name-invalid Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..b19940abe312
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string Babel - Error 1`] = `[SyntaxError: Unexpected token (1:19)]`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..cda96c9ac3d2
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ external-module-ref-non-string Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..b8f9e5be4e4c
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ import-kind Babel - Error 1`] = `[SyntaxError: An import alias can not use 'import type'. (2:16)]`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..d9472dcc7b67
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ import-kind Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..3c24250cf63a
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ missing-id Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:7)]`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
index b5dc03a804c3..622b5fb5c396 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ missing-id TSESTree - Error 1`] = `[TSError: Declaration or statement expected.]`;
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ missing-id TSESTree - Error 1`] = `
+"TSError
+> 1 | import = A.B;
+ | ^ Declaration or statement expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..3f9e697fc06c
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ missing-id Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..6dcc0a599541
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ missing-reference Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "from" (1:8)]`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/1-TSESTree-Error.shot
index cb33fd8279bc..01d898e8806e 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ missing-reference TSESTree - Error 1`] = `[TSError: '=' expected.]`;
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ missing-reference TSESTree - Error 1`] = `
+"TSError
+> 1 | import F;
+ | ^ '=' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..7a3b4167a3b2
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSImportEqualsDeclaration _error_ missing-reference Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/snapshots/1-TSESTree-AST.shot
index bf7a3fe73152..6b87f8acb07a 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,9 @@ Program {
type: "TSImportEqualsDeclaration",
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [7, 8],
loc: {
@@ -17,14 +19,15 @@ Program {
},
},
importKind: "value",
- isExport: false,
moduleReference: TSQualifiedName {
type: "TSQualifiedName",
left: TSQualifiedName {
type: "TSQualifiedName",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [11, 12],
loc: {
@@ -34,7 +37,9 @@ Program {
},
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [13, 14],
loc: {
@@ -51,7 +56,9 @@ Program {
},
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [15, 16],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/snapshots/5-AST-Alignment-AST.shot
index 88ec007b237d..c67dc9cb5da3 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,96 @@
exports[`AST Fixtures declaration TSImportEqualsDeclaration entity-name-many AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSImportEqualsDeclaration {
+ type: 'TSImportEqualsDeclaration',
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'F',
+- optional: false,
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ importKind: 'value',
++ isExport: false,
+ moduleReference: TSQualifiedName {
+ type: 'TSQualifiedName',
+ left: TSQualifiedName {
+ type: 'TSQualifiedName',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [11, 12],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 12, line: 1 },
+ },
+ },
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'B',
+- optional: false,
+
+ range: [13, 14],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+
+ range: [11, 14],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'C',
+- optional: false,
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+
+ range: [11, 16],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+
+ range: [0, 17],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 18],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/snapshots/1-TSESTree-AST.shot
index e0c1fbc6a87b..1af8164565d7 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,9 @@ Program {
type: "TSImportEqualsDeclaration",
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [7, 8],
loc: {
@@ -17,10 +19,11 @@ Program {
},
},
importKind: "value",
- isExport: false,
moduleReference: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [11, 12],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/snapshots/5-AST-Alignment-AST.shot
index 0cb17969d4fb..f86cbe219c42 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,54 @@
exports[`AST Fixtures declaration TSImportEqualsDeclaration entity-name-one AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSImportEqualsDeclaration {
+ type: 'TSImportEqualsDeclaration',
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'F',
+- optional: false,
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ importKind: 'value',
++ isExport: false,
+ moduleReference: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [11, 12],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 12, 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/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/1-TSESTree-AST.shot
index 808994ac5618..114d1f13924f 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,9 @@ Program {
type: "TSImportEqualsDeclaration",
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [7, 8],
loc: {
@@ -17,7 +19,6 @@ Program {
},
},
importKind: "value",
- isExport: false,
moduleReference: TSExternalModuleReference {
type: "TSExternalModuleReference",
expression: Literal {
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/5-AST-Alignment-AST.shot
index 864ce14bb378..65e5501b5b51 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/5-AST-Alignment-AST.shot
@@ -12,7 +12,9 @@ exports[`AST Fixtures declaration TSImportEqualsDeclaration external-module-ref-
type: 'TSImportEqualsDeclaration',
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'F',
+- optional: false,
range: [7, 8],
loc: {
@@ -21,7 +23,7 @@ exports[`AST Fixtures declaration TSImportEqualsDeclaration external-module-ref-
},
},
importKind: 'value',
- isExport: false,
++ isExport: false,
moduleReference: TSExternalModuleReference {
type: 'TSExternalModuleReference',
expression: Literal {
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts
index d4db9a64168b..15fd64f11ad1 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts
@@ -22,12 +22,4 @@ export interface TSImportEqualsDeclaration extends BaseNode {
moduleReference: EntityName | TSExternalModuleReference;
// TODO(#1852) - breaking change remove this as it is invalid
importKind: ImportKind;
- /**
- * Whether this is immediately exported
- * ```
- * export import F = A;
- * ```
- */
- // TODO(#4130) - this should be represented in the AST
- isExport: boolean;
}
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts
new file mode 100644
index 000000000000..c6b88c003fb1
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/fixture.ts
@@ -0,0 +1 @@
+@decl interface Test {}
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..a9513b747ea3
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..de2011df9ce9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator TSESTree - Error 1`] = `
+"TSError
+> 1 | @decl interface Test {}
+ | ^^^^^ Decorators are not valid here.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..fb137780f453
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..a9513b747ea3
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..6018ccd90e04
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..12baf6e07385
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:11)]`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot
index 128274dff580..ab7e5c43958b 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-body TSESTree - Error 1`] = `[TSError: '{' expected.]`;
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-body TSESTree - Error 1`] = `
+"TSError
+> 1 | interface F;
+ | ^ '{' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..6caba1ae72c9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-body Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..add92930a37f
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-extends Babel - Error 1`] = `[SyntaxError: 'extends' list cannot be empty. (1:20)]`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..6eb1bf9104f9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..e06bfcc1a1c5
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-id Babel - Error 1`] = `[SyntaxError: 'interface' declarations must be followed by an identifier. (1:10)]`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
index d640ad78d536..2c69569d0fe8 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-id TSESTree - Error 1`] = `[TSError: Interface must be given a name.]`;
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-id TSESTree - Error 1`] = `
+"TSError
+> 1 | interface {}
+ | ^ Interface must be given a name.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..bbce8c51c4d4
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-id Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..936edbec8c8a
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-type-param Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (1:11)]`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..5846179dd56b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ missing-type-param Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..e7b584a9cd2e
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ non-identifier-extends Babel - Error 1`] = `[SyntaxError: Unexpected token (1:20)]`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..c429168c2884
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ non-identifier-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..64f544addb3b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ non-identifier-name Babel - Error 1`] = `[SyntaxError: 'interface' declarations must be followed by an identifier. (1:10)]`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
index 7b6a2f0a6669..4c5a9b4b0986 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `[TSError: Interface name cannot be '1'.]`;
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `
+"TSError
+> 1 | interface 1 {}
+ | ^ Interface name cannot be '1'.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..5470a1ec04e8
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ non-identifier-name Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..69166a9fa112
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ non-identifier-type-param Babel - Error 1`] = `[SyntaxError: Unexpected token (1:12)]`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
index e48629574cff..b84a281982b9 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ non-identifier-type-param TSESTree - Error 1`] = `[TSError: Type parameter declaration expected.]`;
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ non-identifier-type-param TSESTree - Error 1`] = `
+"TSError
+> 1 | interface F<1> {}
+ | ^ Type parameter declaration expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..5f1be010c628
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSInterfaceDeclaration _error_ non-identifier-type-param Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
index 70ec89ee02e2..97c82621d042 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
@@ -17,9 +17,12 @@ Program {
},
},
declare: true,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [18, 19],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
index c5bfaba693bb..f283ed85e49e 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,52 @@
exports[`AST Fixtures declaration TSInterfaceDeclaration declare AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSInterfaceDeclaration {
+ type: 'TSInterfaceDeclaration',
+ body: TSInterfaceBody {
+ type: 'TSInterfaceBody',
+ body: Array [],
+
+ range: [20, 22],
+ loc: {
+ start: { column: 20, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ declare: true,
+- extends: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'F',
+- optional: false,
+
+ range: [18, 19],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+
+ range: [0, 22],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 23],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot
index 358568791628..4c78898903ea 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/empty/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 14, line: 1 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [10, 11],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
index 42bc3c4eb68c..81a856aecb1e 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/empty/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,52 @@
exports[`AST Fixtures declaration TSInterfaceDeclaration empty AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSInterfaceDeclaration {
+ type: 'TSInterfaceDeclaration',
+ body: TSInterfaceBody {
+ type: 'TSInterfaceBody',
+ body: Array [],
+
+ range: [12, 14],
+ loc: {
+ start: { column: 12, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+- declare: false,
+- extends: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'F',
+- optional: false,
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+
+ range: [0, 14],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 15],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-many/snapshots/1-TSESTree-AST.shot
index 98cd5c06786d..9486b7754d6c 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-many/snapshots/1-TSESTree-AST.shot
@@ -16,12 +16,15 @@ Program {
end: { column: 30, line: 1 },
},
},
+ declare: false,
extends: [
TSInterfaceHeritage {
type: "TSInterfaceHeritage",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [20, 21],
loc: {
@@ -40,7 +43,9 @@ Program {
type: "TSInterfaceHeritage",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [23, 24],
loc: {
@@ -59,7 +64,9 @@ Program {
type: "TSInterfaceHeritage",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [26, 27],
loc: {
@@ -77,7 +84,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [10, 11],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-many/snapshots/5-AST-Alignment-AST.shot
index 793c00b7e980..5a1f33b4a959 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-many/snapshots/5-AST-Alignment-AST.shot
@@ -20,6 +20,7 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration extends-many AST Alignm
end: { column: 30, line: 1 },
},
},
+- declare: false,
extends: Array [
- TSInterfaceHeritage {
- type: 'TSInterfaceHeritage',
@@ -27,7 +28,9 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration extends-many AST Alignm
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [20, 21],
loc: {
@@ -48,7 +51,9 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration extends-many AST Alignm
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [23, 24],
loc: {
@@ -69,7 +74,9 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration extends-many AST Alignm
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [26, 27],
loc: {
@@ -87,7 +94,9 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration extends-many AST Alignm
],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'F',
+- optional: false,
range: [10, 11],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-one/snapshots/1-TSESTree-AST.shot
index a9113c856a86..d05004fd0b09 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-one/snapshots/1-TSESTree-AST.shot
@@ -16,12 +16,15 @@ Program {
end: { column: 24, line: 1 },
},
},
+ declare: false,
extends: [
TSInterfaceHeritage {
type: "TSInterfaceHeritage",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [20, 21],
loc: {
@@ -39,7 +42,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [10, 11],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-one/snapshots/5-AST-Alignment-AST.shot
index fe6cf12f1a56..a33d62920a1c 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/extends-one/snapshots/5-AST-Alignment-AST.shot
@@ -20,6 +20,7 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration extends-one AST Alignme
end: { column: 24, line: 1 },
},
},
+- declare: false,
extends: Array [
- TSInterfaceHeritage {
- type: 'TSInterfaceHeritage',
@@ -27,7 +28,9 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration extends-one AST Alignme
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [20, 21],
loc: {
@@ -45,7 +48,9 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration extends-one AST Alignme
],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'F',
+- optional: false,
range: [10, 11],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
index cb3872185124..81de6defaa55 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 23, line: 1 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [10, 11],
loc: {
@@ -35,7 +39,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [12, 13],
loc: {
@@ -57,7 +63,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [15, 16],
loc: {
@@ -79,7 +87,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "V",
+ optional: false,
range: [18, 19],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
index 4b1dec3a2695..d9d73d0a5b57 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration type-param-many AST Ali
end: { column: 23, line: 1 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'F',
+- optional: false,
range: [10, 11],
loc: {
@@ -39,7 +43,9 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration type-param-many AST Ali
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [12, 13],
- loc: {
@@ -62,7 +68,9 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration type-param-many AST Ali
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [15, 16],
- loc: {
@@ -85,7 +93,9 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration type-param-many AST Ali
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'V',
+- optional: false,
-
- range: [18, 19],
- loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
index f3ce068e927b..4d08ac3f08aa 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 17, line: 1 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [10, 11],
loc: {
@@ -35,7 +39,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [12, 13],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
index 8470b26ba849..b32db7edb886 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration type-param-one AST Alig
end: { column: 17, line: 1 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'F',
+- optional: false,
range: [10, 11],
loc: {
@@ -39,7 +43,9 @@ exports[`AST Fixtures declaration TSInterfaceDeclaration type-param-one AST Alig
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [12, 13],
- loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
index 1438312b63cd..9ea6e2ce08f6 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
range: [16, 20],
loc: {
@@ -22,6 +24,9 @@ Program {
end: { column: 6, line: 2 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
range: [16, 21],
loc: {
@@ -37,9 +42,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [10, 11],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
index 8e0b58b2efe7..63acdce107d3 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,78 @@
exports[`AST Fixtures declaration TSInterfaceDeclaration with-member-one AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSInterfaceDeclaration {
+ type: 'TSInterfaceDeclaration',
+ body: TSInterfaceBody {
+ type: 'TSInterfaceBody',
+ body: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'prop',
+- optional: false,
+
+ range: [16, 20],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 6, line: 2 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+
+ range: [16, 21],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ ],
+
+ range: [12, 23],
+ loc: {
+ start: { column: 12, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+- declare: false,
+- extends: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'F',
+- optional: false,
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+
+ range: [0, 23],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 24],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/spec.ts
index a75c769daf92..9a35efc7c158 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/spec.ts
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/spec.ts
@@ -7,8 +7,6 @@ import type { TSTypeParameterDeclaration } from '../../special/TSTypeParameterDe
export interface TSInterfaceDeclaration extends BaseNode {
type: AST_NODE_TYPES.TSInterfaceDeclaration;
- // TODO(#4759) - breaking change remove this
- abstract?: boolean;
/**
* The body of the interface
*/
@@ -16,21 +14,17 @@ export interface TSInterfaceDeclaration extends BaseNode {
/**
* Whether the interface was `declare`d, `undefined` otherwise
*/
- // TODO(#5020) - make this `false` if it is not `declare`d
- declare?: boolean;
+ declare: boolean;
/**
* The types this interface `extends`
*/
- extends?: TSInterfaceHeritage[];
+ extends: TSInterfaceHeritage[];
/**
* The name of this interface
*/
id: Identifier;
- // TODO(#4759) - breaking change remove this
- implements?: TSInterfaceHeritage[];
/**
* The generic type parameters declared for the interface.
- * This is `undefined` if there are no generic type parameters declared.
*/
- typeParameters?: TSTypeParameterDeclaration;
+ typeParameters: TSTypeParameterDeclaration | undefined;
}
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..9848b6e55cd4
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ module-invalid-id Babel - Error 1`] = `[SyntaxError: Missing semicolon. (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/1-TSESTree-Error.shot
index 082a7d854c2d..60094efbe413 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSModuleDeclaration _error_ module-invalid-id TSESTree - Error 1`] = `[TSError: Namespace name cannot be '1'.]`;
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ module-invalid-id TSESTree - Error 1`] = `
+"TSError
+> 1 | module 1 {}
+ | ^ Namespace name cannot be '1'.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..1ed7cf1aba5a
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ module-invalid-id Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..c7c0b7ca1d45
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ module-missing-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:8)]`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/1-TSESTree-Error.shot
index 0a8a833a27ad..d6c0dfba3f33 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSModuleDeclaration _error_ module-missing-body TSESTree - Error 1`] = `[TSError: '{' expected.]`;
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ module-missing-body TSESTree - Error 1`] = `
+"TSError
+> 1 | module F;
+ | ^ '{' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..f8381f6dde37
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ module-missing-body Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..0cc4df30bc58
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-declare-no-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:19)]`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/1-TSESTree-Error.shot
index 6a1c0b8eebfd..a3fd19de9bd2 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-declare-no-body TSESTree - Error 1`] = `[TSError: '{' expected.]`;
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-declare-no-body TSESTree - Error 1`] = `
+"TSError
+> 1 | declare namespace F;
+ | ^ '{' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..62ff96dfe97d
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-declare-no-body Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..3dc7480d32a2
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-id-literal Babel - Error 1`] = `[SyntaxError: Missing semicolon. (1:9)]`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/1-TSESTree-Error.shot
index bdb99cfb914e..d390e8f8ba9b 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-id-literal TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-id-literal TSESTree - Error 1`] = `
+"TSError
+> 1 | namespace 'a' {}
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..354b7482759b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-id-literal Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..be52f2461a2a
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-invalid-id Babel - Error 1`] = `[SyntaxError: Missing semicolon. (1:9)]`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/1-TSESTree-Error.shot
index 3fbcf961cfad..c857310223a6 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-invalid-id TSESTree - Error 1`] = `[TSError: Namespace name cannot be '1'.]`;
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-invalid-id TSESTree - Error 1`] = `
+"TSError
+> 1 | namespace 1 {}
+ | ^ Namespace name cannot be '1'.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..1a3abc42ed72
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-invalid-id Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..4e9e941de863
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-no-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:11)]`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/1-TSESTree-Error.shot
index 33a26d312caf..d01edfb1d189 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-no-body TSESTree - Error 1`] = `[TSError: '{' expected.]`;
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-no-body TSESTree - Error 1`] = `
+"TSError
+> 1 | namespace F;
+ | ^ '{' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..2c9165727c10
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration _error_ namespace-no-body Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/1-TSESTree-AST.shot
index 620efabfacd1..3741aeb7940b 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/1-TSESTree-AST.shot
@@ -20,7 +20,9 @@ Program {
global: true,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "global",
+ optional: false,
range: [8, 14],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/5-AST-Alignment-AST.shot
index 5dc4161ad9a4..9fcac3c8efde 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/global/snapshots/5-AST-Alignment-AST.shot
@@ -24,7 +24,9 @@ exports[`AST Fixtures declaration TSModuleDeclaration global AST Alignment - AST
global: true,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'global',
+- optional: false,
range: [8, 14],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/1-TSESTree-AST.shot
index d24ddaae90dc..e712b655ec3d 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/1-TSESTree-AST.shot
@@ -7,6 +7,7 @@ Program {
TSModuleDeclaration {
type: "TSModuleDeclaration",
declare: true,
+ global: false,
id: Literal {
type: "Literal",
raw: "'a'",
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/5-AST-Alignment-AST.shot
index 46729a482556..177d41ec23b0 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare-no-body/snapshots/5-AST-Alignment-AST.shot
@@ -11,6 +11,7 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-declare-no-body AST
TSModuleDeclaration {
type: 'TSModuleDeclaration',
declare: true,
+- global: false,
id: Literal {
type: 'Literal',
raw: '\\'a\\'',
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/1-TSESTree-AST.shot
index ac074fe5c98f..125af1ea1c7e 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/1-TSESTree-AST.shot
@@ -17,9 +17,12 @@ Program {
},
},
declare: true,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [15, 16],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/5-AST-Alignment-AST.shot
index 75dd7304dfaa..3fc7f8b34f9b 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-declare/snapshots/5-AST-Alignment-AST.shot
@@ -21,9 +21,12 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-declare AST Alignme
},
},
declare: true,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'F',
+- optional: false,
range: [15, 16],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/1-TSESTree-AST.shot
index 7f00836de0de..4d0056f41a9c 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 11, line: 1 },
},
},
+ declare: false,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [7, 8],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/5-AST-Alignment-AST.shot
index 36a5fb1365f5..433612e4520e 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-identifier/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-id-identifier AST A
end: { column: 11, line: 1 },
},
},
+- declare: false,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'F',
+- optional: false,
range: [7, 8],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/1-TSESTree-AST.shot
index 4017d7afc499..d0488ece67ab 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/1-TSESTree-AST.shot
@@ -16,6 +16,8 @@ Program {
end: { column: 13, line: 1 },
},
},
+ declare: false,
+ global: false,
id: Literal {
type: "Literal",
raw: "'a'",
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/5-AST-Alignment-AST.shot
index 66e35bee13d2..e28f27ef39a2 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-literal/snapshots/5-AST-Alignment-AST.shot
@@ -20,6 +20,8 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-id-literal AST Alig
end: { column: 13, line: 1 },
},
},
+- declare: false,
+- global: false,
id: Literal {
type: 'Literal',
raw: '\\'a\\'',
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/1-TSESTree-AST.shot
index abf76fd1619b..70ecf48cc228 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/1-TSESTree-AST.shot
@@ -20,9 +20,13 @@ Program {
end: { column: 15, line: 1 },
},
},
+ declare: false,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [11, 12],
loc: {
@@ -38,9 +42,13 @@ Program {
end: { column: 15, line: 1 },
},
},
+ declare: false,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [9, 10],
loc: {
@@ -56,9 +64,13 @@ Program {
end: { column: 15, line: 1 },
},
},
+ declare: false,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [7, 8],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/5-AST-Alignment-AST.shot
index 9c2311d4b6f6..ade25ba03e20 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/module-id-qualified-name/snapshots/5-AST-Alignment-AST.shot
@@ -24,9 +24,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-id-qualified-name A
end: { column: 15, line: 1 },
},
},
+- declare: false,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [11, 12],
loc: {
@@ -42,9 +46,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-id-qualified-name A
end: { column: 15, line: 1 },
},
},
+- declare: false,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [9, 10],
loc: {
@@ -60,9 +68,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration module-id-qualified-name A
end: { column: 15, line: 1 },
},
},
+- declare: false,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [7, 8],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-Babel-AST.shot
new file mode 100644
index 000000000000..269366508604
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-Babel-AST.shot
@@ -0,0 +1,46 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-declare Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: Array [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: Array [],
+
+ range: [20, 22],
+ loc: {
+ start: { column: 20, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ declare: true,
+ id: Identifier {
+ type: "Identifier",
+ name: "F",
+
+ range: [18, 19],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+
+ range: [0, 22],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 23],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+}
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-TSESTree-AST.shot
index 49ee11415db8..5d292ad18792 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/1-TSESTree-AST.shot
@@ -17,9 +17,12 @@ Program {
},
},
declare: true,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [18, 19],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/2-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/2-Babel-Tokens.shot
new file mode 100644
index 000000000000..374070330ed0
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/2-Babel-Tokens.shot
@@ -0,0 +1,56 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-declare Babel - Tokens 1`] = `
+Array [
+ Identifier {
+ type: "Identifier",
+ value: "declare",
+
+ range: [0, 7],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [8, 17],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "F",
+
+ range: [18, 19],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 19, 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: [21, 22],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/5-AST-Alignment-AST.shot
index 48f1c28a6f60..9e710ee89f40 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-declare/snapshots/5-AST-Alignment-AST.shot
@@ -21,9 +21,12 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-declare AST Alig
},
},
declare: true,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'F',
+- optional: false,
range: [18, 19],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-Babel-AST.shot
new file mode 100644
index 000000000000..2e47480e0447
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-Babel-AST.shot
@@ -0,0 +1,45 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-id-identifier Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: Array [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: Array [],
+
+ range: [12, 14],
+ loc: {
+ start: { column: 12, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "F",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+
+ range: [0, 14],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 15],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+}
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-TSESTree-AST.shot
index 86b030f02fd2..5b2c8774fa9f 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 14, line: 1 },
},
},
+ declare: false,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [10, 11],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/2-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/2-Babel-Tokens.shot
new file mode 100644
index 000000000000..1fb07e00228d
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/2-Babel-Tokens.shot
@@ -0,0 +1,46 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-id-identifier Babel - Tokens 1`] = `
+Array [
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [0, 9],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "F",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [12, 13],
+ loc: {
+ start: { column: 12, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [13, 14],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/5-AST-Alignment-AST.shot
index 1d16afdfbbb7..eeadb154ca4c 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-id-identifier AS
end: { column: 14, line: 1 },
},
},
+- declare: false,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'F',
+- optional: false,
range: [10, 11],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/1-TSESTree-AST.shot
index ec61e55c1a6c..b7deac52f603 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/1-TSESTree-AST.shot
@@ -6,64 +6,70 @@ Program {
body: [
TSModuleDeclaration {
type: "TSModuleDeclaration",
- body: TSModuleDeclaration {
- type: "TSModuleDeclaration",
- body: TSModuleDeclaration {
- type: "TSModuleDeclaration",
- body: TSModuleBlock {
- type: "TSModuleBlock",
- body: [],
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: [],
- range: [16, 18],
+ range: [16, 18],
+ loc: {
+ start: { column: 16, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ declare: false,
+ global: false,
+ id: TSQualifiedName {
+ type: "TSQualifiedName",
+ left: TSQualifiedName {
+ type: "TSQualifiedName",
+ left: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "A",
+ optional: false,
+
+ range: [10, 11],
loc: {
- start: { column: 16, line: 1 },
- end: { column: 18, line: 1 },
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
},
},
- id: Identifier {
+ right: Identifier {
type: "Identifier",
- name: "C",
+ decorators: [],
+ name: "B",
+ optional: false,
- range: [14, 15],
+ range: [12, 13],
loc: {
- start: { column: 14, line: 1 },
- end: { column: 15, line: 1 },
+ start: { column: 12, line: 1 },
+ end: { column: 13, line: 1 },
},
},
- kind: "namespace",
- range: [14, 18],
+ range: [10, 13],
loc: {
- start: { column: 14, line: 1 },
- end: { column: 18, line: 1 },
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
},
},
- id: Identifier {
+ right: Identifier {
type: "Identifier",
- name: "B",
+ decorators: [],
+ name: "C",
+ optional: false,
- range: [12, 13],
+ range: [14, 15],
loc: {
- start: { column: 12, line: 1 },
- end: { column: 13, line: 1 },
+ start: { column: 14, line: 1 },
+ end: { column: 15, line: 1 },
},
},
- kind: "namespace",
-
- range: [12, 18],
- loc: {
- start: { column: 12, line: 1 },
- end: { column: 18, line: 1 },
- },
- },
- id: Identifier {
- type: "Identifier",
- name: "A",
- range: [10, 11],
+ range: [10, 15],
loc: {
start: { column: 10, line: 1 },
- end: { column: 11, line: 1 },
+ end: { column: 15, line: 1 },
},
},
kind: "namespace",
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/5-AST-Alignment-AST.shot
index 5a99e367a51d..b3800ab80962 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/snapshots/5-AST-Alignment-AST.shot
@@ -10,64 +10,105 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-id-qualified-nam
body: Array [
TSModuleDeclaration {
type: 'TSModuleDeclaration',
- body: TSModuleDeclaration {
- type: 'TSModuleDeclaration',
- body: TSModuleDeclaration {
- type: 'TSModuleDeclaration',
- body: TSModuleBlock {
- type: 'TSModuleBlock',
- body: Array [],
+- body: TSModuleBlock {
+- type: 'TSModuleBlock',
+- body: Array [],
+-
+- range: [16, 18],
+- loc: {
+- start: { column: 16, line: 1 },
+- end: { column: 18, line: 1 },
+- },
+- },
+- declare: false,
+- global: false,
+- id: TSQualifiedName {
+- type: 'TSQualifiedName',
+- left: TSQualifiedName {
+- type: 'TSQualifiedName',
+- left: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'A',
+- optional: false,
++ body: TSModuleDeclaration {
++ type: 'TSModuleDeclaration',
++ body: TSModuleDeclaration {
++ type: 'TSModuleDeclaration',
++ body: TSModuleBlock {
++ type: 'TSModuleBlock',
++ body: Array [],
- range: [16, 18],
+- range: [10, 11],
++ range: [16, 18],
loc: {
- start: { column: 16, line: 1 },
- end: { column: 18, line: 1 },
+- start: { column: 10, line: 1 },
+- end: { column: 11, line: 1 },
++ start: { column: 16, line: 1 },
++ end: { column: 18, line: 1 },
},
},
- id: Identifier {
+- right: Identifier {
++ id: Identifier {
type: 'Identifier',
- name: 'C',
+- decorators: Array [],
+- name: 'B',
+- optional: false,
++ name: 'C',
- range: [14, 15],
+- range: [12, 13],
++ range: [14, 15],
loc: {
- start: { column: 14, line: 1 },
- end: { column: 15, line: 1 },
+- start: { column: 12, line: 1 },
+- end: { column: 13, line: 1 },
++ start: { column: 14, line: 1 },
++ end: { column: 15, line: 1 },
},
},
-- kind: 'namespace',
- range: [14, 18],
+- range: [10, 13],
++ range: [14, 18],
loc: {
- start: { column: 14, line: 1 },
- end: { column: 18, line: 1 },
+- start: { column: 10, line: 1 },
+- end: { column: 13, line: 1 },
++ start: { column: 14, line: 1 },
++ end: { column: 18, line: 1 },
},
},
- id: Identifier {
+- right: Identifier {
++ id: Identifier {
type: 'Identifier',
- name: 'B',
+- decorators: Array [],
+- name: 'C',
+- optional: false,
++ name: 'B',
- range: [12, 13],
+- range: [14, 15],
++ range: [12, 13],
loc: {
- start: { column: 12, line: 1 },
- end: { column: 13, line: 1 },
+- start: { column: 14, line: 1 },
+- end: { column: 15, line: 1 },
++ start: { column: 12, line: 1 },
++ end: { column: 13, line: 1 },
},
},
-- kind: 'namespace',
- range: [12, 18],
- loc: {
- start: { column: 12, line: 1 },
- end: { column: 18, line: 1 },
- },
- },
- id: Identifier {
- type: 'Identifier',
- name: 'A',
-
- range: [10, 11],
+- range: [10, 15],
++ range: [12, 18],
++ loc: {
++ start: { column: 12, line: 1 },
++ end: { column: 18, line: 1 },
++ },
++ },
++ id: Identifier {
++ type: 'Identifier',
++ name: 'A',
++
++ range: [10, 11],
loc: {
start: { column: 10, line: 1 },
- end: { column: 11, line: 1 },
+- end: { column: 15, line: 1 },
++ end: { column: 11, line: 1 },
},
},
- kind: 'namespace',
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/fixture.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/fixture.ts
new file mode 100644
index 000000000000..e4db463ec8fe
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/fixture.ts
@@ -0,0 +1 @@
+namespace abd.def {}
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..ad7361c18b2b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,71 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once TSESTree - AST 1`] = `
+Program {
+ type: "Program",
+ body: [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: [],
+
+ range: [18, 20],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ declare: false,
+ global: false,
+ id: TSQualifiedName {
+ type: "TSQualifiedName",
+ left: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "abd",
+ optional: false,
+
+ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ right: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "def",
+ optional: false,
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+
+ range: [10, 17],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ kind: "namespace",
+
+ 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/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..bb31b17d363b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,66 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once TSESTree - Tokens 1`] = `
+[
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [0, 9],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "abd",
+
+ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ".",
+
+ range: [13, 14],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "def",
+
+ 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/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..f778aa86d3a9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/3-Babel-AST.shot
@@ -0,0 +1,64 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: [],
+
+ range: [18, 20],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "def",
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+
+ range: [14, 20],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "abd",
+
+ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+
+ 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/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..8f26fcfe8673
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,66 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once Babel - Tokens 1`] = `
+[
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [0, 9],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "abd",
+
+ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ".",
+
+ range: [13, 14],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "def",
+
+ 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/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/5-AST-Alignment-AST.shot
new file mode 100644
index 000000000000..47d7105c32d0
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/5-AST-Alignment-AST.shot
@@ -0,0 +1,96 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once AST Alignment - AST 1`] = `
+"Snapshot Diff:
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSModuleDeclaration {
+ type: 'TSModuleDeclaration',
+- body: TSModuleBlock {
+- type: 'TSModuleBlock',
+- body: Array [],
+-
+- range: [18, 20],
+- loc: {
+- start: { column: 18, line: 1 },
+- end: { column: 20, line: 1 },
+- },
+- },
+- declare: false,
+- global: false,
+- id: TSQualifiedName {
+- type: 'TSQualifiedName',
+- left: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'abd',
+- optional: false,
++ body: TSModuleDeclaration {
++ type: 'TSModuleDeclaration',
++ body: TSModuleBlock {
++ type: 'TSModuleBlock',
++ body: Array [],
+
+- range: [10, 13],
++ range: [18, 20],
+ loc: {
+- start: { column: 10, line: 1 },
+- end: { column: 13, line: 1 },
++ start: { column: 18, line: 1 },
++ end: { column: 20, line: 1 },
+ },
+ },
+- right: Identifier {
++ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'def',
+- optional: false,
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+
+- range: [10, 17],
++ range: [14, 20],
++ loc: {
++ start: { column: 14, line: 1 },
++ end: { column: 20, line: 1 },
++ },
++ },
++ id: Identifier {
++ type: 'Identifier',
++ name: 'abd',
++
++ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+- end: { column: 17, line: 1 },
++ end: { column: 13, line: 1 },
+ },
+ },
+- kind: 'namespace',
+
+ 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/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/6-AST-Alignment-Tokens.shot
similarity index 50%
rename from packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/6-AST-Alignment-Tokens.shot
rename to packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/6-AST-Alignment-Tokens.shot
index fd832b249e4f..657e47e2dc16 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once/snapshots/6-AST-Alignment-Tokens.shot
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value AST Alignment - Token 1`] = `
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once AST Alignment - Token 1`] = `
"Snapshot Diff:
Compared values have no visual difference."
`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/fixture.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/fixture.ts
new file mode 100644
index 000000000000..aa16edb5ae59
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/fixture.ts
@@ -0,0 +1 @@
+namespace abc.def.ghi {}
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..8626f6f94c5c
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,92 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice TSESTree - AST 1`] = `
+Program {
+ type: "Program",
+ body: [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: [],
+
+ range: [22, 24],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ declare: false,
+ global: false,
+ id: TSQualifiedName {
+ type: "TSQualifiedName",
+ left: TSQualifiedName {
+ type: "TSQualifiedName",
+ left: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "abc",
+ optional: false,
+
+ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ right: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "def",
+ optional: false,
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+
+ range: [10, 17],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ right: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "ghi",
+ optional: false,
+
+ range: [18, 21],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+
+ range: [10, 21],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+ kind: "namespace",
+
+ range: [0, 24],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 25],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+}
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..5591f2e7a890
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,86 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice TSESTree - Tokens 1`] = `
+[
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [0, 9],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "abc",
+
+ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ".",
+
+ range: [13, 14],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "def",
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, 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 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "ghi",
+
+ range: [18, 21],
+ loc: {
+ start: { column: 18, 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/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..088cae325e56
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/3-Babel-AST.shot
@@ -0,0 +1,83 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: [],
+
+ range: [22, 24],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "ghi",
+
+ range: [18, 21],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+
+ range: [18, 24],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "def",
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+
+ range: [14, 24],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "abc",
+
+ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+
+ range: [0, 24],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 25],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+}
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..be52f742f11c
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,86 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice Babel - Tokens 1`] = `
+[
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [0, 9],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "abc",
+
+ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ".",
+
+ range: [13, 14],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "def",
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, 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 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "ghi",
+
+ range: [18, 21],
+ loc: {
+ start: { column: 18, 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/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/5-AST-Alignment-AST.shot
new file mode 100644
index 000000000000..c2b715d74432
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/5-AST-Alignment-AST.shot
@@ -0,0 +1,131 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice AST Alignment - AST 1`] = `
+"Snapshot Diff:
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSModuleDeclaration {
+ type: 'TSModuleDeclaration',
+- body: TSModuleBlock {
+- type: 'TSModuleBlock',
+- body: Array [],
+-
+- range: [22, 24],
+- loc: {
+- start: { column: 22, line: 1 },
+- end: { column: 24, line: 1 },
+- },
+- },
+- declare: false,
+- global: false,
+- id: TSQualifiedName {
+- type: 'TSQualifiedName',
+- left: TSQualifiedName {
+- type: 'TSQualifiedName',
+- left: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'abc',
+- optional: false,
++ body: TSModuleDeclaration {
++ type: 'TSModuleDeclaration',
++ body: TSModuleDeclaration {
++ type: 'TSModuleDeclaration',
++ body: TSModuleBlock {
++ type: 'TSModuleBlock',
++ body: Array [],
+
+- range: [10, 13],
++ range: [22, 24],
+ loc: {
+- start: { column: 10, line: 1 },
+- end: { column: 13, line: 1 },
++ start: { column: 22, line: 1 },
++ end: { column: 24, line: 1 },
+ },
+ },
+- right: Identifier {
++ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+- name: 'def',
+- optional: false,
++ name: 'ghi',
+
+- range: [14, 17],
++ range: [18, 21],
+ loc: {
+- start: { column: 14, line: 1 },
+- end: { column: 17, line: 1 },
++ start: { column: 18, line: 1 },
++ end: { column: 21, line: 1 },
+ },
+ },
+
+- range: [10, 17],
++ range: [18, 24],
+ loc: {
+- start: { column: 10, line: 1 },
+- end: { column: 17, line: 1 },
++ start: { column: 18, line: 1 },
++ end: { column: 24, line: 1 },
+ },
+ },
+- right: Identifier {
++ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+- name: 'ghi',
+- optional: false,
++ name: 'def',
+
+- range: [18, 21],
++ range: [14, 17],
+ loc: {
+- start: { column: 18, line: 1 },
+- end: { column: 21, line: 1 },
++ start: { column: 14, line: 1 },
++ end: { column: 17, line: 1 },
+ },
+ },
+
+- range: [10, 21],
++ range: [14, 24],
++ loc: {
++ start: { column: 14, line: 1 },
++ end: { column: 24, line: 1 },
++ },
++ },
++ id: Identifier {
++ type: 'Identifier',
++ name: 'abc',
++
++ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+- end: { column: 21, line: 1 },
++ end: { column: 13, line: 1 },
+ },
+ },
+- kind: 'namespace',
+
+ range: [0, 24],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 25],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/6-AST-Alignment-Tokens.shot
new file mode 100644
index 000000000000..f0ac1cd2c048
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/snapshots/6-AST-Alignment-Tokens.shot
@@ -0,0 +1,6 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice AST Alignment - Token 1`] = `
+"Snapshot Diff:
+Compared values have no visual difference."
+`;
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts
index 3afa8aee8c62..97319591f9e6 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts
@@ -3,21 +3,11 @@ import type { BaseNode } from '../../base/BaseNode';
import type { Identifier } from '../../expression/Identifier/spec';
import type { StringLiteral } from '../../expression/literal/StringLiteral/spec';
import type { TSModuleBlock } from '../../special/TSModuleBlock/spec';
-import type { Modifier } from '../../unions/Modifier';
+import type { TSQualifiedName } from '../../type/spec';
+import type { Literal } from '../../unions/Literal';
export type TSModuleDeclarationKind = 'global' | 'module' | 'namespace';
-/*
-TODO(#4966) - we currently emit this due to bad parser handling of nested modules
-namespace Foo.Bar {}
-^^^^^^^^^^^^^^^^^^^^ TSModuleDeclaration
- ^^^^^^ TSModuleDeclaration
- ^^ TSModuleBlock
-
-This should instead emit a TSQualifiedName for the `id` and not emit an inner TSModuleDeclaration
-*/
-type ModuleBody_TODOFixThis = TSModuleBlock | TSModuleDeclaration;
-
interface TSModuleDeclarationBase extends BaseNode {
type: AST_NODE_TYPES.TSModuleDeclaration;
/**
@@ -28,13 +18,13 @@ interface TSModuleDeclarationBase extends BaseNode {
* module 'a' {}
* ```
*/
- id: Identifier | StringLiteral;
+ id: Identifier | Literal | TSQualifiedName;
/**
* The body of the module.
* This can only be `undefined` for the code `declare module 'mod';`
* This will be a `TSModuleDeclaration` if the name is "nested" (`Foo.Bar`).
*/
- body?: ModuleBody_TODOFixThis;
+ body?: TSModuleBlock;
/**
* Whether this is a global declaration
* ```
@@ -42,17 +32,14 @@ interface TSModuleDeclarationBase extends BaseNode {
* ```
*/
// TODO - remove this in the next major (we have `.kind` now)
- global?: boolean;
+ global: boolean;
/**
* Whether the module is `declare`d
* ```
* declare namespace F {}
* ```
*/
- // TODO(#5020) - make this `false` if it is not `declare`d
- declare?: boolean;
- // TODO(#4759) - breaking change remove this
- modifiers?: Modifier[];
+ declare: boolean;
/**
* The keyword used to define this module declaration
@@ -73,12 +60,9 @@ interface TSModuleDeclarationBase extends BaseNode {
export interface TSModuleDeclarationNamespace extends TSModuleDeclarationBase {
kind: 'namespace';
// namespaces cannot have literal IDs
- id: Identifier;
+ id: Identifier | TSQualifiedName;
// namespaces must always have a body
- body: ModuleBody_TODOFixThis;
-
- // TODO - remove this in the next major (we have `.kind` now)
- global?: undefined;
+ body: TSModuleBlock;
}
export interface TSModuleDeclarationGlobal extends TSModuleDeclarationBase {
@@ -88,18 +72,10 @@ export interface TSModuleDeclarationGlobal extends TSModuleDeclarationBase {
body: TSModuleBlock;
// this will always be an Identifier with name `global`
id: Identifier;
-
- // note - it's not syntactically required to have `declare`, but it semantically required
-
- // TODO - remove this in the next major (we have `.kind` now)
- global: true;
}
interface TSModuleDeclarationModuleBase extends TSModuleDeclarationBase {
kind: 'module';
-
- // TODO - remove this in the next major (we have `.kind` now)
- global?: undefined;
}
export type TSModuleDeclarationModule =
@@ -129,7 +105,7 @@ export interface TSModuleDeclarationModuleWithIdentifierId
kind: 'module';
id: Identifier;
// modules with an Identifier must always have a body
- body: ModuleBody_TODOFixThis;
+ body: TSModuleBlock;
}
export type TSModuleDeclaration =
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..300850581d62
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSNamespaceExportDeclaration _error_ missing-id Babel - Error 1`] = `[SyntaxError: Unexpected token (1:19)]`;
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
index e47c9aa7c254..904fa17bbdae 100644
--- a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSNamespaceExportDeclaration _error_ missing-id TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration TSNamespaceExportDeclaration _error_ missing-id TSESTree - Error 1`] = `
+"TSError
+> 1 | export as namespace;
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..0b5d774603fd
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSNamespaceExportDeclaration _error_ missing-id Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..f2641cc64de2
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSNamespaceExportDeclaration _error_ non-identifier-name Babel - Error 1`] = `[SyntaxError: Unexpected token (1:20)]`;
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
index 3e11b4700297..54f1d45efe41 100644
--- a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSNamespaceExportDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `[TSError: Identifier expected.]`;
+exports[`AST Fixtures declaration TSNamespaceExportDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `
+"TSError
+> 1 | export as namespace 1;
+ | ^ Identifier expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..defe8a17bba2
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSNamespaceExportDeclaration _error_ non-identifier-name Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/valid/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/valid/snapshots/1-TSESTree-AST.shot
index 8fd4754eac49..766421336b4d 100644
--- a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/valid/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/valid/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,9 @@ Program {
type: "TSNamespaceExportDeclaration",
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [20, 21],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/valid/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/valid/snapshots/5-AST-Alignment-AST.shot
index 6cd11e1f4b30..21c15688f309 100644
--- a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/valid/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/valid/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,40 @@
exports[`AST Fixtures declaration TSNamespaceExportDeclaration valid AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSNamespaceExportDeclaration {
+ type: 'TSNamespaceExportDeclaration',
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [20, 21],
+ loc: {
+ start: { column: 20, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+
+ range: [0, 22],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 23],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts
new file mode 100644
index 000000000000..8c24b75c66c9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/fixture.ts
@@ -0,0 +1 @@
+@decl type Test = {};
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..635e4f5a1cfc
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..1392b9b0742f
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator TSESTree - Error 1`] = `
+"TSError
+> 1 | @decl type Test = {};
+ | ^^^^^ Decorators are not valid here.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..43ad98f601bc
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..635e4f5a1cfc
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..f99acadf19ae
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..b18ec532458e
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ missing-type-parameter Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..99587163b896
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ missing-type-parameter Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..f7c419205f79
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ non-identifier-name Babel - Error 1`] = `[SyntaxError: Missing semicolon. (1:4)]`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
index 7eaf3f0bba48..dc83090da35f 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `[TSError: Type alias name cannot be '1'.]`;
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ non-identifier-name TSESTree - Error 1`] = `
+"TSError
+> 1 | type 1 = 2;
+ | ^ Type alias name cannot be '1'.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..7ccef6da61f4
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ non-identifier-name Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..bb7b44f3afec
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ non-identifier-type-parameter Babel - Error 1`] = `[SyntaxError: Unexpected token (1:7)]`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/1-TSESTree-Error.shot
index b11bc95c96d0..eb6164b79a22 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ non-identifier-type-parameter TSESTree - Error 1`] = `[TSError: Type parameter declaration expected.]`;
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ non-identifier-type-parameter TSESTree - Error 1`] = `
+"TSError
+> 1 | type T<1> = 2;
+ | ^ Type parameter declaration expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..ad412071cc11
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration TSTypeAliasDeclaration _error_ non-identifier-type-parameter Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
index 9c87ddf606fc..636050c43afe 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
@@ -9,7 +9,9 @@ Program {
declare: true,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [13, 14],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
index 890509a8dcbb..253e63408e64 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,61 @@
exports[`AST Fixtures declaration TSTypeAliasDeclaration declare AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+ declare: true,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'T',
+- optional: false,
+
+ range: [13, 14],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ typeAnnotation: TSLiteralType {
+ type: 'TSLiteralType',
+ literal: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [17, 18],
+ loc: {
+ start: { column: 17, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+
+ range: [17, 18],
+ loc: {
+ start: { column: 17, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+
+ range: [0, 19],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 20],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
index 34001d72f461..42782e8b3a3b 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [5, 6],
loc: {
@@ -45,7 +48,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [7, 8],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
index 939521199a67..9bfe5c01694e 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-many/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures declaration TSTypeAliasDeclaration type-param-many AST Ali
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [5, 6],
loc: {
@@ -49,7 +52,9 @@ exports[`AST Fixtures declaration TSTypeAliasDeclaration type-param-many AST Ali
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [7, 8],
- loc: {
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
index afaff66bb437..1dbed91e6985 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [5, 6],
loc: {
@@ -45,7 +48,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [7, 8],
loc: {
@@ -67,7 +72,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "V",
+ optional: false,
range: [10, 11],
loc: {
@@ -89,7 +96,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "W",
+ optional: false,
range: [13, 14],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
index 9ea3fc2ca74b..b6e1bc8938a2 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/type-param-one/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures declaration TSTypeAliasDeclaration type-param-one AST Alig
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [5, 6],
loc: {
@@ -49,7 +52,9 @@ exports[`AST Fixtures declaration TSTypeAliasDeclaration type-param-one AST Alig
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [7, 8],
- loc: {
@@ -72,7 +77,9 @@ exports[`AST Fixtures declaration TSTypeAliasDeclaration type-param-one AST Alig
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'V',
+- optional: false,
-
- range: [10, 11],
- loc: {
@@ -95,7 +102,9 @@ exports[`AST Fixtures declaration TSTypeAliasDeclaration type-param-one AST Alig
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'W',
+- optional: false,
-
- range: [13, 14],
- loc: {
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/valid/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/valid/snapshots/1-TSESTree-AST.shot
index 9e3c3e98eeb2..5d3c83b66313 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/valid/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/valid/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [5, 6],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/valid/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/valid/snapshots/5-AST-Alignment-AST.shot
index 9cc16a451ec1..fe331054c0f0 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/valid/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/valid/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,61 @@
exports[`AST Fixtures declaration TSTypeAliasDeclaration valid AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'T',
+- optional: false,
+
+ range: [5, 6],
+ loc: {
+ start: { column: 5, line: 1 },
+ end: { column: 6, line: 1 },
+ },
+ },
+ typeAnnotation: TSLiteralType {
+ type: 'TSLiteralType',
+ literal: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ 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, 11],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 12],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/spec.ts
index 15ab0a40c131..6d7232344b26 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/spec.ts
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/spec.ts
@@ -12,8 +12,7 @@ export interface TSTypeAliasDeclaration extends BaseNode {
* declare type T = 1;
* ```
*/
- // TODO(#5020) - make this `false` if it is not `declare`d
- declare?: boolean;
+ declare: boolean;
/**
* The name of the type.
*/
@@ -24,7 +23,6 @@ export interface TSTypeAliasDeclaration extends BaseNode {
typeAnnotation: TypeNode;
/**
* The generic type parameters declared for the type.
- * This is `undefined` if there are no generic type parameters declared.
*/
- typeParameters?: TSTypeParameterDeclaration;
+ typeParameters: TSTypeParameterDeclaration | undefined;
}
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts
new file mode 100644
index 000000000000..8c24b75c66c9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/fixture.ts
@@ -0,0 +1 @@
+@decl type Test = {};
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..6dbe967b0471
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..fb0803d0ca05
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ decorator TSESTree - Error 1`] = `
+"TSError
+> 1 | @decl type Test = {};
+ | ^^^^^ Decorators are not valid here.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..27f74be39025
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..6dbe967b0471
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..2076158e5e78
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ decorator Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..5e6f7bc3288b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-with-value Babel - Error 1`] = `[SyntaxError: Unexpected token (1:6)]`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/1-TSESTree-Error.shot
index 3f61a7ec4bde..a644ecb13729 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-with-value TSESTree - Error 1`] = `[TSError: Variable declaration expected.]`;
+exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-with-value TSESTree - Error 1`] = `
+"TSError
+> 1 | const = 1;
+ | ^ Variable declaration expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..830f2f4e93c8
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-with-value Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..7a42d0e079b6
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value Babel - Error 1`] = `[SyntaxError: Unexpected token (1:5)]`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot
index 6537d529262e..dedcabc0bbf9 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value TSESTree - Error 1`] = `
+"TSError
+> 1 | const;
+ | ^^^^^^ A variable declaration list must have at least one variable declarator.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..cd2401b6862d
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot
index cd2401b6862d..89f5785e4c72 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures declaration VariableDeclaration _error_ missing-id-without-value Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts
new file mode 100644
index 000000000000..c53e6c279527
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/fixture.ts
@@ -0,0 +1 @@
+const;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..18d3755b6a4f
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Babel - Error 1`] = `[SyntaxError: Unexpected token (1:5)]`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..318ceeec6142
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables TSESTree - Error 1`] = `
+"TSError
+> 1 | const;
+ | ^^^^^^ A variable declaration list must have at least one variable declarator.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..5ce744c93380
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..18d3755b6a4f
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Babel - Error 1`] = `[SyntaxError: Unexpected token (1:5)]`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..8ff6adabf685
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration VariableDeclaration _error_ no-variables Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-with-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-with-value/snapshots/1-TSESTree-AST.shot
index c59f8219bb5e..0bf57620c6e2 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-with-value/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-with-value/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [6, 7],
loc: {
@@ -38,6 +41,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [0, 12],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-with-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-with-value/snapshots/5-AST-Alignment-AST.shot
index 65c9ece0d433..d997027ffaba 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-with-value/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-with-value/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,65 @@
exports[`AST Fixtures declaration VariableDeclaration const-with-value AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+
+ range: [6, 11],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ 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/VariableDeclaration/fixtures/const-without-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-without-value/snapshots/1-TSESTree-AST.shot
index f8e86b5f8ba7..0c7705ede31f 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-without-value/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-without-value/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [6, 7],
loc: {
@@ -38,6 +41,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [0, 12],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-without-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-without-value/snapshots/5-AST-Alignment-AST.shot
index 56007597c389..077480be9fd8 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-without-value/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/const-without-value/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,65 @@
exports[`AST Fixtures declaration VariableDeclaration const-without-value AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+
+ range: [6, 11],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ 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/VariableDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
index 8ea6a51268d4..a60c9f86f53b 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [12, 13],
loc: {
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
index 005dc078e1de..87e680ef9a28 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,55 @@
exports[`AST Fixtures declaration VariableDeclaration declare AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [12, 13],
+ loc: {
+ start: { column: 12, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ init: null,
+
+ range: [12, 13],
+ loc: {
+ start: { column: 12, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ ],
+ declare: true,
+ kind: 'let',
+
+ range: [0, 14],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 15],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-with-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-with-value/snapshots/1-TSESTree-AST.shot
index 227feb509803..9795f20c91c2 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-with-value/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-with-value/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [4, 5],
loc: {
@@ -38,6 +41,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [0, 10],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-with-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-with-value/snapshots/5-AST-Alignment-AST.shot
index 2697799a4159..b275669e12ac 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-with-value/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-with-value/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,65 @@
exports[`AST Fixtures declaration VariableDeclaration let-with-value AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [4, 5],
+ loc: {
+ start: { column: 4, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+
+ range: [4, 9],
+ loc: {
+ start: { column: 4, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [0, 10],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 10, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 11],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-without-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-without-value/snapshots/1-TSESTree-AST.shot
index d8d3f10c6e7c..0374c31feb55 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-without-value/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-without-value/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [4, 5],
loc: {
@@ -28,6 +31,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [0, 6],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-without-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-without-value/snapshots/5-AST-Alignment-AST.shot
index 8082a31f808a..7df64b552f6f 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-without-value/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-without-value/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,55 @@
exports[`AST Fixtures declaration VariableDeclaration let-without-value AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [4, 5],
+ loc: {
+ start: { column: 4, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ init: null,
+
+ range: [4, 5],
+ loc: {
+ start: { column: 4, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [0, 6],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 6, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 7],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/1-TSESTree-AST.shot
index 7b317b581213..569b7e4d6b34 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [4, 5],
loc: {
@@ -29,9 +32,12 @@ Program {
},
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "y",
+ optional: false,
range: [7, 8],
loc: {
@@ -49,9 +55,12 @@ Program {
},
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "z",
+ optional: false,
range: [10, 11],
loc: {
@@ -68,6 +77,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [0, 12],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/5-AST-Alignment-AST.shot
index 10b9167907cb..f7e6ff872f01 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,101 @@
exports[`AST Fixtures declaration VariableDeclaration multiple-declarations AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [4, 5],
+ loc: {
+ start: { column: 4, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ init: null,
+
+ range: [4, 5],
+ loc: {
+ start: { column: 4, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'y',
+- optional: false,
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ init: null,
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'z',
+- optional: false,
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ init: null,
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ 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/VariableDeclaration/fixtures/var-with-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-with-value/snapshots/1-TSESTree-AST.shot
index dd577b588dea..a0dc5de12b90 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-with-value/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-with-value/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [4, 5],
loc: {
@@ -38,6 +41,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [0, 10],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-with-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-with-value/snapshots/5-AST-Alignment-AST.shot
index b107c9499d49..f9ec50b22b43 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-with-value/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-with-value/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,65 @@
exports[`AST Fixtures declaration VariableDeclaration var-with-value AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [4, 5],
+ loc: {
+ start: { column: 4, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+
+ range: [4, 9],
+ loc: {
+ start: { column: 4, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [0, 10],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 10, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 11],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-without-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-without-value/snapshots/1-TSESTree-AST.shot
index 384ae11b3642..9c8cd46cb971 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-without-value/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-without-value/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [4, 5],
loc: {
@@ -28,6 +31,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [0, 6],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-without-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-without-value/snapshots/5-AST-Alignment-AST.shot
index b8594239a06c..af47a7b5819f 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-without-value/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/var-without-value/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,55 @@
exports[`AST Fixtures declaration VariableDeclaration var-without-value AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [4, 5],
+ loc: {
+ start: { column: 4, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ init: null,
+
+ range: [4, 5],
+ loc: {
+ start: { column: 4, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [0, 6],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 6, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 7],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts b/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts
index 4bc9b0f48541..70ed40f52e62 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts
@@ -20,8 +20,7 @@ export interface VariableDeclaration extends BaseNode {
* declare const x = 1;
* ```
*/
- // TODO(#5020) - make this `false` if it is not `declare`d
- declare?: boolean;
+ declare: boolean;
/**
* The keyword used to declare the variable(s)
* ```
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/fixture.ts
similarity index 100%
rename from packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture.ts
rename to packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/fixture.ts
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..f314b35255b9
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-abstract-accessor-with-value Babel - Error 1`] = `"NO ERROR"`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..77e891766dfc
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-abstract-accessor-with-value TSESTree - Error 1`] = `
+"TSError
+ 1 | abstract class Foo {
+> 2 | abstract accessor foo: number = 1;
+ | ^ Abstract property cannot have an initializer.
+ 3 | }
+ 4 |"
+`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..4e826d92c94c
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-abstract-accessor-with-value Error Alignment 1`] = `"No errors"`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..f314b35255b9
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-abstract-accessor-with-value Babel - Error 1`] = `"NO ERROR"`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..f248419e4f7c
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-abstract-accessor-with-value Error Alignment 1`] = `"TSESTree errored but Babel didn't"`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/fixture.ts
new file mode 100644
index 000000000000..de0095c35315
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ abstract property = 1;
+}
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..24fbc9009898
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-abstract-property-with-value Babel - Error 1`] = `[SyntaxError: Property 'property' cannot have an initializer because it is marked abstract. (2:20)]`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..8fc5278de62d
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-abstract-property-with-value TSESTree - Error 1`] = `
+"TSError
+ 1 | abstract class Foo {
+> 2 | abstract property = 1;
+ | ^ Abstract property cannot have an initializer.
+ 3 | }
+ 4 |"
+`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..7e77cd5d46e8
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-abstract-property-with-value Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..24fbc9009898
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-abstract-property-with-value Babel - Error 1`] = `[SyntaxError: Property 'property' cannot have an initializer because it is marked abstract. (2:20)]`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..137837e3e8ff
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-abstract-property-with-value Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..071d521919f4
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-override-with-no-extends Babel - Error 1`] = `[SyntaxError: This member cannot have an 'override' modifier because its containing class does not extend another class. (2:2)]`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..27d6eef74b02
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures element AccessorProperty _error_ modifier-override-with-no-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/fixture.ts
index 5dc28758b4e5..673c8d7991fc 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/fixture.ts
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/fixture.ts
@@ -1,3 +1,3 @@
class Foo {
- accessor 1 = 2;
+ accessor [1 + 1] = 2;
}
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/1-TSESTree-AST.shot
index 8545a8f1b73d..2ecff14d0fc6 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/1-TSESTree-AST.shot
@@ -6,55 +6,85 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
AccessorProperty {
type: "AccessorProperty",
- computed: false,
+ computed: true,
declare: false,
- key: Literal {
- type: "Literal",
- raw: "1",
- value: 1,
+ decorators: [],
+ definite: false,
+ key: BinaryExpression {
+ type: "BinaryExpression",
+ left: Literal {
+ type: "Literal",
+ raw: "1",
+ value: 1,
+
+ range: [24, 25],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 13, line: 2 },
+ },
+ },
+ operator: "+",
+ right: Literal {
+ type: "Literal",
+ raw: "1",
+ value: 1,
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
- range: [23, 24],
+ range: [24, 29],
loc: {
- start: { column: 11, line: 2 },
- end: { column: 12, line: 2 },
+ start: { column: 12, line: 2 },
+ end: { column: 17, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
raw: "2",
value: 2,
- range: [27, 28],
+ range: [33, 34],
loc: {
- start: { column: 15, line: 2 },
- end: { column: 16, line: 2 },
+ start: { column: 21, line: 2 },
+ end: { column: 22, line: 2 },
},
},
- range: [14, 29],
+ range: [14, 35],
loc: {
start: { column: 2, line: 2 },
- end: { column: 17, line: 2 },
+ end: { column: 23, line: 2 },
},
},
],
- range: [10, 31],
+ range: [10, 37],
loc: {
start: { column: 10, line: 1 },
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -62,9 +92,10 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
- range: [0, 31],
+ range: [0, 37],
loc: {
start: { column: 0, line: 1 },
end: { column: 1, line: 3 },
@@ -73,7 +104,7 @@ Program {
],
sourceType: "script",
- range: [0, 32],
+ range: [0, 38],
loc: {
start: { column: 0, line: 1 },
end: { column: 0, line: 4 },
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/2-TSESTree-Tokens.shot
index 897c1151ab24..a208741af8b5 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/2-TSESTree-Tokens.shot
@@ -42,9 +42,9 @@ exports[`AST Fixtures element AccessorProperty key-computed-complex TSESTree - T
end: { column: 10, line: 2 },
},
},
- Numeric {
- type: "Numeric",
- value: "1",
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
range: [23, 24],
loc: {
@@ -52,41 +52,81 @@ exports[`AST Fixtures element AccessorProperty key-computed-complex TSESTree - T
end: { column: 12, line: 2 },
},
},
+ Numeric {
+ type: "Numeric",
+ value: "1",
+
+ range: [24, 25],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 13, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "+",
+
+ range: [26, 27],
+ loc: {
+ start: { column: 14, line: 2 },
+ end: { column: 15, line: 2 },
+ },
+ },
+ Numeric {
+ type: "Numeric",
+ value: "1",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 17, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
Punctuator {
type: "Punctuator",
value: "=",
- range: [25, 26],
+ range: [31, 32],
loc: {
- start: { column: 13, line: 2 },
- end: { column: 14, line: 2 },
+ start: { column: 19, line: 2 },
+ end: { column: 20, line: 2 },
},
},
Numeric {
type: "Numeric",
value: "2",
- range: [27, 28],
+ range: [33, 34],
loc: {
- start: { column: 15, line: 2 },
- end: { column: 16, line: 2 },
+ start: { column: 21, line: 2 },
+ end: { column: 22, line: 2 },
},
},
Punctuator {
type: "Punctuator",
value: ";",
- range: [28, 29],
+ range: [34, 35],
loc: {
- start: { column: 16, line: 2 },
- end: { column: 17, line: 2 },
+ start: { column: 22, line: 2 },
+ end: { column: 23, line: 2 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [30, 31],
+ range: [36, 37],
loc: {
start: { column: 0, line: 3 },
end: { column: 1, line: 3 },
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/3-Babel-AST.shot
index d26beba12713..634745596766 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/3-Babel-AST.shot
@@ -11,16 +11,37 @@ Program {
body: [
ClassAccessorProperty {
type: "ClassAccessorProperty",
- computed: false,
- key: Literal {
- type: "Literal",
- raw: "1",
- value: 1,
+ computed: true,
+ key: BinaryExpression {
+ type: "BinaryExpression",
+ left: Literal {
+ type: "Literal",
+ raw: "1",
+ value: 1,
+
+ range: [24, 25],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 13, line: 2 },
+ },
+ },
+ operator: "+",
+ right: Literal {
+ type: "Literal",
+ raw: "1",
+ value: 1,
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
- range: [23, 24],
+ range: [24, 29],
loc: {
- start: { column: 11, line: 2 },
- end: { column: 12, line: 2 },
+ start: { column: 12, line: 2 },
+ end: { column: 17, line: 2 },
},
},
static: false,
@@ -29,22 +50,22 @@ Program {
raw: "2",
value: 2,
- range: [27, 28],
+ range: [33, 34],
loc: {
- start: { column: 15, line: 2 },
- end: { column: 16, line: 2 },
+ start: { column: 21, line: 2 },
+ end: { column: 22, line: 2 },
},
},
- range: [14, 29],
+ range: [14, 35],
loc: {
start: { column: 2, line: 2 },
- end: { column: 17, line: 2 },
+ end: { column: 23, line: 2 },
},
},
],
- range: [10, 31],
+ range: [10, 37],
loc: {
start: { column: 10, line: 1 },
end: { column: 1, line: 3 },
@@ -62,7 +83,7 @@ Program {
},
superClass: null,
- range: [0, 31],
+ range: [0, 37],
loc: {
start: { column: 0, line: 1 },
end: { column: 1, line: 3 },
@@ -71,7 +92,7 @@ Program {
],
sourceType: "script",
- range: [0, 32],
+ range: [0, 38],
loc: {
start: { column: 0, line: 1 },
end: { column: 0, line: 4 },
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/4-Babel-Tokens.shot
index 4a6b377b0926..97f643020bda 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/4-Babel-Tokens.shot
@@ -42,9 +42,9 @@ exports[`AST Fixtures element AccessorProperty key-computed-complex Babel - Toke
end: { column: 10, line: 2 },
},
},
- Numeric {
- type: "Numeric",
- value: "1",
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
range: [23, 24],
loc: {
@@ -52,41 +52,81 @@ exports[`AST Fixtures element AccessorProperty key-computed-complex Babel - Toke
end: { column: 12, line: 2 },
},
},
+ Numeric {
+ type: "Numeric",
+ value: "1",
+
+ range: [24, 25],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 13, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "+",
+
+ range: [26, 27],
+ loc: {
+ start: { column: 14, line: 2 },
+ end: { column: 15, line: 2 },
+ },
+ },
+ Numeric {
+ type: "Numeric",
+ value: "1",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 17, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
Punctuator {
type: "Punctuator",
value: "=",
- range: [25, 26],
+ range: [31, 32],
loc: {
- start: { column: 13, line: 2 },
- end: { column: 14, line: 2 },
+ start: { column: 19, line: 2 },
+ end: { column: 20, line: 2 },
},
},
Numeric {
type: "Numeric",
value: "2",
- range: [27, 28],
+ range: [33, 34],
loc: {
- start: { column: 15, line: 2 },
- end: { column: 16, line: 2 },
+ start: { column: 21, line: 2 },
+ end: { column: 22, line: 2 },
},
},
Punctuator {
type: "Punctuator",
value: ";",
- range: [28, 29],
+ range: [34, 35],
loc: {
- start: { column: 16, line: 2 },
- end: { column: 17, line: 2 },
+ start: { column: 22, line: 2 },
+ end: { column: 23, line: 2 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [30, 31],
+ range: [36, 37],
loc: {
start: { column: 0, line: 3 },
end: { column: 1, line: 3 },
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/5-AST-Alignment-AST.shot
index b6b30dd18c6c..32c9bea08d3b 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty key-computed-complex AST Alignmen
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,50 +18,79 @@ exports[`AST Fixtures element AccessorProperty key-computed-complex AST Alignmen
- type: 'AccessorProperty',
+ ClassAccessorProperty {
+ type: 'ClassAccessorProperty',
- computed: false,
+ computed: true,
- declare: false,
- key: Literal {
- type: 'Literal',
- raw: '1',
- value: 1,
+- decorators: Array [],
+- definite: false,
+ key: BinaryExpression {
+ type: 'BinaryExpression',
+ left: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [24, 25],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 13, line: 2 },
+ },
+ },
+ operator: '+',
+ right: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
- range: [23, 24],
+ range: [24, 29],
loc: {
- start: { column: 11, line: 2 },
- end: { column: 12, line: 2 },
+ start: { column: 12, line: 2 },
+ end: { column: 17, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
raw: '2',
value: 2,
- range: [27, 28],
+ range: [33, 34],
loc: {
- start: { column: 15, line: 2 },
- end: { column: 16, line: 2 },
+ start: { column: 21, line: 2 },
+ end: { column: 22, line: 2 },
},
},
- range: [14, 29],
+ range: [14, 35],
loc: {
start: { column: 2, line: 2 },
- end: { column: 17, line: 2 },
+ end: { column: 23, line: 2 },
},
},
],
- range: [10, 31],
+ range: [10, 37],
loc: {
start: { column: 10, line: 1 },
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -68,9 +98,10 @@ exports[`AST Fixtures element AccessorProperty key-computed-complex AST Alignmen
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
- range: [0, 31],
+ range: [0, 37],
loc: {
start: { column: 0, line: 1 },
end: { column: 1, line: 3 },
@@ -79,7 +110,7 @@ exports[`AST Fixtures element AccessorProperty key-computed-complex AST Alignmen
],
sourceType: 'script',
- range: [0, 32],
+ range: [0, 38],
loc: {
start: { column: 0, line: 1 },
end: { column: 0, line: 4 },
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/1-TSESTree-AST.shot
index 2b3269d8cd01..903c3ee2140a 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,6 +14,8 @@ Program {
type: "AccessorProperty",
computed: true,
declare: false,
+ decorators: [],
+ definite: false,
key: Literal {
type: "Literal",
raw: "1",
@@ -24,7 +27,9 @@ Program {
end: { column: 13, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -52,9 +57,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -62,6 +71,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 33],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/5-AST-Alignment-AST.shot
index bd3b115af807..f4e4e3be0f25 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty key-computed-number AST Alignment
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,6 +20,8 @@ exports[`AST Fixtures element AccessorProperty key-computed-number AST Alignment
+ type: 'ClassAccessorProperty',
computed: true,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Literal {
type: 'Literal',
raw: '1',
@@ -30,7 +33,9 @@ exports[`AST Fixtures element AccessorProperty key-computed-number AST Alignment
end: { column: 13, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -58,9 +63,13 @@ exports[`AST Fixtures element AccessorProperty key-computed-number AST Alignment
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -68,6 +77,7 @@ exports[`AST Fixtures element AccessorProperty key-computed-number AST Alignment
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 33],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/1-TSESTree-AST.shot
index b19f7768a48f..1ea0bf7cc104 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,6 +14,8 @@ Program {
type: "AccessorProperty",
computed: true,
declare: false,
+ decorators: [],
+ definite: false,
key: Literal {
type: "Literal",
raw: "'prop'",
@@ -24,7 +27,9 @@ Program {
end: { column: 18, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -52,9 +57,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -62,6 +71,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 44],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/5-AST-Alignment-AST.shot
index 0cbe6bb62c4b..580ab471f030 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty key-computed-string AST Alignment
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,6 +20,8 @@ exports[`AST Fixtures element AccessorProperty key-computed-string AST Alignment
+ type: 'ClassAccessorProperty',
computed: true,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Literal {
type: 'Literal',
raw: '\\'prop\\'',
@@ -30,7 +33,9 @@ exports[`AST Fixtures element AccessorProperty key-computed-string AST Alignment
end: { column: 18, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -58,9 +63,13 @@ exports[`AST Fixtures element AccessorProperty key-computed-string AST Alignment
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -68,6 +77,7 @@ exports[`AST Fixtures element AccessorProperty key-computed-string AST Alignment
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 44],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/fixture.ts
index e69de29bb2d1..5dc28758b4e5 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/fixture.ts
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ accessor 1 = 2;
+}
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/1-TSESTree-AST.shot
index c1024f115037..0d55a562b179 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/1-TSESTree-AST.shot
@@ -3,13 +3,90 @@
exports[`AST Fixtures element AccessorProperty key-number TSESTree - AST 1`] = `
Program {
type: "Program",
- body: [],
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ AccessorProperty {
+ type: "AccessorProperty",
+ computed: false,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Literal {
+ type: "Literal",
+ raw: "1",
+ value: 1,
+
+ range: [23, 24],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: Literal {
+ type: "Literal",
+ raw: "2",
+ value: 2,
+
+ range: [27, 28],
+ loc: {
+ start: { column: 15, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+
+ range: [14, 29],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 31],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 31],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
sourceType: "script",
- range: [0, 0],
+ range: [0, 32],
loc: {
start: { column: 0, line: 1 },
- end: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
},
}
`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/2-TSESTree-Tokens.shot
index ec11bb8381dd..b4eb3d8a7151 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/2-TSESTree-Tokens.shot
@@ -1,3 +1,96 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures element AccessorProperty key-number TSESTree - Tokens 1`] = `[]`;
+exports[`AST Fixtures element AccessorProperty key-number TSESTree - Tokens 1`] = `
+[
+ 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 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "accessor",
+
+ range: [14, 22],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 10, line: 2 },
+ },
+ },
+ Numeric {
+ type: "Numeric",
+ value: "1",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [25, 26],
+ loc: {
+ start: { column: 13, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ Numeric {
+ type: "Numeric",
+ value: "2",
+
+ range: [27, 28],
+ loc: {
+ start: { column: 15, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [30, 31],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/3-Babel-AST.shot
index 96f034cf05c3..a0583eeb7cf9 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/3-Babel-AST.shot
@@ -3,13 +3,78 @@
exports[`AST Fixtures element AccessorProperty key-number Babel - AST 1`] = `
Program {
type: "Program",
- body: [],
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ ClassAccessorProperty {
+ type: "ClassAccessorProperty",
+ computed: false,
+ key: Literal {
+ type: "Literal",
+ raw: "1",
+ value: 1,
+
+ range: [23, 24],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ static: false,
+ value: Literal {
+ type: "Literal",
+ raw: "2",
+ value: 2,
+
+ range: [27, 28],
+ loc: {
+ start: { column: 15, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+
+ range: [14, 29],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 31],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ superClass: null,
+
+ range: [0, 31],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
sourceType: "script",
- range: [0, 0],
+ range: [0, 32],
loc: {
start: { column: 0, line: 1 },
- end: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
},
}
`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/4-Babel-Tokens.shot
index 0a1c0c86992f..599d99fb007a 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/4-Babel-Tokens.shot
@@ -1,3 +1,96 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures element AccessorProperty key-number Babel - Tokens 1`] = `[]`;
+exports[`AST Fixtures element AccessorProperty key-number Babel - Tokens 1`] = `
+[
+ 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 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "accessor",
+
+ range: [14, 22],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 10, line: 2 },
+ },
+ },
+ Numeric {
+ type: "Numeric",
+ value: "1",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [25, 26],
+ loc: {
+ start: { column: 13, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ Numeric {
+ type: "Numeric",
+ value: "2",
+
+ range: [27, 28],
+ loc: {
+ start: { column: 15, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [30, 31],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/5-AST-Alignment-AST.shot
index 55fd7a3d4754..632c9be206b3 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,97 @@
exports[`AST Fixtures element AccessorProperty key-number AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [
+- AccessorProperty {
+- type: 'AccessorProperty',
++ ClassAccessorProperty {
++ type: 'ClassAccessorProperty',
+ computed: false,
+- declare: false,
+- decorators: Array [],
+- definite: false,
+ key: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [23, 24],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+- optional: false,
+- override: false,
+- readonly: false,
+ static: false,
+ value: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [27, 28],
+ loc: {
+ start: { column: 15, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+
+ range: [14, 29],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 31],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+- implements: Array [],
+ superClass: null,
+
+ range: [0, 31],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/1-TSESTree-AST.shot
index 26abb22016e6..d3096826ba06 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,6 +14,8 @@ Program {
type: "AccessorProperty",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: PrivateIdentifier {
type: "PrivateIdentifier",
name: "foo",
@@ -23,7 +26,9 @@ Program {
end: { column: 15, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -51,9 +56,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -61,6 +70,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 34],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/5-AST-Alignment-AST.shot
index 100c519c06c4..78ff86db8594 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty key-private AST Alignment - AST 1
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,6 +20,8 @@ exports[`AST Fixtures element AccessorProperty key-private AST Alignment - AST 1
+ type: 'ClassAccessorProperty',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: PrivateIdentifier {
type: 'PrivateIdentifier',
name: 'foo',
@@ -29,7 +32,9 @@ exports[`AST Fixtures element AccessorProperty key-private AST Alignment - AST 1
end: { column: 15, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -57,9 +62,13 @@ exports[`AST Fixtures element AccessorProperty key-private AST Alignment - AST 1
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -67,6 +76,7 @@ exports[`AST Fixtures element AccessorProperty key-private AST Alignment - AST 1
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 34],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/fixture.ts
index 808470d5b6ad..1a96d899ee8e 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/fixture.ts
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/fixture.ts
@@ -1,3 +1,3 @@
class Foo {
- accessor 'prop' = 'value';
+ accessor 'quoted-prop' = 'value';
}
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/1-TSESTree-AST.shot
index 0cc093d094f6..8534f85e05cd 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,48 +14,56 @@ Program {
type: "AccessorProperty",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Literal {
type: "Literal",
- raw: "'prop'",
- value: "prop",
+ raw: "'quoted-prop'",
+ value: "quoted-prop",
- range: [23, 29],
+ range: [23, 36],
loc: {
start: { column: 11, line: 2 },
- end: { column: 17, line: 2 },
+ end: { column: 24, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
raw: "'value'",
value: "value",
- range: [32, 39],
+ range: [39, 46],
loc: {
- start: { column: 20, line: 2 },
- end: { column: 27, line: 2 },
+ start: { column: 27, line: 2 },
+ end: { column: 34, line: 2 },
},
},
- range: [14, 40],
+ range: [14, 47],
loc: {
start: { column: 2, line: 2 },
- end: { column: 28, line: 2 },
+ end: { column: 35, line: 2 },
},
},
],
- range: [10, 42],
+ range: [10, 49],
loc: {
start: { column: 10, line: 1 },
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -62,9 +71,10 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
- range: [0, 42],
+ range: [0, 49],
loc: {
start: { column: 0, line: 1 },
end: { column: 1, line: 3 },
@@ -73,7 +83,7 @@ Program {
],
sourceType: "script",
- range: [0, 43],
+ range: [0, 50],
loc: {
start: { column: 0, line: 1 },
end: { column: 0, line: 4 },
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/2-TSESTree-Tokens.shot
index 2afc4cac40a4..9b9176fa61e9 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/2-TSESTree-Tokens.shot
@@ -44,49 +44,49 @@ exports[`AST Fixtures element AccessorProperty key-string TSESTree - Tokens 1`]
},
String {
type: "String",
- value: "'prop'",
+ value: "'quoted-prop'",
- range: [23, 29],
+ range: [23, 36],
loc: {
start: { column: 11, line: 2 },
- end: { column: 17, line: 2 },
+ end: { column: 24, line: 2 },
},
},
Punctuator {
type: "Punctuator",
value: "=",
- range: [30, 31],
+ range: [37, 38],
loc: {
- start: { column: 18, line: 2 },
- end: { column: 19, line: 2 },
+ start: { column: 25, line: 2 },
+ end: { column: 26, line: 2 },
},
},
String {
type: "String",
value: "'value'",
- range: [32, 39],
+ range: [39, 46],
loc: {
- start: { column: 20, line: 2 },
- end: { column: 27, line: 2 },
+ start: { column: 27, line: 2 },
+ end: { column: 34, line: 2 },
},
},
Punctuator {
type: "Punctuator",
value: ";",
- range: [39, 40],
+ range: [46, 47],
loc: {
- start: { column: 27, line: 2 },
- end: { column: 28, line: 2 },
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [41, 42],
+ range: [48, 49],
loc: {
start: { column: 0, line: 3 },
end: { column: 1, line: 3 },
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/3-Babel-AST.shot
index 1d213162cd91..1f5f801f0a05 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/3-Babel-AST.shot
@@ -14,13 +14,13 @@ Program {
computed: false,
key: Literal {
type: "Literal",
- raw: "'prop'",
- value: "prop",
+ raw: "'quoted-prop'",
+ value: "quoted-prop",
- range: [23, 29],
+ range: [23, 36],
loc: {
start: { column: 11, line: 2 },
- end: { column: 17, line: 2 },
+ end: { column: 24, line: 2 },
},
},
static: false,
@@ -29,22 +29,22 @@ Program {
raw: "'value'",
value: "value",
- range: [32, 39],
+ range: [39, 46],
loc: {
- start: { column: 20, line: 2 },
- end: { column: 27, line: 2 },
+ start: { column: 27, line: 2 },
+ end: { column: 34, line: 2 },
},
},
- range: [14, 40],
+ range: [14, 47],
loc: {
start: { column: 2, line: 2 },
- end: { column: 28, line: 2 },
+ end: { column: 35, line: 2 },
},
},
],
- range: [10, 42],
+ range: [10, 49],
loc: {
start: { column: 10, line: 1 },
end: { column: 1, line: 3 },
@@ -62,7 +62,7 @@ Program {
},
superClass: null,
- range: [0, 42],
+ range: [0, 49],
loc: {
start: { column: 0, line: 1 },
end: { column: 1, line: 3 },
@@ -71,7 +71,7 @@ Program {
],
sourceType: "script",
- range: [0, 43],
+ range: [0, 50],
loc: {
start: { column: 0, line: 1 },
end: { column: 0, line: 4 },
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/4-Babel-Tokens.shot
index b3c3aa19faba..4f18e3e31725 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/4-Babel-Tokens.shot
@@ -44,49 +44,49 @@ exports[`AST Fixtures element AccessorProperty key-string Babel - Tokens 1`] = `
},
String {
type: "String",
- value: "'prop'",
+ value: "'quoted-prop'",
- range: [23, 29],
+ range: [23, 36],
loc: {
start: { column: 11, line: 2 },
- end: { column: 17, line: 2 },
+ end: { column: 24, line: 2 },
},
},
Punctuator {
type: "Punctuator",
value: "=",
- range: [30, 31],
+ range: [37, 38],
loc: {
- start: { column: 18, line: 2 },
- end: { column: 19, line: 2 },
+ start: { column: 25, line: 2 },
+ end: { column: 26, line: 2 },
},
},
String {
type: "String",
value: "'value'",
- range: [32, 39],
+ range: [39, 46],
loc: {
- start: { column: 20, line: 2 },
- end: { column: 27, line: 2 },
+ start: { column: 27, line: 2 },
+ end: { column: 34, line: 2 },
},
},
Punctuator {
type: "Punctuator",
value: ";",
- range: [39, 40],
+ range: [46, 47],
loc: {
- start: { column: 27, line: 2 },
- end: { column: 28, line: 2 },
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [41, 42],
+ range: [48, 49],
loc: {
start: { column: 0, line: 3 },
end: { column: 1, line: 3 },
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/5-AST-Alignment-AST.shot
index 79f2d5ffd632..fa04c5159f04 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty key-string AST Alignment - AST 1`
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,48 +20,56 @@ exports[`AST Fixtures element AccessorProperty key-string AST Alignment - AST 1`
+ type: 'ClassAccessorProperty',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Literal {
type: 'Literal',
- raw: '\\'prop\\'',
- value: 'prop',
+ raw: '\\'quoted-prop\\'',
+ value: 'quoted-prop',
- range: [23, 29],
+ range: [23, 36],
loc: {
start: { column: 11, line: 2 },
- end: { column: 17, line: 2 },
+ end: { column: 24, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
raw: '\\'value\\'',
value: 'value',
- range: [32, 39],
+ range: [39, 46],
loc: {
- start: { column: 20, line: 2 },
- end: { column: 27, line: 2 },
+ start: { column: 27, line: 2 },
+ end: { column: 34, line: 2 },
},
},
- range: [14, 40],
+ range: [14, 47],
loc: {
start: { column: 2, line: 2 },
- end: { column: 28, line: 2 },
+ end: { column: 35, line: 2 },
},
},
],
- range: [10, 42],
+ range: [10, 49],
loc: {
start: { column: 10, line: 1 },
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -68,9 +77,10 @@ exports[`AST Fixtures element AccessorProperty key-string AST Alignment - AST 1`
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
- range: [0, 42],
+ range: [0, 49],
loc: {
start: { column: 0, line: 1 },
end: { column: 1, line: 3 },
@@ -79,7 +89,7 @@ exports[`AST Fixtures element AccessorProperty key-string AST Alignment - AST 1`
],
sourceType: 'script',
- range: [0, 43],
+ range: [0, 50],
loc: {
start: { column: 0, line: 1 },
end: { column: 0, line: 4 },
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/1-TSESTree-AST.shot
deleted file mode 100644
index 75bdc0edd24a..000000000000
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/1-TSESTree-AST.shot
+++ /dev/null
@@ -1,90 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value TSESTree - AST 1`] = `
-Program {
- type: "Program",
- body: [
- ClassDeclaration {
- type: "ClassDeclaration",
- abstract: true,
- body: ClassBody {
- type: "ClassBody",
- body: [
- TSAbstractAccessorProperty {
- type: "TSAbstractAccessorProperty",
- computed: false,
- declare: false,
- key: Identifier {
- type: "Identifier",
- name: "foo",
-
- range: [41, 44],
- loc: {
- start: { column: 20, line: 2 },
- end: { column: 23, line: 2 },
- },
- },
- override: false,
- static: false,
- typeAnnotation: TSTypeAnnotation {
- type: "TSTypeAnnotation",
- typeAnnotation: TSNumberKeyword {
- type: "TSNumberKeyword",
-
- range: [46, 52],
- loc: {
- start: { column: 25, line: 2 },
- end: { column: 31, line: 2 },
- },
- },
-
- range: [44, 52],
- loc: {
- start: { column: 23, line: 2 },
- end: { column: 31, line: 2 },
- },
- },
- value: null,
-
- range: [23, 57],
- loc: {
- start: { column: 2, line: 2 },
- end: { column: 36, line: 2 },
- },
- },
- ],
-
- range: [19, 59],
- loc: {
- start: { column: 19, line: 1 },
- end: { column: 1, line: 3 },
- },
- },
- id: Identifier {
- type: "Identifier",
- name: "Foo",
-
- range: [15, 18],
- loc: {
- start: { column: 15, line: 1 },
- end: { column: 18, line: 1 },
- },
- },
- superClass: null,
-
- range: [0, 59],
- loc: {
- start: { column: 0, line: 1 },
- end: { column: 1, line: 3 },
- },
- },
- ],
- sourceType: "script",
-
- range: [0, 60],
- loc: {
- start: { column: 0, line: 1 },
- end: { column: 0, line: 4 },
- },
-}
-`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/2-TSESTree-Tokens.shot
deleted file mode 100644
index 52b20d043688..000000000000
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/2-TSESTree-Tokens.shot
+++ /dev/null
@@ -1,136 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value TSESTree - Tokens 1`] = `
-[
- 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 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "abstract",
-
- range: [23, 31],
- loc: {
- start: { column: 2, line: 2 },
- end: { column: 10, line: 2 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "accessor",
-
- range: [32, 40],
- loc: {
- start: { column: 11, line: 2 },
- end: { column: 19, line: 2 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "foo",
-
- range: [41, 44],
- loc: {
- start: { column: 20, line: 2 },
- end: { column: 23, line: 2 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ":",
-
- range: [44, 45],
- loc: {
- start: { column: 23, line: 2 },
- end: { column: 24, line: 2 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "number",
-
- range: [46, 52],
- loc: {
- start: { column: 25, line: 2 },
- end: { column: 31, line: 2 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "=",
-
- range: [53, 54],
- loc: {
- start: { column: 32, line: 2 },
- end: { column: 33, line: 2 },
- },
- },
- Numeric {
- type: "Numeric",
- value: "1",
-
- range: [55, 56],
- loc: {
- start: { column: 34, line: 2 },
- end: { column: 35, line: 2 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ";",
-
- range: [56, 57],
- loc: {
- start: { column: 35, line: 2 },
- end: { column: 36, line: 2 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "}",
-
- range: [58, 59],
- loc: {
- start: { column: 0, line: 3 },
- end: { column: 1, line: 3 },
- },
- },
-]
-`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/3-Babel-AST.shot
deleted file mode 100644
index 94c61988d3ba..000000000000
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/3-Babel-AST.shot
+++ /dev/null
@@ -1,99 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value Babel - AST 1`] = `
-Program {
- type: "Program",
- body: [
- ClassDeclaration {
- type: "ClassDeclaration",
- abstract: true,
- body: ClassBody {
- type: "ClassBody",
- body: [
- ClassAccessorProperty {
- type: "ClassAccessorProperty",
- abstract: true,
- computed: false,
- key: Identifier {
- type: "Identifier",
- name: "foo",
-
- range: [41, 44],
- loc: {
- start: { column: 20, line: 2 },
- end: { column: 23, line: 2 },
- },
- },
- static: false,
- typeAnnotation: TSTypeAnnotation {
- type: "TSTypeAnnotation",
- typeAnnotation: TSNumberKeyword {
- type: "TSNumberKeyword",
-
- range: [46, 52],
- loc: {
- start: { column: 25, line: 2 },
- end: { column: 31, line: 2 },
- },
- },
-
- range: [44, 52],
- loc: {
- start: { column: 23, line: 2 },
- end: { column: 31, line: 2 },
- },
- },
- value: Literal {
- type: "Literal",
- raw: "1",
- value: 1,
-
- range: [55, 56],
- loc: {
- start: { column: 34, line: 2 },
- end: { column: 35, line: 2 },
- },
- },
-
- range: [23, 57],
- loc: {
- start: { column: 2, line: 2 },
- end: { column: 36, line: 2 },
- },
- },
- ],
-
- range: [19, 59],
- loc: {
- start: { column: 19, line: 1 },
- end: { column: 1, line: 3 },
- },
- },
- id: Identifier {
- type: "Identifier",
- name: "Foo",
-
- range: [15, 18],
- loc: {
- start: { column: 15, line: 1 },
- end: { column: 18, line: 1 },
- },
- },
- superClass: null,
-
- range: [0, 59],
- loc: {
- start: { column: 0, line: 1 },
- end: { column: 1, line: 3 },
- },
- },
- ],
- sourceType: "script",
-
- range: [0, 60],
- loc: {
- start: { column: 0, line: 1 },
- end: { column: 0, line: 4 },
- },
-}
-`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/4-Babel-Tokens.shot
deleted file mode 100644
index ee7c1781984f..000000000000
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/4-Babel-Tokens.shot
+++ /dev/null
@@ -1,136 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value Babel - Tokens 1`] = `
-[
- 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 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "abstract",
-
- range: [23, 31],
- loc: {
- start: { column: 2, line: 2 },
- end: { column: 10, line: 2 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "accessor",
-
- range: [32, 40],
- loc: {
- start: { column: 11, line: 2 },
- end: { column: 19, line: 2 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "foo",
-
- range: [41, 44],
- loc: {
- start: { column: 20, line: 2 },
- end: { column: 23, line: 2 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ":",
-
- range: [44, 45],
- loc: {
- start: { column: 23, line: 2 },
- end: { column: 24, line: 2 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "number",
-
- range: [46, 52],
- loc: {
- start: { column: 25, line: 2 },
- end: { column: 31, line: 2 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "=",
-
- range: [53, 54],
- loc: {
- start: { column: 32, line: 2 },
- end: { column: 33, line: 2 },
- },
- },
- Numeric {
- type: "Numeric",
- value: "1",
-
- range: [55, 56],
- loc: {
- start: { column: 34, line: 2 },
- end: { column: 35, line: 2 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ";",
-
- range: [56, 57],
- loc: {
- start: { column: 35, line: 2 },
- end: { column: 36, line: 2 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "}",
-
- range: [58, 59],
- loc: {
- start: { column: 0, line: 3 },
- end: { column: 1, line: 3 },
- },
- },
-]
-`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/5-AST-Alignment-AST.shot
deleted file mode 100644
index 27b36ea8b183..000000000000
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/5-AST-Alignment-AST.shot
+++ /dev/null
@@ -1,108 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value AST Alignment - AST 1`] = `
-"Snapshot Diff:
-- TSESTree
-+ Babel
-
- Program {
- type: 'Program',
- body: Array [
- ClassDeclaration {
- type: 'ClassDeclaration',
- abstract: true,
- body: ClassBody {
- type: 'ClassBody',
- body: Array [
-- TSAbstractAccessorProperty {
-- type: 'TSAbstractAccessorProperty',
-+ ClassAccessorProperty {
-+ type: 'ClassAccessorProperty',
-+ abstract: true,
- computed: false,
-- declare: false,
- key: Identifier {
- type: 'Identifier',
- name: 'foo',
-
- range: [41, 44],
- loc: {
- start: { column: 20, line: 2 },
- end: { column: 23, line: 2 },
- },
- },
-- override: false,
- static: false,
- typeAnnotation: TSTypeAnnotation {
- type: 'TSTypeAnnotation',
- typeAnnotation: TSNumberKeyword {
- type: 'TSNumberKeyword',
-
- range: [46, 52],
- loc: {
- start: { column: 25, line: 2 },
- end: { column: 31, line: 2 },
- },
- },
-
- range: [44, 52],
- loc: {
- start: { column: 23, line: 2 },
- end: { column: 31, line: 2 },
- },
- },
-- value: null,
-+ value: Literal {
-+ type: 'Literal',
-+ raw: '1',
-+ value: 1,
-+
-+ range: [55, 56],
-+ loc: {
-+ start: { column: 34, line: 2 },
-+ end: { column: 35, line: 2 },
-+ },
-+ },
-
- range: [23, 57],
- loc: {
- start: { column: 2, line: 2 },
- end: { column: 36, line: 2 },
- },
- },
- ],
-
- range: [19, 59],
- loc: {
- start: { column: 19, line: 1 },
- end: { column: 1, line: 3 },
- },
- },
- id: Identifier {
- type: 'Identifier',
- name: 'Foo',
-
- range: [15, 18],
- loc: {
- start: { column: 15, line: 1 },
- end: { column: 18, line: 1 },
- },
- },
- superClass: null,
-
- range: [0, 59],
- loc: {
- start: { column: 0, line: 1 },
- end: { column: 1, line: 3 },
- },
- },
- ],
- sourceType: 'script',
-
- range: [0, 60],
- loc: {
- start: { column: 0, line: 1 },
- end: { column: 0, line: 4 },
- },
- }"
-`;
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/1-TSESTree-AST.shot
index 41f1a89bdc74..4bb778c38dd3 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/1-TSESTree-AST.shot
@@ -14,9 +14,13 @@ Program {
type: "TSAbstractAccessorProperty",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [41, 44],
loc: {
@@ -24,7 +28,9 @@ Program {
end: { column: 23, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -60,9 +66,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [15, 18],
loc: {
@@ -70,6 +80,7 @@ Program {
end: { column: 18, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 55],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/5-AST-Alignment-AST.shot
index cecb46eb91fd..b5860513edf6 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/5-AST-Alignment-AST.shot
@@ -21,9 +21,13 @@ exports[`AST Fixtures element AccessorProperty modifier-abstract AST Alignment -
+ abstract: true,
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [41, 44],
loc: {
@@ -31,7 +35,9 @@ exports[`AST Fixtures element AccessorProperty modifier-abstract AST Alignment -
end: { column: 23, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -67,9 +73,13 @@ exports[`AST Fixtures element AccessorProperty modifier-abstract AST Alignment -
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [15, 18],
loc: {
@@ -77,6 +87,7 @@ exports[`AST Fixtures element AccessorProperty modifier-abstract AST Alignment -
end: { column: 18, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 55],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/1-TSESTree-AST.shot
index c16fab78a95d..8ca9138a75c4 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "AccessorProperty",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [31, 34],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 22, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -59,9 +66,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -69,6 +80,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 45],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/5-AST-Alignment-AST.shot
index 76e4314a3c61..806a8428363f 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty modifier-declare AST Alignment -
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,9 +20,13 @@ exports[`AST Fixtures element AccessorProperty modifier-declare AST Alignment -
+ type: 'ClassAccessorProperty',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [31, 34],
loc: {
@@ -29,7 +34,9 @@ exports[`AST Fixtures element AccessorProperty modifier-declare AST Alignment -
end: { column: 22, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -65,9 +72,13 @@ exports[`AST Fixtures element AccessorProperty modifier-declare AST Alignment -
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -75,6 +86,7 @@ exports[`AST Fixtures element AccessorProperty modifier-declare AST Alignment -
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 45],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/1-TSESTree-AST.shot
index 105774fea638..22e205327b38 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "AccessorProperty",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [44, 47],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 23, line: 2 },
},
},
+ optional: false,
override: true,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -51,9 +58,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -61,9 +72,12 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [18, 21],
loc: {
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/5-AST-Alignment-AST.shot
index 7949a056f9a6..4586e088951c 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty modifier-override AST Alignment -
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,9 +20,13 @@ exports[`AST Fixtures element AccessorProperty modifier-override AST Alignment -
+ type: 'ClassAccessorProperty',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [44, 47],
loc: {
@@ -29,7 +34,9 @@ exports[`AST Fixtures element AccessorProperty modifier-override AST Alignment -
end: { column: 23, line: 2 },
},
},
+- optional: false,
override: true,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -57,9 +64,13 @@ exports[`AST Fixtures element AccessorProperty modifier-override AST Alignment -
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -67,9 +78,12 @@ exports[`AST Fixtures element AccessorProperty modifier-override AST Alignment -
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [18, 21],
loc: {
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/1-TSESTree-AST.shot
index 0ee458fa617a..c24e007d6eb3 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -14,9 +15,13 @@ Program {
accessibility: "private",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [31, 34],
loc: {
@@ -24,7 +29,9 @@ Program {
end: { column: 22, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -52,9 +59,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -62,6 +73,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 41],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/5-AST-Alignment-AST.shot
index fd302779cf11..d3111bb3ed94 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty modifier-private AST Alignment -
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -20,9 +21,13 @@ exports[`AST Fixtures element AccessorProperty modifier-private AST Alignment -
accessibility: 'private',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [31, 34],
loc: {
@@ -30,7 +35,9 @@ exports[`AST Fixtures element AccessorProperty modifier-private AST Alignment -
end: { column: 22, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -58,9 +65,13 @@ exports[`AST Fixtures element AccessorProperty modifier-private AST Alignment -
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -68,6 +79,7 @@ exports[`AST Fixtures element AccessorProperty modifier-private AST Alignment -
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 41],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/1-TSESTree-AST.shot
index 8dd908291b3e..9a3c69f5795c 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -14,9 +15,13 @@ Program {
accessibility: "protected",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [33, 36],
loc: {
@@ -24,7 +29,9 @@ Program {
end: { column: 24, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -52,9 +59,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -62,6 +73,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 43],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/5-AST-Alignment-AST.shot
index c26ec2b5985f..821908cd72aa 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty modifier-protected AST Alignment
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -20,9 +21,13 @@ exports[`AST Fixtures element AccessorProperty modifier-protected AST Alignment
accessibility: 'protected',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [33, 36],
loc: {
@@ -30,7 +35,9 @@ exports[`AST Fixtures element AccessorProperty modifier-protected AST Alignment
end: { column: 24, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -58,9 +65,13 @@ exports[`AST Fixtures element AccessorProperty modifier-protected AST Alignment
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -68,6 +79,7 @@ exports[`AST Fixtures element AccessorProperty modifier-protected AST Alignment
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 43],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/1-TSESTree-AST.shot
index 375fcf037db1..1143bdf8ab35 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -14,9 +15,13 @@ Program {
accessibility: "public",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [30, 33],
loc: {
@@ -24,7 +29,9 @@ Program {
end: { column: 21, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -52,9 +59,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -62,6 +73,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 40],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/5-AST-Alignment-AST.shot
index 9eb4ac8ef9bf..b5c95aa74719 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty modifier-public AST Alignment - A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -20,9 +21,13 @@ exports[`AST Fixtures element AccessorProperty modifier-public AST Alignment - A
accessibility: 'public',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [30, 33],
loc: {
@@ -30,7 +35,9 @@ exports[`AST Fixtures element AccessorProperty modifier-public AST Alignment - A
end: { column: 21, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -58,9 +65,13 @@ exports[`AST Fixtures element AccessorProperty modifier-public AST Alignment - A
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -68,6 +79,7 @@ exports[`AST Fixtures element AccessorProperty modifier-public AST Alignment - A
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 40],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/1-TSESTree-AST.shot
index 1f6d0b40e2d3..926da373f7df 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "AccessorProperty",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [32, 35],
loc: {
@@ -23,6 +28,7 @@ Program {
end: { column: 23, line: 2 },
},
},
+ optional: false,
override: false,
readonly: true,
static: false,
@@ -52,9 +58,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -62,6 +72,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 42],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/5-AST-Alignment-AST.shot
index 7f48bba2e58b..1b4e86bf4f6d 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty modifier-readonly AST Alignment -
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,9 +20,13 @@ exports[`AST Fixtures element AccessorProperty modifier-readonly AST Alignment -
+ type: 'ClassAccessorProperty',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [32, 35],
loc: {
@@ -29,6 +34,7 @@ exports[`AST Fixtures element AccessorProperty modifier-readonly AST Alignment -
end: { column: 23, line: 2 },
},
},
+- optional: false,
- override: false,
readonly: true,
static: false,
@@ -58,9 +64,13 @@ exports[`AST Fixtures element AccessorProperty modifier-readonly AST Alignment -
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -68,6 +78,7 @@ exports[`AST Fixtures element AccessorProperty modifier-readonly AST Alignment -
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 42],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/1-TSESTree-AST.shot
index 2e8ce2801836..2aadec8144a9 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "AccessorProperty",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [30, 33],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 21, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: true,
value: Literal {
type: "Literal",
@@ -51,9 +58,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -61,6 +72,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 40],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/5-AST-Alignment-AST.shot
index c5c6c8589eeb..1786d8902246 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty modifier-static AST Alignment - A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,9 +20,13 @@ exports[`AST Fixtures element AccessorProperty modifier-static AST Alignment - A
+ type: 'ClassAccessorProperty',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [30, 33],
loc: {
@@ -29,7 +34,9 @@ exports[`AST Fixtures element AccessorProperty modifier-static AST Alignment - A
end: { column: 21, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: true,
value: Literal {
type: 'Literal',
@@ -57,9 +64,13 @@ exports[`AST Fixtures element AccessorProperty modifier-static AST Alignment - A
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -67,6 +78,7 @@ exports[`AST Fixtures element AccessorProperty modifier-static AST Alignment - A
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 40],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/1-TSESTree-AST.shot
index 7ee5d769dd23..8caab469b2ca 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "AccessorProperty",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
range: [23, 27],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 15, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -41,9 +48,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -51,6 +62,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 30],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/5-AST-Alignment-AST.shot
index b08e790e91d3..000f205df51c 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty no-annotation-no-value AST Alignm
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,9 +20,13 @@ exports[`AST Fixtures element AccessorProperty no-annotation-no-value AST Alignm
+ type: 'ClassAccessorProperty',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop',
+- optional: false,
range: [23, 27],
loc: {
@@ -29,7 +34,9 @@ exports[`AST Fixtures element AccessorProperty no-annotation-no-value AST Alignm
end: { column: 15, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -47,9 +54,13 @@ exports[`AST Fixtures element AccessorProperty no-annotation-no-value AST Alignm
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -57,6 +68,7 @@ exports[`AST Fixtures element AccessorProperty no-annotation-no-value AST Alignm
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 30],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/1-TSESTree-AST.shot
index e127d4593df7..52315ed9439b 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "AccessorProperty",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
range: [23, 27],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 15, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -51,9 +58,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -61,6 +72,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 38],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/5-AST-Alignment-AST.shot
index 0bc31a58020c..e676e4e254e6 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty no-annotation-with-value AST Alig
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,9 +20,13 @@ exports[`AST Fixtures element AccessorProperty no-annotation-with-value AST Alig
+ type: 'ClassAccessorProperty',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop',
+- optional: false,
range: [23, 27],
loc: {
@@ -29,7 +34,9 @@ exports[`AST Fixtures element AccessorProperty no-annotation-with-value AST Alig
end: { column: 15, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -57,9 +64,13 @@ exports[`AST Fixtures element AccessorProperty no-annotation-with-value AST Alig
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -67,6 +78,7 @@ exports[`AST Fixtures element AccessorProperty no-annotation-with-value AST Alig
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 38],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/1-TSESTree-AST.shot
index a1e4c4fac776..4941754c2d04 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "AccessorProperty",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
range: [23, 27],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 15, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -59,9 +66,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -69,6 +80,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 38],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/5-AST-Alignment-AST.shot
index d5ff97f0998b..92b38783bb6b 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty with-annotation-no-value AST Alig
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,9 +20,13 @@ exports[`AST Fixtures element AccessorProperty with-annotation-no-value AST Alig
+ type: 'ClassAccessorProperty',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop',
+- optional: false,
range: [23, 27],
loc: {
@@ -29,7 +34,9 @@ exports[`AST Fixtures element AccessorProperty with-annotation-no-value AST Alig
end: { column: 15, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -65,9 +72,13 @@ exports[`AST Fixtures element AccessorProperty with-annotation-no-value AST Alig
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -75,6 +86,7 @@ exports[`AST Fixtures element AccessorProperty with-annotation-no-value AST Alig
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 38],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/1-TSESTree-AST.shot
index 6d4fd50a3c3a..7ddb1aff409f 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "AccessorProperty",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
range: [23, 27],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 15, line: 2 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -69,9 +76,13 @@ Program {
end: { column: 1, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [6, 9],
loc: {
@@ -79,6 +90,7 @@ Program {
end: { column: 9, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 46],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/5-AST-Alignment-AST.shot
index a0d4ea6a1c61..429343b6582d 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures element AccessorProperty with-annotation-with-value AST Al
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -19,9 +20,13 @@ exports[`AST Fixtures element AccessorProperty with-annotation-with-value AST Al
+ type: 'ClassAccessorProperty',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop',
+- optional: false,
range: [23, 27],
loc: {
@@ -29,7 +34,9 @@ exports[`AST Fixtures element AccessorProperty with-annotation-with-value AST Al
end: { column: 15, line: 2 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -75,9 +82,13 @@ exports[`AST Fixtures element AccessorProperty with-annotation-with-value AST Al
end: { column: 1, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [6, 9],
loc: {
@@ -85,6 +96,7 @@ exports[`AST Fixtures element AccessorProperty with-annotation-with-value AST Al
end: { column: 9, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 46],
diff --git a/packages/ast-spec/src/element/Property/spec.ts b/packages/ast-spec/src/element/Property/spec.ts
index c96a7a26e371..e10b6b464358 100644
--- a/packages/ast-spec/src/element/Property/spec.ts
+++ b/packages/ast-spec/src/element/Property/spec.ts
@@ -21,7 +21,7 @@ interface PropertyBase extends BaseNode {
computed: boolean;
method: boolean;
shorthand: boolean;
- optional?: boolean;
+ optional: boolean;
kind: 'get' | 'init' | 'set';
}
diff --git a/packages/ast-spec/src/element/TSEnumMember/spec.ts b/packages/ast-spec/src/element/TSEnumMember/spec.ts
index 97d8e49fcd94..9dd1ddeee696 100644
--- a/packages/ast-spec/src/element/TSEnumMember/spec.ts
+++ b/packages/ast-spec/src/element/TSEnumMember/spec.ts
@@ -11,8 +11,8 @@ interface TSEnumMemberBase extends BaseNode {
id:
| PropertyNameComputed // this should only happen in semantically invalid code (ts error 1164)
| PropertyNameNonComputed;
- initializer?: Expression;
- computed?: boolean;
+ initializer: Expression | undefined;
+ computed: boolean;
}
/**
@@ -33,7 +33,7 @@ export interface TSEnumMemberComputedName extends TSEnumMemberBase {
export interface TSEnumMemberNonComputedName extends TSEnumMemberBase {
id: PropertyNameNonComputed;
- computed?: false;
+ computed: false;
}
export type TSEnumMember =
diff --git a/packages/ast-spec/src/element/TSIndexSignature/spec.ts b/packages/ast-spec/src/element/TSIndexSignature/spec.ts
index 38002bec2951..4f514e757147 100644
--- a/packages/ast-spec/src/element/TSIndexSignature/spec.ts
+++ b/packages/ast-spec/src/element/TSIndexSignature/spec.ts
@@ -7,9 +7,8 @@ import type { Parameter } from '../../unions/Parameter';
export interface TSIndexSignature extends BaseNode {
type: AST_NODE_TYPES.TSIndexSignature;
parameters: Parameter[];
- typeAnnotation?: TSTypeAnnotation;
- readonly?: boolean;
- accessibility?: Accessibility;
- export?: boolean;
- static?: boolean;
+ typeAnnotation: TSTypeAnnotation | undefined;
+ readonly: boolean;
+ accessibility: Accessibility | undefined;
+ static: boolean;
}
diff --git a/packages/ast-spec/src/element/TSMethodSignature/spec.ts b/packages/ast-spec/src/element/TSMethodSignature/spec.ts
index 5ca7cbead3e0..9f75ee603c97 100644
--- a/packages/ast-spec/src/element/TSMethodSignature/spec.ts
+++ b/packages/ast-spec/src/element/TSMethodSignature/spec.ts
@@ -12,17 +12,16 @@ import type {
interface TSMethodSignatureBase extends BaseNode {
type: AST_NODE_TYPES.TSMethodSignature;
- key: PropertyName;
+ accessibility: Accessibility | undefined;
computed: boolean;
- params: Parameter[];
- optional?: boolean;
- returnType?: TSTypeAnnotation;
- readonly?: boolean;
- typeParameters?: TSTypeParameterDeclaration;
- accessibility?: Accessibility;
- export?: boolean;
- static?: boolean;
+ key: PropertyName;
kind: 'get' | 'method' | 'set';
+ optional: boolean;
+ params: Parameter[];
+ readonly: boolean;
+ returnType: TSTypeAnnotation | undefined;
+ static: boolean;
+ typeParameters: TSTypeParameterDeclaration | undefined;
}
export interface TSMethodSignatureComputedName extends TSMethodSignatureBase {
diff --git a/packages/ast-spec/src/element/TSPropertySignature/spec.ts b/packages/ast-spec/src/element/TSPropertySignature/spec.ts
index a3f91ac26807..e695085ca408 100644
--- a/packages/ast-spec/src/element/TSPropertySignature/spec.ts
+++ b/packages/ast-spec/src/element/TSPropertySignature/spec.ts
@@ -2,7 +2,6 @@ import type { AST_NODE_TYPES } from '../../ast-node-types';
import type { Accessibility } from '../../base/Accessibility';
import type { BaseNode } from '../../base/BaseNode';
import type { TSTypeAnnotation } from '../../special/TSTypeAnnotation/spec';
-import type { Expression } from '../../unions/Expression';
import type {
PropertyName,
PropertyNameComputed,
@@ -12,14 +11,12 @@ import type {
interface TSPropertySignatureBase extends BaseNode {
type: AST_NODE_TYPES.TSPropertySignature;
key: PropertyName;
- optional?: boolean;
+ optional: boolean;
computed: boolean;
- typeAnnotation?: TSTypeAnnotation;
- initializer?: Expression;
- readonly?: boolean;
- static?: boolean;
- export?: boolean;
- accessibility?: Accessibility;
+ typeAnnotation: TSTypeAnnotation | undefined;
+ readonly: boolean;
+ static: boolean;
+ accessibility: Accessibility | undefined;
}
export interface TSPropertySignatureComputedName
diff --git a/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts b/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts
index 347ee8541371..8532636554a7 100644
--- a/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts
+++ b/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts
@@ -14,6 +14,6 @@ export interface ArrowFunctionExpression extends BaseNode {
body: BlockStatement | Expression;
async: boolean;
expression: boolean;
- returnType?: TSTypeAnnotation;
- typeParameters?: TSTypeParameterDeclaration;
+ returnType: TSTypeAnnotation | undefined;
+ typeParameters: TSTypeParameterDeclaration | undefined;
}
diff --git a/packages/ast-spec/src/expression/BinaryExpression/BinaryOperatorToText.ts b/packages/ast-spec/src/expression/BinaryExpression/BinaryOperatorToText.ts
new file mode 100644
index 000000000000..b19373f54d22
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/BinaryOperatorToText.ts
@@ -0,0 +1,35 @@
+import type { SyntaxKind } from 'typescript';
+
+// the members of ts.BinaryOperator
+export interface BinaryOperatorToText {
+ [SyntaxKind.InstanceOfKeyword]: 'instanceof';
+ [SyntaxKind.InKeyword]: 'in';
+
+ // math
+ [SyntaxKind.AsteriskAsteriskToken]: '**';
+ [SyntaxKind.AsteriskToken]: '*';
+ [SyntaxKind.SlashToken]: '/';
+ [SyntaxKind.PercentToken]: '%';
+ [SyntaxKind.PlusToken]: '+';
+ [SyntaxKind.MinusToken]: '-';
+
+ // bitwise
+ [SyntaxKind.AmpersandToken]: '&';
+ [SyntaxKind.BarToken]: '|';
+ [SyntaxKind.CaretToken]: '^';
+ [SyntaxKind.LessThanLessThanToken]: '<<';
+ [SyntaxKind.GreaterThanGreaterThanToken]: '>>';
+ [SyntaxKind.GreaterThanGreaterThanGreaterThanToken]: '>>>';
+
+ // logical
+ [SyntaxKind.AmpersandAmpersandToken]: '&&';
+ [SyntaxKind.BarBarToken]: '||';
+ [SyntaxKind.LessThanToken]: '<';
+ [SyntaxKind.LessThanEqualsToken]: '<=';
+ [SyntaxKind.GreaterThanToken]: '>';
+ [SyntaxKind.GreaterThanEqualsToken]: '>=';
+ [SyntaxKind.EqualsEqualsToken]: '==';
+ [SyntaxKind.EqualsEqualsEqualsToken]: '===';
+ [SyntaxKind.ExclamationEqualsEqualsToken]: '!==';
+ [SyntaxKind.ExclamationEqualsToken]: '!=';
+}
diff --git a/packages/ast-spec/src/expression/BinaryExpression/spec.ts b/packages/ast-spec/src/expression/BinaryExpression/spec.ts
index fa43c88bcf50..d42f1d4e77f4 100644
--- a/packages/ast-spec/src/expression/BinaryExpression/spec.ts
+++ b/packages/ast-spec/src/expression/BinaryExpression/spec.ts
@@ -2,10 +2,14 @@ import type { AST_NODE_TYPES } from '../../ast-node-types';
import type { BaseNode } from '../../base/BaseNode';
import type { PrivateIdentifier } from '../../special/PrivateIdentifier/spec';
import type { Expression } from '../../unions/Expression';
+import type { ValueOf } from '../../utils';
+import type { BinaryOperatorToText } from './BinaryOperatorToText';
+
+export * from './BinaryOperatorToText';
export interface BinaryExpression extends BaseNode {
type: AST_NODE_TYPES.BinaryExpression;
- operator: string;
+ operator: ValueOf;
left: Expression | PrivateIdentifier;
right: Expression;
}
diff --git a/packages/ast-spec/src/expression/CallExpression/spec.ts b/packages/ast-spec/src/expression/CallExpression/spec.ts
index bd71773a1be8..b7569c9892e2 100644
--- a/packages/ast-spec/src/expression/CallExpression/spec.ts
+++ b/packages/ast-spec/src/expression/CallExpression/spec.ts
@@ -8,6 +8,10 @@ export interface CallExpression extends BaseNode {
type: AST_NODE_TYPES.CallExpression;
callee: LeftHandSideExpression;
arguments: CallExpressionArgument[];
- typeParameters?: TSTypeParameterInstantiation;
+ typeArguments: TSTypeParameterInstantiation | undefined;
+
+ /** @deprecated Use {@link `typeArguments`} instead. */
+ typeParameters: TSTypeParameterInstantiation | undefined;
+
optional: boolean;
}
diff --git a/packages/ast-spec/src/expression/ClassExpression/spec.ts b/packages/ast-spec/src/expression/ClassExpression/spec.ts
index dfe6c0d1b41d..dbd4936f67ca 100644
--- a/packages/ast-spec/src/expression/ClassExpression/spec.ts
+++ b/packages/ast-spec/src/expression/ClassExpression/spec.ts
@@ -3,7 +3,7 @@ import type { ClassBase } from '../../base/ClassBase';
export interface ClassExpression extends ClassBase {
type: AST_NODE_TYPES.ClassExpression;
- abstract?: undefined;
- declare?: undefined;
- decorators?: undefined;
+ abstract: false;
+ declare: false;
+ decorators: [];
}
diff --git a/packages/ast-spec/src/expression/Identifier/spec.ts b/packages/ast-spec/src/expression/Identifier/spec.ts
index 384922a061a1..d18ba7b9b993 100644
--- a/packages/ast-spec/src/expression/Identifier/spec.ts
+++ b/packages/ast-spec/src/expression/Identifier/spec.ts
@@ -6,7 +6,7 @@ import type { TSTypeAnnotation } from '../../special/TSTypeAnnotation/spec';
export interface Identifier extends BaseNode {
type: AST_NODE_TYPES.Identifier;
name: string;
- typeAnnotation?: TSTypeAnnotation;
- optional?: boolean;
- decorators?: Decorator[];
+ typeAnnotation: TSTypeAnnotation | undefined;
+ optional: boolean;
+ decorators: Decorator[];
}
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/fixture.ts b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/fixture.ts
new file mode 100644
index 000000000000..b91b27f0f8f1
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/fixture.ts
@@ -0,0 +1,5 @@
+import(
+ "./source.json",
+ {assert: {type: "json"}},
+ extraArgument
+);
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..3cdc1c9783c8
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ImportExpression _error_ extra-arguments Babel - Error 1`] = `[SyntaxError: \`import()\` requires exactly one or two arguments. (1:0)]`;
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..a18d1fd05d61
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,11 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ImportExpression _error_ extra-arguments TSESTree - Error 1`] = `
+"TSError
+ 2 | "./source.json",
+ 3 | {assert: {type: "json"}},
+> 4 | extraArgument
+ | ^^^^^^^^^^^^^ Dynamic import requires exactly one or two arguments.
+ 5 | );
+ 6 |"
+`;
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..69fd583b79fb
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ImportExpression _error_ extra-arguments Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..3cdc1c9783c8
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ImportExpression _error_ extra-arguments Babel - Error 1`] = `[SyntaxError: \`import()\` requires exactly one or two arguments. (1:0)]`;
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..69fd583b79fb
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ImportExpression _error_ extra-arguments Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/fixture.ts b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/fixture.ts
new file mode 100644
index 000000000000..6f375fea965b
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/fixture.ts
@@ -0,0 +1 @@
+import();
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..8b27d7178754
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ImportExpression _error_ no-arguments Babel - Error 1`] = `[SyntaxError: \`import()\` requires exactly one or two arguments. (1:0)]`;
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..b76c8be6e53a
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ImportExpression _error_ no-arguments TSESTree - Error 1`] = `
+"TSError
+> 1 | import();
+ | ^^^^^^^^ Dynamic import requires exactly one or two arguments.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..a767b5a6468b
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ImportExpression _error_ no-arguments Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..8b27d7178754
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ImportExpression _error_ no-arguments Babel - Error 1`] = `[SyntaxError: \`import()\` requires exactly one or two arguments. (1:0)]`;
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..a767b5a6468b
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ImportExpression _error_ no-arguments Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/expression/NewExpression/spec.ts b/packages/ast-spec/src/expression/NewExpression/spec.ts
index 1ee93ef507dd..51aea284158f 100644
--- a/packages/ast-spec/src/expression/NewExpression/spec.ts
+++ b/packages/ast-spec/src/expression/NewExpression/spec.ts
@@ -8,5 +8,8 @@ export interface NewExpression extends BaseNode {
type: AST_NODE_TYPES.NewExpression;
callee: LeftHandSideExpression;
arguments: CallExpressionArgument[];
- typeParameters?: TSTypeParameterInstantiation;
+ typeArguments: TSTypeParameterInstantiation | undefined;
+
+ /** @deprecated Use {@link `typeArguments`} instead. */
+ typeParameters: TSTypeParameterInstantiation | undefined;
}
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/fixture.ts
new file mode 100644
index 000000000000..876119b39905
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/fixture.ts
@@ -0,0 +1 @@
+({get foo();})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..71aabcc79543
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-getter-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:11)]`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..16431b24f4d3
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-getter-body TSESTree - Error 1`] = `
+"TSError
+> 1 | ({get foo();})
+ | ^ '{' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..d2dd4f91eabc
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-getter-body Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..71aabcc79543
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-getter-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:11)]`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..bc5201f9cee2
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-getter-body Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/fixture.ts
new file mode 100644
index 000000000000..433743dbdf05
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/fixture.ts
@@ -0,0 +1 @@
+({method();})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..83750d603134
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-method-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:10)]`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..d5072a95357a
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-method-body TSESTree - Error 1`] = `
+"TSError
+> 1 | ({method();})
+ | ^ '{' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..cb8ca32066be
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-method-body Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..83750d603134
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-method-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:10)]`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..37626ca02381
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-method-body Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/fixture.ts
new file mode 100644
index 000000000000..7f9318e62fd7
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/fixture.ts
@@ -0,0 +1 @@
+({set foo(value);})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..340728334fd3
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-setter-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:16)]`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..b775e8717cbc
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-setter-body TSESTree - Error 1`] = `
+"TSError
+> 1 | ({set foo(value);})
+ | ^ '{' expected.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..7691ccccd84d
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-setter-body Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..340728334fd3
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-setter-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:16)]`;
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..21d1ea67346c
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression ObjectExpression _error_ missing-setter-body Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/expression/TSInstantiationExpression/spec.ts b/packages/ast-spec/src/expression/TSInstantiationExpression/spec.ts
index c0a9f9fd99b7..064dd30612f7 100644
--- a/packages/ast-spec/src/expression/TSInstantiationExpression/spec.ts
+++ b/packages/ast-spec/src/expression/TSInstantiationExpression/spec.ts
@@ -6,5 +6,8 @@ import type { Expression } from '../../unions/Expression';
export interface TSInstantiationExpression extends BaseNode {
type: AST_NODE_TYPES.TSInstantiationExpression;
expression: Expression;
- typeParameters: TSTypeParameterInstantiation;
+ typeArguments: TSTypeParameterInstantiation;
+
+ /** @deprecated Use {@link `typeArguments`} instead. */
+ typeParameters?: TSTypeParameterInstantiation;
}
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/1-TSESTree-AST.shot
index bd2b5ff603e3..4fa6709d6a54 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
type: "TSSatisfiesExpression",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [0, 3],
loc: {
@@ -24,7 +26,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [14, 17],
loc: {
@@ -50,7 +54,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [28, 31],
loc: {
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/5-AST-Alignment-AST.shot
index 0d7d689095e5..c33813857603 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,100 @@
exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [0, 3],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 3, line: 1 },
+ },
+ },
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+
+ range: [0, 17],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'baz',
+- optional: false,
+
+ range: [28, 31],
+ loc: {
+ start: { column: 28, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+
+ range: [28, 31],
+ loc: {
+ start: { column: 28, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+
+ range: [0, 31],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 31, 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/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/1-TSESTree-AST.shot
index 6b30696c30b3..44e6ea89118c 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/1-TSESTree-AST.shot
@@ -50,7 +50,9 @@ Program {
},
test: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [0, 3],
loc: {
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/5-AST-Alignment-AST.shot
index a35b55978ba1..b8284df201fe 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,89 @@
exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ConditionalExpression {
+ type: 'ConditionalExpression',
+ alternate: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: Literal {
+ type: 'Literal',
+ raw: '0',
+ value: 0,
+
+ range: [11, 12],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 12, line: 1 },
+ },
+ },
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [23, 29],
+ loc: {
+ start: { column: 23, line: 1 },
+ end: { column: 29, line: 1 },
+ },
+ },
+
+ range: [11, 29],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 29, line: 1 },
+ },
+ },
+ consequent: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ test: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [0, 3],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 3, line: 1 },
+ },
+ },
+
+ range: [0, 30],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 30, line: 1 },
+ },
+ },
+
+ range: [0, 31],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/1-TSESTree-AST.shot
index 190beb7c0dd5..725f22263682 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/1-TSESTree-AST.shot
@@ -34,7 +34,9 @@ Program {
},
test: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [1, 4],
loc: {
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/5-AST-Alignment-AST.shot
index 45e35dfc2727..8d2c36f9f1a0 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,89 @@
exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: ConditionalExpression {
+ type: 'ConditionalExpression',
+ alternate: Literal {
+ type: 'Literal',
+ raw: '0',
+ value: 0,
+
+ range: [11, 12],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 12, line: 1 },
+ },
+ },
+ consequent: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [7, 8],
+ loc: {
+ start: { column: 7, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ test: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [1, 4],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 4, line: 1 },
+ },
+ },
+
+ range: [1, 12],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 12, line: 1 },
+ },
+ },
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [24, 30],
+ loc: {
+ start: { column: 24, line: 1 },
+ end: { column: 30, line: 1 },
+ },
+ },
+
+ range: [0, 30],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 30, line: 1 },
+ },
+ },
+
+ range: [0, 31],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/1-TSESTree-AST.shot
index 680a51ad16ac..40146d0cb3a3 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/1-TSESTree-AST.shot
@@ -10,7 +10,9 @@ Program {
type: "TSSatisfiesExpression",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [0, 3],
loc: {
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/5-AST-Alignment-AST.shot
index c167cbcb46bc..caa4c4e05179 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,58 @@
exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [0, 3],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 3, line: 1 },
+ },
+ },
+ typeAnnotation: TSBooleanKeyword {
+ type: 'TSBooleanKeyword',
+
+ range: [14, 21],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+
+ range: [0, 21],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+
+ range: [0, 22],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 23],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/1-TSESTree-AST.shot
index 0775d6c2219f..64e87002566f 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/1-TSESTree-AST.shot
@@ -10,7 +10,9 @@ Program {
type: "TSSatisfiesExpression",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [0, 3],
loc: {
@@ -26,7 +28,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
range: [16, 20],
loc: {
@@ -34,6 +38,9 @@ Program {
end: { column: 20, line: 1 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSLiteralType {
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/5-AST-Alignment-AST.shot
index 8e025552275e..edf9cfe837cc 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,114 @@
exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [0, 3],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 3, line: 1 },
+ },
+ },
+ typeAnnotation: TSTypeLiteral {
+ type: 'TSTypeLiteral',
+ members: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'prop',
+- optional: false,
+
+ range: [16, 20],
+ loc: {
+ start: { column: 16, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSLiteralType {
+ type: 'TSLiteralType',
+ literal: Literal {
+ type: 'Literal',
+ raw: '\\'value\\'',
+ value: 'value',
+
+ range: [22, 29],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 29, line: 1 },
+ },
+ },
+
+ range: [22, 29],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 29, line: 1 },
+ },
+ },
+
+ range: [20, 29],
+ loc: {
+ start: { column: 20, line: 1 },
+ end: { column: 29, line: 1 },
+ },
+ },
+
+ range: [16, 29],
+ loc: {
+ start: { column: 16, line: 1 },
+ end: { column: 29, line: 1 },
+ },
+ },
+ ],
+
+ range: [14, 31],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+
+ range: [0, 31],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 31, 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/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/1-TSESTree-AST.shot
index 0c9eb9f14688..cc7c01444f05 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/1-TSESTree-AST.shot
@@ -10,7 +10,9 @@ Program {
type: "TSSatisfiesExpression",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [0, 3],
loc: {
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/5-AST-Alignment-AST.shot
index eb993d611eb8..9d2bc98de489 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,120 @@
exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [0, 3],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 3, line: 1 },
+ },
+ },
+ typeAnnotation: TSTupleType {
+ type: 'TSTupleType',
+ elementTypes: Array [
+ TSLiteralType {
+ type: 'TSLiteralType',
+ literal: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+ TSLiteralType {
+ type: 'TSLiteralType',
+ literal: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [18, 19],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+
+ range: [18, 19],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ TSLiteralType {
+ type: 'TSLiteralType',
+ literal: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [21, 22],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+
+ range: [21, 22],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ ],
+
+ range: [14, 23],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 23, line: 1 },
+ },
+ },
+
+ range: [0, 23],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 23, line: 1 },
+ },
+ },
+
+ range: [0, 24],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 25],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/1-TSESTree-AST.shot
index 06455ebe1044..ba8636aaab24 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/1-TSESTree-AST.shot
@@ -10,7 +10,9 @@ Program {
type: "BinaryExpression",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [0, 3],
loc: {
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/5-AST-Alignment-AST.shot
index a21b35204c93..7d464b640eb9 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,79 @@
exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: BinaryExpression {
+ type: 'BinaryExpression',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [0, 3],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 3, line: 1 },
+ },
+ },
+ operator: '===',
+ right: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [9, 10],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 10, line: 1 },
+ },
+ },
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [21, 27],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 27, line: 1 },
+ },
+ },
+
+ range: [9, 27],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 27, line: 1 },
+ },
+ },
+
+ range: [0, 28],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 28, line: 1 },
+ },
+ },
+
+ range: [0, 29],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 29, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 30],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/1-TSESTree-AST.shot
index 1ffb8d1525b8..98075319cc38 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
type: "BinaryExpression",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [1, 4],
loc: {
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/5-AST-Alignment-AST.shot
index 28594822212f..d616143c031c 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,79 @@
exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: BinaryExpression {
+ type: 'BinaryExpression',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [1, 4],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 4, line: 1 },
+ },
+ },
+ operator: '===',
+ right: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [9, 10],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 10, line: 1 },
+ },
+ },
+
+ range: [1, 10],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 10, line: 1 },
+ },
+ },
+ typeAnnotation: TSBooleanKeyword {
+ type: 'TSBooleanKeyword',
+
+ range: [22, 29],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 29, line: 1 },
+ },
+ },
+
+ range: [0, 29],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 29, 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/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts
index b7726f7f1404..ec7b71c8e2b1 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts
@@ -1 +1 @@
-({ prop: 'string' } satisfies { prop: string });
+({ prop: 'string' }) satisfies { prop: string };
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/1-TSESTree-AST.shot
index 8dbdf850e403..8dd52c055f8d 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/1-TSESTree-AST.shot
@@ -16,7 +16,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
range: [3, 7],
loc: {
@@ -26,6 +28,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: Literal {
type: "Literal",
@@ -61,52 +64,57 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
- range: [32, 36],
+ range: [33, 37],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 36, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 37, line: 1 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
type: "TSStringKeyword",
- range: [38, 44],
+ range: [39, 45],
loc: {
- start: { column: 38, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 39, line: 1 },
+ end: { column: 45, line: 1 },
},
},
- range: [36, 44],
+ range: [37, 45],
loc: {
- start: { column: 36, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 37, line: 1 },
+ end: { column: 45, line: 1 },
},
},
- range: [32, 44],
+ range: [33, 45],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 45, line: 1 },
},
},
],
- range: [30, 46],
+ range: [31, 47],
loc: {
- start: { column: 30, line: 1 },
- end: { column: 46, line: 1 },
+ start: { column: 31, line: 1 },
+ end: { column: 47, line: 1 },
},
},
- range: [1, 46],
+ range: [0, 47],
loc: {
- start: { column: 1, line: 1 },
- end: { column: 46, line: 1 },
+ start: { column: 0, line: 1 },
+ end: { column: 47, line: 1 },
},
},
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/2-TSESTree-Tokens.shot
index f6e62fda8a7c..f7f9d748d613 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/2-TSESTree-Tokens.shot
@@ -62,70 +62,70 @@ exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-paren
end: { column: 19, line: 1 },
},
},
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
Identifier {
type: "Identifier",
value: "satisfies",
- range: [20, 29],
+ range: [21, 30],
loc: {
- start: { column: 20, line: 1 },
- end: { column: 29, line: 1 },
+ start: { column: 21, line: 1 },
+ end: { column: 30, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: "{",
- range: [30, 31],
+ range: [31, 32],
loc: {
- start: { column: 30, line: 1 },
- end: { column: 31, line: 1 },
+ start: { column: 31, line: 1 },
+ end: { column: 32, line: 1 },
},
},
Identifier {
type: "Identifier",
value: "prop",
- range: [32, 36],
+ range: [33, 37],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 36, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 37, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: ":",
- range: [36, 37],
+ range: [37, 38],
loc: {
- start: { column: 36, line: 1 },
- end: { column: 37, line: 1 },
+ start: { column: 37, line: 1 },
+ end: { column: 38, line: 1 },
},
},
Identifier {
type: "Identifier",
value: "string",
- range: [38, 44],
+ range: [39, 45],
loc: {
- start: { column: 38, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 39, line: 1 },
+ end: { column: 45, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [45, 46],
- loc: {
- start: { column: 45, line: 1 },
- end: { column: 46, line: 1 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ")",
-
range: [46, 47],
loc: {
start: { column: 46, line: 1 },
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/3-Babel-AST.shot
index 59da487f065c..d0798a51c940 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/3-Babel-AST.shot
@@ -63,10 +63,10 @@ Program {
type: "Identifier",
name: "prop",
- range: [32, 36],
+ range: [33, 37],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 36, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 37, line: 1 },
},
},
typeAnnotation: TSTypeAnnotation {
@@ -74,39 +74,39 @@ Program {
typeAnnotation: TSStringKeyword {
type: "TSStringKeyword",
- range: [38, 44],
+ range: [39, 45],
loc: {
- start: { column: 38, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 39, line: 1 },
+ end: { column: 45, line: 1 },
},
},
- range: [36, 44],
+ range: [37, 45],
loc: {
- start: { column: 36, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 37, line: 1 },
+ end: { column: 45, line: 1 },
},
},
- range: [32, 44],
+ range: [33, 45],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 45, line: 1 },
},
},
],
- range: [30, 46],
+ range: [31, 47],
loc: {
- start: { column: 30, line: 1 },
- end: { column: 46, line: 1 },
+ start: { column: 31, line: 1 },
+ end: { column: 47, line: 1 },
},
},
- range: [1, 46],
+ range: [0, 47],
loc: {
- start: { column: 1, line: 1 },
- end: { column: 46, line: 1 },
+ start: { column: 0, line: 1 },
+ end: { column: 47, line: 1 },
},
},
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/4-Babel-Tokens.shot
index 1aa182f5d2de..04ef14bf6452 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/4-Babel-Tokens.shot
@@ -62,70 +62,70 @@ exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-paren
end: { column: 19, line: 1 },
},
},
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
Identifier {
type: "Identifier",
value: "satisfies",
- range: [20, 29],
+ range: [21, 30],
loc: {
- start: { column: 20, line: 1 },
- end: { column: 29, line: 1 },
+ start: { column: 21, line: 1 },
+ end: { column: 30, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: "{",
- range: [30, 31],
+ range: [31, 32],
loc: {
- start: { column: 30, line: 1 },
- end: { column: 31, line: 1 },
+ start: { column: 31, line: 1 },
+ end: { column: 32, line: 1 },
},
},
Identifier {
type: "Identifier",
value: "prop",
- range: [32, 36],
+ range: [33, 37],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 36, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 37, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: ":",
- range: [36, 37],
+ range: [37, 38],
loc: {
- start: { column: 36, line: 1 },
- end: { column: 37, line: 1 },
+ start: { column: 37, line: 1 },
+ end: { column: 38, line: 1 },
},
},
Identifier {
type: "Identifier",
value: "string",
- range: [38, 44],
+ range: [39, 45],
loc: {
- start: { column: 38, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 39, line: 1 },
+ end: { column: 45, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [45, 46],
- loc: {
- start: { column: 45, line: 1 },
- end: { column: 46, line: 1 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ")",
-
range: [46, 47],
loc: {
start: { column: 46, line: 1 },
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/5-AST-Alignment-AST.shot
index bad308efe92f..fe43005e4ebe 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,139 @@
exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'prop',
+- optional: false,
+
+ range: [3, 7],
+ loc: {
+ start: { column: 3, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: Literal {
+ type: 'Literal',
+ raw: '\\'string\\'',
+ value: 'string',
+
+ range: [9, 17],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+
+ range: [3, 17],
+ loc: {
+ start: { column: 3, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ ],
+
+ range: [1, 19],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ typeAnnotation: TSTypeLiteral {
+ type: 'TSTypeLiteral',
+ members: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'prop',
+- optional: false,
+
+ range: [33, 37],
+ loc: {
+ start: { column: 33, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [39, 45],
+ loc: {
+ start: { column: 39, line: 1 },
+ end: { column: 45, line: 1 },
+ },
+ },
+
+ range: [37, 45],
+ loc: {
+ start: { column: 37, line: 1 },
+ end: { column: 45, line: 1 },
+ },
+ },
+
+ range: [33, 45],
+ loc: {
+ start: { column: 33, line: 1 },
+ end: { column: 45, line: 1 },
+ },
+ },
+ ],
+
+ range: [31, 47],
+ loc: {
+ start: { column: 31, line: 1 },
+ end: { column: 47, line: 1 },
+ },
+ },
+
+ range: [0, 47],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 47, line: 1 },
+ },
+ },
+
+ 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/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts
index b7726f7f1404..ec7b71c8e2b1 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts
@@ -1 +1 @@
-({ prop: 'string' } satisfies { prop: string });
+({ prop: 'string' }) satisfies { prop: string };
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/1-TSESTree-AST.shot
index c73bf6bd05da..33b08222c86b 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/1-TSESTree-AST.shot
@@ -16,7 +16,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
range: [3, 7],
loc: {
@@ -26,6 +28,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: Literal {
type: "Literal",
@@ -61,52 +64,57 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop",
+ optional: false,
- range: [32, 36],
+ range: [33, 37],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 36, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 37, line: 1 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
type: "TSStringKeyword",
- range: [38, 44],
+ range: [39, 45],
loc: {
- start: { column: 38, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 39, line: 1 },
+ end: { column: 45, line: 1 },
},
},
- range: [36, 44],
+ range: [37, 45],
loc: {
- start: { column: 36, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 37, line: 1 },
+ end: { column: 45, line: 1 },
},
},
- range: [32, 44],
+ range: [33, 45],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 45, line: 1 },
},
},
],
- range: [30, 46],
+ range: [31, 47],
loc: {
- start: { column: 30, line: 1 },
- end: { column: 46, line: 1 },
+ start: { column: 31, line: 1 },
+ end: { column: 47, line: 1 },
},
},
- range: [1, 46],
+ range: [0, 47],
loc: {
- start: { column: 1, line: 1 },
- end: { column: 46, line: 1 },
+ start: { column: 0, line: 1 },
+ end: { column: 47, line: 1 },
},
},
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/2-TSESTree-Tokens.shot
index 18e9568f78b6..a022fc363e0c 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/2-TSESTree-Tokens.shot
@@ -62,70 +62,70 @@ exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-paren
end: { column: 19, line: 1 },
},
},
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
Identifier {
type: "Identifier",
value: "satisfies",
- range: [20, 29],
+ range: [21, 30],
loc: {
- start: { column: 20, line: 1 },
- end: { column: 29, line: 1 },
+ start: { column: 21, line: 1 },
+ end: { column: 30, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: "{",
- range: [30, 31],
+ range: [31, 32],
loc: {
- start: { column: 30, line: 1 },
- end: { column: 31, line: 1 },
+ start: { column: 31, line: 1 },
+ end: { column: 32, line: 1 },
},
},
Identifier {
type: "Identifier",
value: "prop",
- range: [32, 36],
+ range: [33, 37],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 36, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 37, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: ":",
- range: [36, 37],
+ range: [37, 38],
loc: {
- start: { column: 36, line: 1 },
- end: { column: 37, line: 1 },
+ start: { column: 37, line: 1 },
+ end: { column: 38, line: 1 },
},
},
Identifier {
type: "Identifier",
value: "string",
- range: [38, 44],
+ range: [39, 45],
loc: {
- start: { column: 38, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 39, line: 1 },
+ end: { column: 45, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [45, 46],
- loc: {
- start: { column: 45, line: 1 },
- end: { column: 46, line: 1 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ")",
-
range: [46, 47],
loc: {
start: { column: 46, line: 1 },
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/3-Babel-AST.shot
index 0131efff0cb0..3ea078f4e99c 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/3-Babel-AST.shot
@@ -63,10 +63,10 @@ Program {
type: "Identifier",
name: "prop",
- range: [32, 36],
+ range: [33, 37],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 36, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 37, line: 1 },
},
},
typeAnnotation: TSTypeAnnotation {
@@ -74,39 +74,39 @@ Program {
typeAnnotation: TSStringKeyword {
type: "TSStringKeyword",
- range: [38, 44],
+ range: [39, 45],
loc: {
- start: { column: 38, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 39, line: 1 },
+ end: { column: 45, line: 1 },
},
},
- range: [36, 44],
+ range: [37, 45],
loc: {
- start: { column: 36, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 37, line: 1 },
+ end: { column: 45, line: 1 },
},
},
- range: [32, 44],
+ range: [33, 45],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 45, line: 1 },
},
},
],
- range: [30, 46],
+ range: [31, 47],
loc: {
- start: { column: 30, line: 1 },
- end: { column: 46, line: 1 },
+ start: { column: 31, line: 1 },
+ end: { column: 47, line: 1 },
},
},
- range: [1, 46],
+ range: [0, 47],
loc: {
- start: { column: 1, line: 1 },
- end: { column: 46, line: 1 },
+ start: { column: 0, line: 1 },
+ end: { column: 47, line: 1 },
},
},
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/4-Babel-Tokens.shot
index 319139b4a84c..a1d5ac276a72 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/4-Babel-Tokens.shot
@@ -62,70 +62,70 @@ exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-paren
end: { column: 19, line: 1 },
},
},
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
Identifier {
type: "Identifier",
value: "satisfies",
- range: [20, 29],
+ range: [21, 30],
loc: {
- start: { column: 20, line: 1 },
- end: { column: 29, line: 1 },
+ start: { column: 21, line: 1 },
+ end: { column: 30, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: "{",
- range: [30, 31],
+ range: [31, 32],
loc: {
- start: { column: 30, line: 1 },
- end: { column: 31, line: 1 },
+ start: { column: 31, line: 1 },
+ end: { column: 32, line: 1 },
},
},
Identifier {
type: "Identifier",
value: "prop",
- range: [32, 36],
+ range: [33, 37],
loc: {
- start: { column: 32, line: 1 },
- end: { column: 36, line: 1 },
+ start: { column: 33, line: 1 },
+ end: { column: 37, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: ":",
- range: [36, 37],
+ range: [37, 38],
loc: {
- start: { column: 36, line: 1 },
- end: { column: 37, line: 1 },
+ start: { column: 37, line: 1 },
+ end: { column: 38, line: 1 },
},
},
Identifier {
type: "Identifier",
value: "string",
- range: [38, 44],
+ range: [39, 45],
loc: {
- start: { column: 38, line: 1 },
- end: { column: 44, line: 1 },
+ start: { column: 39, line: 1 },
+ end: { column: 45, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [45, 46],
- loc: {
- start: { column: 45, line: 1 },
- end: { column: 46, line: 1 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ")",
-
range: [46, 47],
loc: {
start: { column: 46, line: 1 },
diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/5-AST-Alignment-AST.shot
index 982ccda73a24..add1ea89b367 100644
--- a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,139 @@
exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TSSatisfiesExpression {
+ type: 'TSSatisfiesExpression',
+ expression: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'prop',
+- optional: false,
+
+ range: [3, 7],
+ loc: {
+ start: { column: 3, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: Literal {
+ type: 'Literal',
+ raw: '\\'string\\'',
+ value: 'string',
+
+ range: [9, 17],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+
+ range: [3, 17],
+ loc: {
+ start: { column: 3, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ ],
+
+ range: [1, 19],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ typeAnnotation: TSTypeLiteral {
+ type: 'TSTypeLiteral',
+ members: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'prop',
+- optional: false,
+
+ range: [33, 37],
+ loc: {
+ start: { column: 33, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [39, 45],
+ loc: {
+ start: { column: 39, line: 1 },
+ end: { column: 45, line: 1 },
+ },
+ },
+
+ range: [37, 45],
+ loc: {
+ start: { column: 37, line: 1 },
+ end: { column: 45, line: 1 },
+ },
+ },
+
+ range: [33, 45],
+ loc: {
+ start: { column: 33, line: 1 },
+ end: { column: 45, line: 1 },
+ },
+ },
+ ],
+
+ range: [31, 47],
+ loc: {
+ start: { column: 31, line: 1 },
+ end: { column: 47, line: 1 },
+ },
+ },
+
+ range: [0, 47],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 47, line: 1 },
+ },
+ },
+
+ 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/expression/TaggedTemplateExpression/spec.ts b/packages/ast-spec/src/expression/TaggedTemplateExpression/spec.ts
index e3438484d9dd..b673ca5f0db7 100644
--- a/packages/ast-spec/src/expression/TaggedTemplateExpression/spec.ts
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/spec.ts
@@ -6,7 +6,11 @@ import type { TemplateLiteral } from '../TemplateLiteral/spec';
export interface TaggedTemplateExpression extends BaseNode {
type: AST_NODE_TYPES.TaggedTemplateExpression;
- typeParameters?: TSTypeParameterInstantiation;
+ typeArguments: TSTypeParameterInstantiation | undefined;
+
+ /** @deprecated Use {@link `typeArguments`} instead. */
+ typeParameters: TSTypeParameterInstantiation | undefined;
+
tag: LeftHandSideExpression;
quasi: TemplateLiteral;
}
diff --git a/packages/ast-spec/src/expression/YieldExpression/spec.ts b/packages/ast-spec/src/expression/YieldExpression/spec.ts
index 1f07e4f78e32..00c64731e734 100644
--- a/packages/ast-spec/src/expression/YieldExpression/spec.ts
+++ b/packages/ast-spec/src/expression/YieldExpression/spec.ts
@@ -5,5 +5,5 @@ import type { Expression } from '../../unions/Expression';
export interface YieldExpression extends BaseNode {
type: AST_NODE_TYPES.YieldExpression;
delegate: boolean;
- argument?: Expression;
+ argument: Expression | undefined;
}
diff --git a/packages/ast-spec/src/index.ts b/packages/ast-spec/src/index.ts
index ba9ee6800007..3ca95ed64176 100644
--- a/packages/ast-spec/src/index.ts
+++ b/packages/ast-spec/src/index.ts
@@ -1,5 +1,6 @@
export * from './base/Accessibility';
export * from './base/BaseNode'; // this is exported so that the `types` package can merge the decl and add the `parent` property
+export * from './base/NodeOrTokenData';
export * from './base/OptionalRangeAndLoc';
export * from './base/Position';
export * from './base/Range';
@@ -26,7 +27,6 @@ export * from './unions/JSXTagNameExpression';
export * from './unions/LeftHandSideExpression';
export * from './unions/Literal';
export * from './unions/LiteralExpression';
-export * from './unions/Modifier';
export * from './unions/Node';
export * from './unions/ObjectLiteralElement';
export * from './unions/Parameter';
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx
index ae10e30c0b1a..2bb647ef3406 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx
@@ -1,7 +1,11 @@
-namespace JSX {
- export interface IntrinsicElements {
+declare namespace JSX {
+ interface IntrinsicElements {
+ foo: any;
'foo-bar:baz-bam': any;
}
}
+// @ts-expect-error -- https://github.com/typescript-eslint/typescript-eslint/issues/7166
+const componentBasic = ;
+// @ts-expect-error -- https://github.com/typescript-eslint/typescript-eslint/issues/7166
const componentDashed = ;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/1-TSESTree-AST.shot
index 89265a3c778b..ba010bda2df2 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/1-TSESTree-AST.shot
@@ -9,112 +9,220 @@ Program {
body: TSModuleBlock {
type: "TSModuleBlock",
body: [
- ExportNamedDeclaration {
- type: "ExportNamedDeclaration",
- assertions: [],
- declaration: TSInterfaceDeclaration {
- type: "TSInterfaceDeclaration",
- body: TSInterfaceBody {
- type: "TSInterfaceBody",
- body: [
- TSPropertySignature {
- type: "TSPropertySignature",
- computed: false,
- key: Literal {
- type: "Literal",
- raw: "'foo-bar:baz-bam'",
- value: "foo-bar:baz-bam",
-
- range: [59, 76],
+ TSInterfaceDeclaration {
+ type: "TSInterfaceDeclaration",
+ body: TSInterfaceBody {
+ type: "TSInterfaceBody",
+ body: [
+ TSPropertySignature {
+ type: "TSPropertySignature",
+ computed: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "foo",
+ optional: false,
+
+ range: [60, 63],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ optional: false,
+ readonly: false,
+ static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSAnyKeyword {
+ type: "TSAnyKeyword",
+
+ range: [65, 68],
loc: {
- start: { column: 4, line: 3 },
- end: { column: 21, line: 3 },
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
},
},
- typeAnnotation: TSTypeAnnotation {
- type: "TSTypeAnnotation",
- typeAnnotation: TSAnyKeyword {
- type: "TSAnyKeyword",
-
- range: [78, 81],
- loc: {
- start: { column: 23, line: 3 },
- end: { column: 26, line: 3 },
- },
- },
- range: [76, 81],
+ range: [63, 68],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ range: [60, 69],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ TSPropertySignature {
+ type: "TSPropertySignature",
+ computed: false,
+ key: Literal {
+ type: "Literal",
+ raw: "'foo-bar:baz-bam'",
+ value: "foo-bar:baz-bam",
+
+ range: [74, 91],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+ optional: false,
+ readonly: false,
+ static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSAnyKeyword {
+ type: "TSAnyKeyword",
+
+ range: [93, 96],
loc: {
- start: { column: 21, line: 3 },
- end: { column: 26, line: 3 },
+ start: { column: 23, line: 4 },
+ end: { column: 26, line: 4 },
},
},
- range: [59, 82],
+ range: [91, 96],
loc: {
- start: { column: 4, line: 3 },
- end: { column: 27, line: 3 },
+ start: { column: 21, line: 4 },
+ end: { column: 26, line: 4 },
},
},
- ],
- range: [53, 86],
- loc: {
- start: { column: 37, line: 2 },
- end: { column: 3, line: 4 },
+ range: [74, 97],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 27, line: 4 },
+ },
},
- },
- id: Identifier {
- type: "Identifier",
- name: "IntrinsicElements",
+ ],
- range: [35, 52],
- loc: {
- start: { column: 19, line: 2 },
- end: { column: 36, line: 2 },
- },
+ range: [54, 101],
+ loc: {
+ start: { column: 30, line: 2 },
+ end: { column: 3, line: 5 },
},
+ },
+ declare: false,
+ extends: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "IntrinsicElements",
+ optional: false,
- range: [25, 86],
+ range: [36, 53],
loc: {
- start: { column: 9, line: 2 },
- end: { column: 3, line: 4 },
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
},
},
- exportKind: "type",
- source: null,
- specifiers: [],
- range: [18, 86],
+ range: [26, 101],
loc: {
start: { column: 2, line: 2 },
- end: { column: 3, line: 4 },
+ end: { column: 3, line: 5 },
},
},
],
- range: [14, 88],
+ range: [22, 103],
loc: {
- start: { column: 14, line: 1 },
- end: { column: 1, line: 5 },
+ start: { column: 22, line: 1 },
+ end: { column: 1, line: 6 },
},
},
+ declare: true,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "JSX",
+ optional: false,
- range: [10, 13],
+ range: [18, 21],
loc: {
- start: { column: 10, line: 1 },
- end: { column: 13, line: 1 },
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
},
},
kind: "namespace",
- range: [0, 88],
+ range: [0, 103],
loc: {
start: { column: 0, line: 1 },
- end: { column: 1, line: 5 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ VariableDeclaration {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ definite: false,
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "componentBasic",
+ optional: false,
+
+ range: [201, 215],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 20, line: 9 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [],
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "foo",
+
+ range: [219, 222],
+ loc: {
+ start: { column: 24, line: 9 },
+ end: { column: 27, line: 9 },
+ },
+ },
+ selfClosing: true,
+
+ range: [218, 225],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+
+ range: [218, 225],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+
+ range: [201, 225],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ ],
+ declare: false,
+ kind: "const",
+
+ range: [195, 226],
+ loc: {
+ start: { column: 0, line: 9 },
+ end: { column: 31, line: 9 },
},
},
VariableDeclaration {
@@ -122,14 +230,17 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "componentDashed",
+ optional: false,
- range: [96, 111],
+ range: [323, 338],
loc: {
- start: { column: 6, line: 7 },
- end: { column: 21, line: 7 },
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
},
},
init: JSXElement {
@@ -145,67 +256,68 @@ Program {
type: "JSXIdentifier",
name: "baz-bam",
- range: [123, 130],
+ range: [350, 357],
loc: {
- start: { column: 33, line: 7 },
- end: { column: 40, line: 7 },
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
},
},
namespace: JSXIdentifier {
type: "JSXIdentifier",
name: "foo-bar",
- range: [115, 122],
+ range: [342, 349],
loc: {
- start: { column: 25, line: 7 },
- end: { column: 32, line: 7 },
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
},
},
- range: [115, 130],
+ range: [342, 357],
loc: {
- start: { column: 25, line: 7 },
- end: { column: 40, line: 7 },
+ start: { column: 25, line: 11 },
+ end: { column: 40, line: 11 },
},
},
selfClosing: true,
- range: [114, 133],
+ range: [341, 360],
loc: {
- start: { column: 24, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
},
},
- range: [114, 133],
+ range: [341, 360],
loc: {
- start: { column: 24, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
},
},
- range: [96, 133],
+ range: [323, 360],
loc: {
- start: { column: 6, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 6, line: 11 },
+ end: { column: 43, line: 11 },
},
},
],
+ declare: false,
kind: "const",
- range: [90, 134],
+ range: [317, 361],
loc: {
- start: { column: 0, line: 7 },
- end: { column: 44, line: 7 },
+ start: { column: 0, line: 11 },
+ end: { column: 44, line: 11 },
},
},
],
sourceType: "script",
- range: [0, 135],
+ range: [0, 362],
loc: {
start: { column: 0, line: 1 },
- end: { column: 0, line: 8 },
+ end: { column: 0, line: 12 },
},
}
`;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/2-TSESTree-Tokens.shot
index c416578b7093..7d73f939d7a9 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/2-TSESTree-Tokens.shot
@@ -4,232 +4,352 @@ exports[`AST Fixtures jsx JSXNamespacedName component-dashed TSESTree - Tokens 1
[
Identifier {
type: "Identifier",
- value: "namespace",
+ value: "declare",
- range: [0, 9],
+ range: [0, 7],
loc: {
start: { column: 0, line: 1 },
- end: { column: 9, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [8, 17],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 17, line: 1 },
},
},
Identifier {
type: "Identifier",
value: "JSX",
- range: [10, 13],
+ range: [18, 21],
loc: {
- start: { column: 10, line: 1 },
- end: { column: 13, line: 1 },
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: "{",
- range: [14, 15],
+ range: [22, 23],
loc: {
- start: { column: 14, line: 1 },
- end: { column: 15, line: 1 },
+ start: { column: 22, line: 1 },
+ end: { column: 23, line: 1 },
},
},
Keyword {
type: "Keyword",
- value: "export",
+ value: "interface",
- range: [18, 24],
+ range: [26, 35],
loc: {
start: { column: 2, line: 2 },
- end: { column: 8, line: 2 },
+ end: { column: 11, line: 2 },
},
},
- Keyword {
- type: "Keyword",
- value: "interface",
+ Identifier {
+ type: "Identifier",
+ value: "IntrinsicElements",
+
+ range: [36, 53],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
- range: [25, 34],
+ range: [54, 55],
loc: {
- start: { column: 9, line: 2 },
- end: { column: 18, line: 2 },
+ start: { column: 30, line: 2 },
+ end: { column: 31, line: 2 },
},
},
Identifier {
type: "Identifier",
- value: "IntrinsicElements",
+ value: "foo",
- range: [35, 52],
+ range: [60, 63],
loc: {
- start: { column: 19, line: 2 },
- end: { column: 36, line: 2 },
+ start: { column: 4, line: 3 },
+ end: { column: 7, line: 3 },
},
},
Punctuator {
type: "Punctuator",
- value: "{",
+ value: ":",
+
+ range: [63, 64],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "any",
- range: [53, 54],
+ range: [65, 68],
loc: {
- start: { column: 37, line: 2 },
- end: { column: 38, line: 2 },
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [68, 69],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
},
},
String {
type: "String",
value: "'foo-bar:baz-bam'",
- range: [59, 76],
+ range: [74, 91],
loc: {
- start: { column: 4, line: 3 },
- end: { column: 21, line: 3 },
+ start: { column: 4, line: 4 },
+ end: { column: 21, line: 4 },
},
},
Punctuator {
type: "Punctuator",
value: ":",
- range: [76, 77],
+ range: [91, 92],
loc: {
- start: { column: 21, line: 3 },
- end: { column: 22, line: 3 },
+ start: { column: 21, line: 4 },
+ end: { column: 22, line: 4 },
},
},
Identifier {
type: "Identifier",
value: "any",
- range: [78, 81],
+ range: [93, 96],
loc: {
- start: { column: 23, line: 3 },
- end: { column: 26, line: 3 },
+ start: { column: 23, line: 4 },
+ end: { column: 26, line: 4 },
},
},
Punctuator {
type: "Punctuator",
value: ";",
- range: [81, 82],
+ range: [96, 97],
loc: {
- start: { column: 26, line: 3 },
- end: { column: 27, line: 3 },
+ start: { column: 26, line: 4 },
+ end: { column: 27, line: 4 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [85, 86],
+ range: [100, 101],
loc: {
- start: { column: 2, line: 4 },
- end: { column: 3, line: 4 },
+ start: { column: 2, line: 5 },
+ end: { column: 3, line: 5 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [87, 88],
+ range: [102, 103],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [195, 200],
+ loc: {
+ start: { column: 0, line: 9 },
+ end: { column: 5, line: 9 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "componentBasic",
+
+ range: [201, 215],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 20, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [216, 217],
+ loc: {
+ start: { column: 21, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [218, 219],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 24, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "foo",
+
+ range: [219, 222],
+ loc: {
+ start: { column: 24, line: 9 },
+ end: { column: 27, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [223, 224],
+ loc: {
+ start: { column: 28, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [224, 225],
+ loc: {
+ start: { column: 29, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [225, 226],
loc: {
- start: { column: 0, line: 5 },
- end: { column: 1, line: 5 },
+ start: { column: 30, line: 9 },
+ end: { column: 31, line: 9 },
},
},
Keyword {
type: "Keyword",
value: "const",
- range: [90, 95],
+ range: [317, 322],
loc: {
- start: { column: 0, line: 7 },
- end: { column: 5, line: 7 },
+ start: { column: 0, line: 11 },
+ end: { column: 5, line: 11 },
},
},
Identifier {
type: "Identifier",
value: "componentDashed",
- range: [96, 111],
+ range: [323, 338],
loc: {
- start: { column: 6, line: 7 },
- end: { column: 21, line: 7 },
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: "=",
- range: [112, 113],
+ range: [339, 340],
loc: {
- start: { column: 22, line: 7 },
- end: { column: 23, line: 7 },
+ start: { column: 22, line: 11 },
+ end: { column: 23, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: "<",
- range: [114, 115],
+ range: [341, 342],
loc: {
- start: { column: 24, line: 7 },
- end: { column: 25, line: 7 },
+ start: { column: 24, line: 11 },
+ end: { column: 25, line: 11 },
},
},
Identifier {
type: "Identifier",
value: "foo-bar",
- range: [115, 122],
+ range: [342, 349],
loc: {
- start: { column: 25, line: 7 },
- end: { column: 32, line: 7 },
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: ":",
- range: [122, 123],
+ range: [349, 350],
loc: {
- start: { column: 32, line: 7 },
- end: { column: 33, line: 7 },
+ start: { column: 32, line: 11 },
+ end: { column: 33, line: 11 },
},
},
Identifier {
type: "Identifier",
value: "baz-bam",
- range: [123, 130],
+ range: [350, 357],
loc: {
- start: { column: 33, line: 7 },
- end: { column: 40, line: 7 },
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: "/",
- range: [131, 132],
+ range: [358, 359],
loc: {
- start: { column: 41, line: 7 },
- end: { column: 42, line: 7 },
+ start: { column: 41, line: 11 },
+ end: { column: 42, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: ">",
- range: [132, 133],
+ range: [359, 360],
loc: {
- start: { column: 42, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 42, line: 11 },
+ end: { column: 43, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: ";",
- range: [133, 134],
+ range: [360, 361],
loc: {
- start: { column: 43, line: 7 },
- end: { column: 44, line: 7 },
+ start: { column: 43, line: 11 },
+ end: { column: 44, line: 11 },
},
},
]
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/3-Babel-AST.shot
index 0425d143c1b1..e065c2a0f7fa 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/3-Babel-AST.shot
@@ -9,111 +9,200 @@ Program {
body: TSModuleBlock {
type: "TSModuleBlock",
body: [
- ExportNamedDeclaration {
- type: "ExportNamedDeclaration",
- assertions: [],
- declaration: TSInterfaceDeclaration {
- type: "TSInterfaceDeclaration",
- body: TSInterfaceBody {
- type: "TSInterfaceBody",
- body: [
- TSPropertySignature {
- type: "TSPropertySignature",
- computed: false,
- key: Literal {
- type: "Literal",
- raw: "'foo-bar:baz-bam'",
- value: "foo-bar:baz-bam",
-
- range: [59, 76],
+ TSInterfaceDeclaration {
+ type: "TSInterfaceDeclaration",
+ body: TSInterfaceBody {
+ type: "TSInterfaceBody",
+ body: [
+ TSPropertySignature {
+ type: "TSPropertySignature",
+ computed: false,
+ key: Identifier {
+ type: "Identifier",
+ name: "foo",
+
+ range: [60, 63],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSAnyKeyword {
+ type: "TSAnyKeyword",
+
+ range: [65, 68],
loc: {
- start: { column: 4, line: 3 },
- end: { column: 21, line: 3 },
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
},
},
- typeAnnotation: TSTypeAnnotation {
- type: "TSTypeAnnotation",
- typeAnnotation: TSAnyKeyword {
- type: "TSAnyKeyword",
-
- range: [78, 81],
- loc: {
- start: { column: 23, line: 3 },
- end: { column: 26, line: 3 },
- },
- },
- range: [76, 81],
+ range: [63, 68],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ range: [60, 69],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ TSPropertySignature {
+ type: "TSPropertySignature",
+ computed: false,
+ key: Literal {
+ type: "Literal",
+ raw: "'foo-bar:baz-bam'",
+ value: "foo-bar:baz-bam",
+
+ range: [74, 91],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+ typeAnnotation: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSAnyKeyword {
+ type: "TSAnyKeyword",
+
+ range: [93, 96],
loc: {
- start: { column: 21, line: 3 },
- end: { column: 26, line: 3 },
+ start: { column: 23, line: 4 },
+ end: { column: 26, line: 4 },
},
},
- range: [59, 82],
+ range: [91, 96],
loc: {
- start: { column: 4, line: 3 },
- end: { column: 27, line: 3 },
+ start: { column: 21, line: 4 },
+ end: { column: 26, line: 4 },
},
},
- ],
- range: [53, 86],
- loc: {
- start: { column: 37, line: 2 },
- end: { column: 3, line: 4 },
+ range: [74, 97],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 27, line: 4 },
+ },
},
- },
- id: Identifier {
- type: "Identifier",
- name: "IntrinsicElements",
+ ],
- range: [35, 52],
- loc: {
- start: { column: 19, line: 2 },
- end: { column: 36, line: 2 },
- },
+ range: [54, 101],
+ loc: {
+ start: { column: 30, line: 2 },
+ end: { column: 3, line: 5 },
},
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "IntrinsicElements",
- range: [25, 86],
+ range: [36, 53],
loc: {
- start: { column: 9, line: 2 },
- end: { column: 3, line: 4 },
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
},
},
- exportKind: "type",
- source: null,
- specifiers: [],
- range: [18, 86],
+ range: [26, 101],
loc: {
start: { column: 2, line: 2 },
- end: { column: 3, line: 4 },
+ end: { column: 3, line: 5 },
},
},
],
- range: [14, 88],
+ range: [22, 103],
loc: {
- start: { column: 14, line: 1 },
- end: { column: 1, line: 5 },
+ start: { column: 22, line: 1 },
+ end: { column: 1, line: 6 },
},
},
+ declare: true,
id: Identifier {
type: "Identifier",
name: "JSX",
- range: [10, 13],
+ range: [18, 21],
loc: {
- start: { column: 10, line: 1 },
- end: { column: 13, line: 1 },
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
},
},
- range: [0, 88],
+ range: [0, 103],
loc: {
start: { column: 0, line: 1 },
- end: { column: 1, line: 5 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ VariableDeclaration {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ id: Identifier {
+ type: "Identifier",
+ name: "componentBasic",
+
+ range: [201, 215],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 20, line: 9 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [],
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "foo",
+
+ range: [219, 222],
+ loc: {
+ start: { column: 24, line: 9 },
+ end: { column: 27, line: 9 },
+ },
+ },
+ selfClosing: true,
+
+ range: [218, 225],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+
+ range: [218, 225],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+
+ range: [201, 225],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ ],
+ kind: "const",
+
+ range: [195, 226],
+ loc: {
+ start: { column: 0, line: 9 },
+ end: { column: 31, line: 9 },
},
},
VariableDeclaration {
@@ -125,10 +214,10 @@ Program {
type: "Identifier",
name: "componentDashed",
- range: [96, 111],
+ range: [323, 338],
loc: {
- start: { column: 6, line: 7 },
- end: { column: 21, line: 7 },
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
},
},
init: JSXElement {
@@ -144,67 +233,67 @@ Program {
type: "JSXIdentifier",
name: "baz-bam",
- range: [123, 130],
+ range: [350, 357],
loc: {
- start: { column: 33, line: 7 },
- end: { column: 40, line: 7 },
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
},
},
namespace: JSXIdentifier {
type: "JSXIdentifier",
name: "foo-bar",
- range: [115, 122],
+ range: [342, 349],
loc: {
- start: { column: 25, line: 7 },
- end: { column: 32, line: 7 },
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
},
},
- range: [115, 130],
+ range: [342, 357],
loc: {
- start: { column: 25, line: 7 },
- end: { column: 40, line: 7 },
+ start: { column: 25, line: 11 },
+ end: { column: 40, line: 11 },
},
},
selfClosing: true,
- range: [114, 133],
+ range: [341, 360],
loc: {
- start: { column: 24, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
},
},
- range: [114, 133],
+ range: [341, 360],
loc: {
- start: { column: 24, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
},
},
- range: [96, 133],
+ range: [323, 360],
loc: {
- start: { column: 6, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 6, line: 11 },
+ end: { column: 43, line: 11 },
},
},
],
kind: "const",
- range: [90, 134],
+ range: [317, 361],
loc: {
- start: { column: 0, line: 7 },
- end: { column: 44, line: 7 },
+ start: { column: 0, line: 11 },
+ end: { column: 44, line: 11 },
},
},
],
sourceType: "script",
- range: [0, 135],
+ range: [0, 362],
loc: {
start: { column: 0, line: 1 },
- end: { column: 0, line: 8 },
+ end: { column: 0, line: 12 },
},
}
`;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/4-Babel-Tokens.shot
index fba5e9f5f99f..80a517390c0e 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/4-Babel-Tokens.shot
@@ -4,232 +4,352 @@ exports[`AST Fixtures jsx JSXNamespacedName component-dashed Babel - Tokens 1`]
[
Identifier {
type: "Identifier",
- value: "namespace",
+ value: "declare",
- range: [0, 9],
+ range: [0, 7],
loc: {
start: { column: 0, line: 1 },
- end: { column: 9, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [8, 17],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 17, line: 1 },
},
},
Identifier {
type: "Identifier",
value: "JSX",
- range: [10, 13],
+ range: [18, 21],
loc: {
- start: { column: 10, line: 1 },
- end: { column: 13, line: 1 },
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
},
},
Punctuator {
type: "Punctuator",
value: "{",
- range: [14, 15],
+ range: [22, 23],
loc: {
- start: { column: 14, line: 1 },
- end: { column: 15, line: 1 },
+ start: { column: 22, line: 1 },
+ end: { column: 23, line: 1 },
},
},
- Keyword {
- type: "Keyword",
- value: "export",
+ Identifier {
+ type: "Identifier",
+ value: "interface",
- range: [18, 24],
+ range: [26, 35],
loc: {
start: { column: 2, line: 2 },
- end: { column: 8, line: 2 },
+ end: { column: 11, line: 2 },
},
},
Identifier {
type: "Identifier",
- value: "interface",
+ value: "IntrinsicElements",
+
+ range: [36, 53],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
- range: [25, 34],
+ range: [54, 55],
loc: {
- start: { column: 9, line: 2 },
- end: { column: 18, line: 2 },
+ start: { column: 30, line: 2 },
+ end: { column: 31, line: 2 },
},
},
Identifier {
type: "Identifier",
- value: "IntrinsicElements",
+ value: "foo",
+
+ range: [60, 63],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [63, 64],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "any",
- range: [35, 52],
+ range: [65, 68],
loc: {
- start: { column: 19, line: 2 },
- end: { column: 36, line: 2 },
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
},
},
Punctuator {
type: "Punctuator",
- value: "{",
+ value: ";",
- range: [53, 54],
+ range: [68, 69],
loc: {
- start: { column: 37, line: 2 },
- end: { column: 38, line: 2 },
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
},
},
String {
type: "String",
value: "'foo-bar:baz-bam'",
- range: [59, 76],
+ range: [74, 91],
loc: {
- start: { column: 4, line: 3 },
- end: { column: 21, line: 3 },
+ start: { column: 4, line: 4 },
+ end: { column: 21, line: 4 },
},
},
Punctuator {
type: "Punctuator",
value: ":",
- range: [76, 77],
+ range: [91, 92],
loc: {
- start: { column: 21, line: 3 },
- end: { column: 22, line: 3 },
+ start: { column: 21, line: 4 },
+ end: { column: 22, line: 4 },
},
},
Identifier {
type: "Identifier",
value: "any",
- range: [78, 81],
+ range: [93, 96],
loc: {
- start: { column: 23, line: 3 },
- end: { column: 26, line: 3 },
+ start: { column: 23, line: 4 },
+ end: { column: 26, line: 4 },
},
},
Punctuator {
type: "Punctuator",
value: ";",
- range: [81, 82],
+ range: [96, 97],
loc: {
- start: { column: 26, line: 3 },
- end: { column: 27, line: 3 },
+ start: { column: 26, line: 4 },
+ end: { column: 27, line: 4 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [85, 86],
+ range: [100, 101],
loc: {
- start: { column: 2, line: 4 },
- end: { column: 3, line: 4 },
+ start: { column: 2, line: 5 },
+ end: { column: 3, line: 5 },
},
},
Punctuator {
type: "Punctuator",
value: "}",
- range: [87, 88],
+ range: [102, 103],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [195, 200],
+ loc: {
+ start: { column: 0, line: 9 },
+ end: { column: 5, line: 9 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "componentBasic",
+
+ range: [201, 215],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 20, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [216, 217],
+ loc: {
+ start: { column: 21, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [218, 219],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 24, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "foo",
+
+ range: [219, 222],
+ loc: {
+ start: { column: 24, line: 9 },
+ end: { column: 27, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [223, 224],
+ loc: {
+ start: { column: 28, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [224, 225],
+ loc: {
+ start: { column: 29, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [225, 226],
loc: {
- start: { column: 0, line: 5 },
- end: { column: 1, line: 5 },
+ start: { column: 30, line: 9 },
+ end: { column: 31, line: 9 },
},
},
Keyword {
type: "Keyword",
value: "const",
- range: [90, 95],
+ range: [317, 322],
loc: {
- start: { column: 0, line: 7 },
- end: { column: 5, line: 7 },
+ start: { column: 0, line: 11 },
+ end: { column: 5, line: 11 },
},
},
Identifier {
type: "Identifier",
value: "componentDashed",
- range: [96, 111],
+ range: [323, 338],
loc: {
- start: { column: 6, line: 7 },
- end: { column: 21, line: 7 },
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: "=",
- range: [112, 113],
+ range: [339, 340],
loc: {
- start: { column: 22, line: 7 },
- end: { column: 23, line: 7 },
+ start: { column: 22, line: 11 },
+ end: { column: 23, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: "<",
- range: [114, 115],
+ range: [341, 342],
loc: {
- start: { column: 24, line: 7 },
- end: { column: 25, line: 7 },
+ start: { column: 24, line: 11 },
+ end: { column: 25, line: 11 },
},
},
JSXIdentifier {
type: "JSXIdentifier",
value: "foo-bar",
- range: [115, 122],
+ range: [342, 349],
loc: {
- start: { column: 25, line: 7 },
- end: { column: 32, line: 7 },
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: ":",
- range: [122, 123],
+ range: [349, 350],
loc: {
- start: { column: 32, line: 7 },
- end: { column: 33, line: 7 },
+ start: { column: 32, line: 11 },
+ end: { column: 33, line: 11 },
},
},
JSXIdentifier {
type: "JSXIdentifier",
value: "baz-bam",
- range: [123, 130],
+ range: [350, 357],
loc: {
- start: { column: 33, line: 7 },
- end: { column: 40, line: 7 },
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: "/",
- range: [131, 132],
+ range: [358, 359],
loc: {
- start: { column: 41, line: 7 },
- end: { column: 42, line: 7 },
+ start: { column: 41, line: 11 },
+ end: { column: 42, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: ">",
- range: [132, 133],
+ range: [359, 360],
loc: {
- start: { column: 42, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 42, line: 11 },
+ end: { column: 43, line: 11 },
},
},
Punctuator {
type: "Punctuator",
value: ";",
- range: [133, 134],
+ range: [360, 361],
loc: {
- start: { column: 43, line: 7 },
- end: { column: 44, line: 7 },
+ start: { column: 43, line: 11 },
+ end: { column: 44, line: 11 },
},
},
]
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/5-AST-Alignment-AST.shot
index 9283b97b78d3..eb7b0cfaf14e 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/5-AST-Alignment-AST.shot
@@ -13,112 +13,220 @@ exports[`AST Fixtures jsx JSXNamespacedName component-dashed AST Alignment - AST
body: TSModuleBlock {
type: 'TSModuleBlock',
body: Array [
- ExportNamedDeclaration {
- type: 'ExportNamedDeclaration',
- assertions: Array [],
- declaration: TSInterfaceDeclaration {
- type: 'TSInterfaceDeclaration',
- body: TSInterfaceBody {
- type: 'TSInterfaceBody',
- body: Array [
- TSPropertySignature {
- type: 'TSPropertySignature',
- computed: false,
- key: Literal {
- type: 'Literal',
- raw: '\\'foo-bar:baz-bam\\'',
- value: 'foo-bar:baz-bam',
-
- range: [59, 76],
+ TSInterfaceDeclaration {
+ type: 'TSInterfaceDeclaration',
+ body: TSInterfaceBody {
+ type: 'TSInterfaceBody',
+ body: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [60, 63],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [65, 68],
loc: {
- start: { column: 4, line: 3 },
- end: { column: 21, line: 3 },
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
},
},
- typeAnnotation: TSTypeAnnotation {
- type: 'TSTypeAnnotation',
- typeAnnotation: TSAnyKeyword {
- type: 'TSAnyKeyword',
-
- range: [78, 81],
- loc: {
- start: { column: 23, line: 3 },
- end: { column: 26, line: 3 },
- },
- },
- range: [76, 81],
+ range: [63, 68],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ range: [60, 69],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Literal {
+ type: 'Literal',
+ raw: '\\'foo-bar:baz-bam\\'',
+ value: 'foo-bar:baz-bam',
+
+ range: [74, 91],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [93, 96],
loc: {
- start: { column: 21, line: 3 },
- end: { column: 26, line: 3 },
+ start: { column: 23, line: 4 },
+ end: { column: 26, line: 4 },
},
},
- range: [59, 82],
+ range: [91, 96],
loc: {
- start: { column: 4, line: 3 },
- end: { column: 27, line: 3 },
+ start: { column: 21, line: 4 },
+ end: { column: 26, line: 4 },
},
},
- ],
- range: [53, 86],
- loc: {
- start: { column: 37, line: 2 },
- end: { column: 3, line: 4 },
+ range: [74, 97],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 27, line: 4 },
+ },
},
- },
- id: Identifier {
- type: 'Identifier',
- name: 'IntrinsicElements',
+ ],
- range: [35, 52],
- loc: {
- start: { column: 19, line: 2 },
- end: { column: 36, line: 2 },
- },
+ range: [54, 101],
+ loc: {
+ start: { column: 30, line: 2 },
+ end: { column: 3, line: 5 },
},
+ },
+- declare: false,
+- extends: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'IntrinsicElements',
+- optional: false,
- range: [25, 86],
+ range: [36, 53],
loc: {
- start: { column: 9, line: 2 },
- end: { column: 3, line: 4 },
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
},
},
- exportKind: 'type',
- source: null,
- specifiers: Array [],
- range: [18, 86],
+ range: [26, 101],
loc: {
start: { column: 2, line: 2 },
- end: { column: 3, line: 4 },
+ end: { column: 3, line: 5 },
},
},
],
- range: [14, 88],
+ range: [22, 103],
loc: {
- start: { column: 14, line: 1 },
- end: { column: 1, line: 5 },
+ start: { column: 22, line: 1 },
+ end: { column: 1, line: 6 },
},
},
+ declare: true,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'JSX',
+- optional: false,
- range: [10, 13],
+ range: [18, 21],
loc: {
- start: { column: 10, line: 1 },
- end: { column: 13, line: 1 },
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
},
},
- kind: 'namespace',
- range: [0, 88],
+ range: [0, 103],
loc: {
start: { column: 0, line: 1 },
- end: { column: 1, line: 5 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'componentBasic',
+- optional: false,
+
+ range: [201, 215],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 20, line: 9 },
+ },
+ },
+ init: JSXElement {
+ type: 'JSXElement',
+ children: Array [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: 'JSXOpeningElement',
+ attributes: Array [],
+ name: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'foo',
+
+ range: [219, 222],
+ loc: {
+ start: { column: 24, line: 9 },
+ end: { column: 27, line: 9 },
+ },
+ },
+ selfClosing: true,
+
+ range: [218, 225],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+
+ range: [218, 225],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+
+ range: [201, 225],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [195, 226],
+ loc: {
+ start: { column: 0, line: 9 },
+ end: { column: 31, line: 9 },
},
},
VariableDeclaration {
@@ -126,14 +234,17 @@ exports[`AST Fixtures jsx JSXNamespacedName component-dashed AST Alignment - AST
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'componentDashed',
+- optional: false,
- range: [96, 111],
+ range: [323, 338],
loc: {
- start: { column: 6, line: 7 },
- end: { column: 21, line: 7 },
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
},
},
init: JSXElement {
@@ -149,67 +260,68 @@ exports[`AST Fixtures jsx JSXNamespacedName component-dashed AST Alignment - AST
type: 'JSXIdentifier',
name: 'baz-bam',
- range: [123, 130],
+ range: [350, 357],
loc: {
- start: { column: 33, line: 7 },
- end: { column: 40, line: 7 },
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
},
},
namespace: JSXIdentifier {
type: 'JSXIdentifier',
name: 'foo-bar',
- range: [115, 122],
+ range: [342, 349],
loc: {
- start: { column: 25, line: 7 },
- end: { column: 32, line: 7 },
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
},
},
- range: [115, 130],
+ range: [342, 357],
loc: {
- start: { column: 25, line: 7 },
- end: { column: 40, line: 7 },
+ start: { column: 25, line: 11 },
+ end: { column: 40, line: 11 },
},
},
selfClosing: true,
- range: [114, 133],
+ range: [341, 360],
loc: {
- start: { column: 24, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
},
},
- range: [114, 133],
+ range: [341, 360],
loc: {
- start: { column: 24, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
},
},
- range: [96, 133],
+ range: [323, 360],
loc: {
- start: { column: 6, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 6, line: 11 },
+ end: { column: 43, line: 11 },
},
},
],
+- declare: false,
kind: 'const',
- range: [90, 134],
+ range: [317, 361],
loc: {
- start: { column: 0, line: 7 },
- end: { column: 44, line: 7 },
+ start: { column: 0, line: 11 },
+ end: { column: 44, line: 11 },
},
},
],
sourceType: 'script',
- range: [0, 135],
+ range: [0, 362],
loc: {
start: { column: 0, line: 1 },
- end: { column: 0, line: 8 },
+ end: { column: 0, line: 12 },
},
}"
`;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/6-AST-Alignment-Tokens.shot
index dcc68e747bcc..bae78f1bc5ca 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/6-AST-Alignment-Tokens.shot
@@ -8,42 +8,42 @@ exports[`AST Fixtures jsx JSXNamespacedName component-dashed AST Alignment - Tok
Array [
Identifier {
type: 'Identifier',
- value: 'namespace',
+ value: 'declare',
- range: [0, 9],
+ range: [0, 7],
loc: {
start: { column: 0, line: 1 },
- end: { column: 9, line: 1 },
+ end: { column: 7, line: 1 },
},
},
Identifier {
type: 'Identifier',
- value: 'JSX',
+ value: 'namespace',
- range: [10, 13],
+ range: [8, 17],
loc: {
- start: { column: 10, line: 1 },
- end: { column: 13, line: 1 },
+ start: { column: 8, line: 1 },
+ end: { column: 17, line: 1 },
},
},
- Punctuator {
- type: 'Punctuator',
- value: '{',
+ Identifier {
+ type: 'Identifier',
+ value: 'JSX',
- range: [14, 15],
+ range: [18, 21],
loc: {
- start: { column: 14, line: 1 },
- end: { column: 15, line: 1 },
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
},
},
- Keyword {
- type: 'Keyword',
- value: 'export',
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
- range: [18, 24],
+ range: [22, 23],
loc: {
- start: { column: 2, line: 2 },
- end: { column: 8, line: 2 },
+ start: { column: 22, line: 1 },
+ end: { column: 23, line: 1 },
},
},
- Keyword {
@@ -52,130 +52,250 @@ exports[`AST Fixtures jsx JSXNamespacedName component-dashed AST Alignment - Tok
+ type: 'Identifier',
value: 'interface',
- range: [25, 34],
+ range: [26, 35],
loc: {
- start: { column: 9, line: 2 },
- end: { column: 18, line: 2 },
+ start: { column: 2, line: 2 },
+ end: { column: 11, line: 2 },
},
},
Identifier {
type: 'Identifier',
value: 'IntrinsicElements',
- range: [35, 52],
+ range: [36, 53],
loc: {
- start: { column: 19, line: 2 },
- end: { column: 36, line: 2 },
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
},
},
Punctuator {
type: 'Punctuator',
value: '{',
- range: [53, 54],
+ range: [54, 55],
+ loc: {
+ start: { column: 30, line: 2 },
+ end: { column: 31, line: 2 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'foo',
+
+ range: [60, 63],
loc: {
- start: { column: 37, line: 2 },
- end: { column: 38, line: 2 },
+ start: { column: 4, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [63, 64],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'any',
+
+ range: [65, 68],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [68, 69],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
},
},
String {
type: 'String',
value: '\\'foo-bar:baz-bam\\'',
- range: [59, 76],
+ range: [74, 91],
loc: {
- start: { column: 4, line: 3 },
- end: { column: 21, line: 3 },
+ start: { column: 4, line: 4 },
+ end: { column: 21, line: 4 },
},
},
Punctuator {
type: 'Punctuator',
value: ':',
- range: [76, 77],
+ range: [91, 92],
loc: {
- start: { column: 21, line: 3 },
- end: { column: 22, line: 3 },
+ start: { column: 21, line: 4 },
+ end: { column: 22, line: 4 },
},
},
Identifier {
type: 'Identifier',
value: 'any',
- range: [78, 81],
+ range: [93, 96],
loc: {
- start: { column: 23, line: 3 },
- end: { column: 26, line: 3 },
+ start: { column: 23, line: 4 },
+ end: { column: 26, line: 4 },
},
},
Punctuator {
type: 'Punctuator',
value: ';',
- range: [81, 82],
+ range: [96, 97],
loc: {
- start: { column: 26, line: 3 },
- end: { column: 27, line: 3 },
+ start: { column: 26, line: 4 },
+ end: { column: 27, line: 4 },
},
},
Punctuator {
type: 'Punctuator',
value: '}',
- range: [85, 86],
+ range: [100, 101],
loc: {
- start: { column: 2, line: 4 },
- end: { column: 3, line: 4 },
+ start: { column: 2, line: 5 },
+ end: { column: 3, line: 5 },
},
},
Punctuator {
type: 'Punctuator',
value: '}',
- range: [87, 88],
+ range: [102, 103],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'const',
+
+ range: [195, 200],
+ loc: {
+ start: { column: 0, line: 9 },
+ end: { column: 5, line: 9 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'componentBasic',
+
+ range: [201, 215],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 20, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [216, 217],
+ loc: {
+ start: { column: 21, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [218, 219],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 24, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'foo',
+
+ range: [219, 222],
+ loc: {
+ start: { column: 24, line: 9 },
+ end: { column: 27, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '/',
+
+ range: [223, 224],
+ loc: {
+ start: { column: 28, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [224, 225],
+ loc: {
+ start: { column: 29, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [225, 226],
loc: {
- start: { column: 0, line: 5 },
- end: { column: 1, line: 5 },
+ start: { column: 30, line: 9 },
+ end: { column: 31, line: 9 },
},
},
Keyword {
type: 'Keyword',
value: 'const',
- range: [90, 95],
+ range: [317, 322],
loc: {
- start: { column: 0, line: 7 },
- end: { column: 5, line: 7 },
+ start: { column: 0, line: 11 },
+ end: { column: 5, line: 11 },
},
},
Identifier {
type: 'Identifier',
value: 'componentDashed',
- range: [96, 111],
+ range: [323, 338],
loc: {
- start: { column: 6, line: 7 },
- end: { column: 21, line: 7 },
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
},
},
Punctuator {
type: 'Punctuator',
value: '=',
- range: [112, 113],
+ range: [339, 340],
loc: {
- start: { column: 22, line: 7 },
- end: { column: 23, line: 7 },
+ start: { column: 22, line: 11 },
+ end: { column: 23, line: 11 },
},
},
Punctuator {
type: 'Punctuator',
value: '<',
- range: [114, 115],
+ range: [341, 342],
loc: {
- start: { column: 24, line: 7 },
- end: { column: 25, line: 7 },
+ start: { column: 24, line: 11 },
+ end: { column: 25, line: 11 },
},
},
- Identifier {
@@ -184,20 +304,20 @@ exports[`AST Fixtures jsx JSXNamespacedName component-dashed AST Alignment - Tok
+ type: 'JSXIdentifier',
value: 'foo-bar',
- range: [115, 122],
+ range: [342, 349],
loc: {
- start: { column: 25, line: 7 },
- end: { column: 32, line: 7 },
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
},
},
Punctuator {
type: 'Punctuator',
value: ':',
- range: [122, 123],
+ range: [349, 350],
loc: {
- start: { column: 32, line: 7 },
- end: { column: 33, line: 7 },
+ start: { column: 32, line: 11 },
+ end: { column: 33, line: 11 },
},
},
- Identifier {
@@ -206,40 +326,40 @@ exports[`AST Fixtures jsx JSXNamespacedName component-dashed AST Alignment - Tok
+ type: 'JSXIdentifier',
value: 'baz-bam',
- range: [123, 130],
+ range: [350, 357],
loc: {
- start: { column: 33, line: 7 },
- end: { column: 40, line: 7 },
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
},
},
Punctuator {
type: 'Punctuator',
value: '/',
- range: [131, 132],
+ range: [358, 359],
loc: {
- start: { column: 41, line: 7 },
- end: { column: 42, line: 7 },
+ start: { column: 41, line: 11 },
+ end: { column: 42, line: 11 },
},
},
Punctuator {
type: 'Punctuator',
value: '>',
- range: [132, 133],
+ range: [359, 360],
loc: {
- start: { column: 42, line: 7 },
- end: { column: 43, line: 7 },
+ start: { column: 42, line: 11 },
+ end: { column: 43, line: 11 },
},
},
Punctuator {
type: 'Punctuator',
value: ';',
- range: [133, 134],
+ range: [360, 361],
loc: {
- start: { column: 43, line: 7 },
- end: { column: 44, line: 7 },
+ start: { column: 43, line: 11 },
+ end: { column: 44, line: 11 },
},
},
]"
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot
index 592cbb5dc1af..71bbf93d4942 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [6, 7],
loc: {
@@ -109,6 +112,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [0, 57],
@@ -122,9 +126,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "y",
+ optional: false,
range: [64, 65],
loc: {
@@ -222,6 +229,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [58, 117],
@@ -249,6 +257,9 @@ Program {
end: { column: 9, line: 5 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -282,9 +293,13 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "NamespacePropComponentProps",
+ optional: false,
range: [129, 156],
loc: {
@@ -317,7 +332,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "props",
+ optional: false,
range: [268, 273],
loc: {
@@ -414,11 +431,14 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "NamespacePropComponent",
+ optional: false,
range: [190, 212],
loc: {
@@ -429,14 +449,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "props",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "NamespacePropComponentProps",
+ optional: false,
range: [220, 247],
loc: {
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot
index 805eaa54c240..45ffcb1a2319 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,512 @@
exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ init: JSXElement {
+ type: 'JSXElement',
+ children: Array [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: 'JSXOpeningElement',
+ attributes: Array [
+ JSXAttribute {
+ type: 'JSXAttribute',
+ name: JSXNamespacedName {
+ type: 'JSXNamespacedName',
+ name: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'b',
+
+ range: [36, 37],
+ loc: {
+ start: { column: 36, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ namespace: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'a',
+
+ range: [34, 35],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 35, line: 1 },
+ },
+ },
+
+ range: [34, 37],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ value: Literal {
+ type: 'Literal',
+ raw: '"tight spacing"',
+ value: 'tight spacing',
+
+ range: [38, 53],
+ loc: {
+ start: { column: 38, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+
+ range: [34, 53],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+ ],
+ name: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'NamespacePropComponent',
+
+ range: [11, 33],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 33, line: 1 },
+ },
+ },
+ selfClosing: true,
+
+ range: [10, 56],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+
+ range: [10, 56],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+
+ range: [6, 56],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [0, 57],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 57, line: 1 },
+ },
+ },
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'y',
+- optional: false,
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ init: JSXElement {
+ type: 'JSXElement',
+ children: Array [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: 'JSXOpeningElement',
+ attributes: Array [
+ JSXAttribute {
+ type: 'JSXAttribute',
+ name: JSXNamespacedName {
+ type: 'JSXNamespacedName',
+ name: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'b',
+
+ range: [96, 97],
+ loc: {
+ start: { column: 38, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ namespace: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'a',
+
+ range: [92, 93],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
+ },
+ },
+
+ range: [92, 97],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ value: Literal {
+ type: 'Literal',
+ raw: '"loose spacing"',
+ value: 'loose spacing',
+
+ range: [98, 113],
+ loc: {
+ start: { column: 40, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+
+ range: [92, 113],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+ ],
+ name: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'NamespacePropComponent',
+
+ range: [69, 91],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 33, line: 2 },
+ },
+ },
+ selfClosing: true,
+
+ range: [68, 116],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+
+ range: [68, 116],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+
+ range: [64, 116],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [58, 117],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 59, line: 2 },
+ },
+ },
+ TSInterfaceDeclaration {
+ type: 'TSInterfaceDeclaration',
+ body: TSInterfaceBody {
+ type: 'TSInterfaceBody',
+ body: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Literal {
+ type: 'Literal',
+ raw: '"a:b"',
+ value: 'a:b',
+
+ range: [163, 168],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [170, 176],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [168, 176],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [163, 177],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ ],
+
+ range: [157, 179],
+ loc: {
+ start: { column: 38, line: 4 },
+ end: { column: 1, line: 6 },
+ },
+ },
+- declare: false,
+- extends: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'NamespacePropComponentProps',
+- optional: false,
+
+ range: [129, 156],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+
+ range: [119, 179],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: JSXElement {
+ type: 'JSXElement',
+ children: Array [
+ JSXExpressionContainer {
+ type: 'JSXExpressionContainer',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'props',
+- optional: false,
+
+ range: [268, 273],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '"a:b"',
+ value: 'a:b',
+
+ range: [274, 279],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 28, line: 9 },
+ },
+ },
+
+ range: [268, 280],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+
+ range: [267, 281],
+ loc: {
+ start: { column: 16, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ ],
+ closingElement: JSXClosingElement {
+ type: 'JSXClosingElement',
+ name: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'div',
+
+ range: [283, 286],
+ loc: {
+ start: { column: 32, line: 9 },
+ end: { column: 35, line: 9 },
+ },
+ },
+
+ range: [281, 287],
+ loc: {
+ start: { column: 30, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+ openingElement: JSXOpeningElement {
+ type: 'JSXOpeningElement',
+ attributes: Array [],
+ name: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'div',
+
+ range: [263, 266],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 15, line: 9 },
+ },
+ },
+ selfClosing: false,
+
+ range: [262, 267],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 16, line: 9 },
+ },
+ },
+
+ range: [262, 287],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+
+ range: [255, 288],
+ loc: {
+ start: { column: 4, line: 9 },
+ end: { column: 37, line: 9 },
+ },
+ },
+ ],
+
+ range: [249, 290],
+ loc: {
+ start: { column: 68, line: 8 },
+ end: { column: 1, line: 10 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'NamespacePropComponent',
+- optional: false,
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'props',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'NamespacePropComponentProps',
+- optional: false,
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+
+ range: [218, 247],
+ loc: {
+ start: { column: 37, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+
+ range: [213, 247],
+ loc: {
+ start: { column: 32, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+ ],
+
+ range: [181, 290],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 291],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 11 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/jsx/JSXOpeningElement/spec.ts b/packages/ast-spec/src/jsx/JSXOpeningElement/spec.ts
index 710fade02fa5..1c4ca8af452d 100644
--- a/packages/ast-spec/src/jsx/JSXOpeningElement/spec.ts
+++ b/packages/ast-spec/src/jsx/JSXOpeningElement/spec.ts
@@ -7,7 +7,11 @@ import type { JSXSpreadAttribute } from '../JSXSpreadAttribute/spec';
export interface JSXOpeningElement extends BaseNode {
type: AST_NODE_TYPES.JSXOpeningElement;
- typeParameters?: TSTypeParameterInstantiation;
+ typeArguments: TSTypeParameterInstantiation | undefined;
+
+ /** @deprecated Use {@link `typeArguments`} instead. */
+ typeParameters: TSTypeParameterInstantiation | undefined;
+
selfClosing: boolean;
name: JSXTagNameExpression;
attributes: (JSXAttribute | JSXSpreadAttribute)[];
diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot
index d8e74a7e7faf..a2a4ac637346 100644
--- a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -32,7 +33,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "configurable",
+ optional: false,
range: [90, 102],
loc: {
@@ -58,7 +61,9 @@ Program {
],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [116, 117],
loc: {
@@ -67,6 +72,7 @@ Program {
},
},
kind: "get",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -92,7 +98,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "_x",
+ optional: false,
range: [138, 140],
loc: {
@@ -122,6 +130,7 @@ Program {
end: { column: 3, line: 7 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -148,9 +157,13 @@ Program {
end: { column: 1, line: 8 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Point",
+ optional: false,
range: [79, 84],
loc: {
@@ -158,6 +171,7 @@ Program {
end: { column: 11, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 147],
diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot
index ef60deece6e2..3e8af6cefa6f 100644
--- a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -36,7 +37,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'configurable',
+- optional: false,
range: [90, 102],
loc: {
@@ -62,7 +65,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
range: [116, 117],
loc: {
@@ -71,6 +76,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
},
},
kind: 'get',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -96,7 +102,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: '_x',
+- optional: false,
range: [138, 140],
loc: {
@@ -126,6 +134,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
end: { column: 3, line: 7 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -152,9 +161,13 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
end: { column: 1, line: 8 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Point',
+- optional: false,
range: [79, 84],
loc: {
@@ -162,6 +175,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
end: { column: 11, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 147],
diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot
index 36589a0f64a3..4073209596d1 100644
--- a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -26,7 +27,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [96, 99],
loc: {
@@ -36,6 +39,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: Literal {
type: "Literal",
@@ -66,7 +70,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [90, 93],
loc: {
@@ -92,7 +98,9 @@ Program {
],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [122, 125],
loc: {
@@ -101,6 +109,7 @@ Program {
},
},
kind: "get",
+ optional: false,
override: false,
static: true,
value: FunctionExpression {
@@ -126,7 +135,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "_bar",
+ optional: false,
range: [146, 150],
loc: {
@@ -156,6 +167,7 @@ Program {
end: { column: 3, line: 7 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -182,9 +194,13 @@ Program {
end: { column: 1, line: 8 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Other",
+ optional: false,
range: [79, 84],
loc: {
@@ -192,6 +208,7 @@ Program {
end: { column: 11, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 157],
diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot
index 3235fe1f39ee..2689d71f89b9 100644
--- a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -30,7 +31,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [96, 99],
loc: {
@@ -40,6 +43,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
},
kind: 'init',
method: false,
+- optional: false,
shorthand: false,
value: Literal {
type: 'Literal',
@@ -70,7 +74,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [90, 93],
loc: {
@@ -96,7 +102,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [122, 125],
loc: {
@@ -105,6 +113,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
},
},
kind: 'get',
+- optional: false,
- override: false,
static: true,
value: FunctionExpression {
@@ -130,7 +139,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: '_bar',
+- optional: false,
range: [146, 150],
loc: {
@@ -160,6 +171,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
end: { column: 3, line: 7 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -186,9 +198,13 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
end: { column: 1, line: 8 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Other',
+- optional: false,
range: [79, 84],
loc: {
@@ -196,6 +212,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-fac
end: { column: 11, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 157],
diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/1-TSESTree-AST.shot
index d41b2280b547..01308cfc10d9 100644
--- a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -17,7 +18,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "hidden",
+ optional: false,
range: [86, 92],
loc: {
@@ -35,7 +38,9 @@ Program {
],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "z",
+ optional: false,
range: [99, 100],
loc: {
@@ -44,6 +49,7 @@ Program {
},
},
kind: "get",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -69,7 +75,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "_z",
+ optional: false,
range: [121, 123],
loc: {
@@ -99,6 +107,7 @@ Program {
end: { column: 3, line: 7 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -125,9 +134,13 @@ Program {
end: { column: 1, line: 8 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "P",
+ optional: false,
range: [79, 80],
loc: {
@@ -135,6 +148,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 130],
diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
index 41706b97b2e7..3f92666a6256 100644
--- a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-ins
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -21,7 +22,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-ins
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'hidden',
+- optional: false,
range: [86, 92],
loc: {
@@ -39,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-ins
],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'z',
+- optional: false,
range: [99, 100],
loc: {
@@ -48,6 +53,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-ins
},
},
kind: 'get',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -73,7 +79,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-ins
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: '_z',
+- optional: false,
range: [121, 123],
loc: {
@@ -103,6 +111,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-ins
end: { column: 3, line: 7 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -129,9 +138,13 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-ins
end: { column: 1, line: 8 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'P',
+- optional: false,
range: [79, 80],
loc: {
@@ -139,6 +152,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-ins
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 130],
diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/1-TSESTree-AST.shot
index 533cf3cde41a..b2257234533f 100644
--- a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -17,7 +18,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "adminonly",
+ optional: false,
range: [89, 98],
loc: {
@@ -35,7 +38,9 @@ Program {
],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "y",
+ optional: false,
range: [112, 113],
loc: {
@@ -44,6 +49,7 @@ Program {
},
},
kind: "set",
+ optional: false,
override: false,
static: true,
value: FunctionExpression {
@@ -71,7 +77,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "_y",
+ optional: false,
range: [128, 130],
loc: {
@@ -89,7 +97,9 @@ Program {
operator: "=",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [133, 134],
loc: {
@@ -119,13 +129,16 @@ Program {
end: { column: 3, line: 7 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [114, 115],
loc: {
@@ -156,9 +169,13 @@ Program {
end: { column: 1, line: 8 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "User",
+ optional: false,
range: [79, 83],
loc: {
@@ -166,6 +183,7 @@ Program {
end: { column: 10, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 141],
diff --git a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
index 1ca322e0c3f4..019fc0221c8e 100644
--- a/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-sta
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -21,7 +22,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-sta
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'adminonly',
+- optional: false,
range: [89, 98],
loc: {
@@ -39,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-sta
],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'y',
+- optional: false,
range: [112, 113],
loc: {
@@ -48,6 +53,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-sta
},
},
kind: 'set',
+- optional: false,
- override: false,
static: true,
value: FunctionExpression {
@@ -75,7 +81,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-sta
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: '_y',
+- optional: false,
range: [128, 130],
loc: {
@@ -93,7 +101,9 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-sta
operator: '=',
right: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [133, 134],
loc: {
@@ -123,13 +133,16 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-sta
end: { column: 3, line: 7 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [114, 115],
loc: {
@@ -160,9 +173,13 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-sta
end: { column: 1, line: 8 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'User',
+- optional: false,
range: [79, 83],
loc: {
@@ -170,6 +187,7 @@ exports[`AST Fixtures legacy-fixtures accessor-decorators accessor-decorator-sta
end: { column: 10, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 141],
diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot
index 36cf688cf9d9..27cde7cfb1dc 100644
--- a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 18, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
range: [82, 83],
loc: {
@@ -39,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [84, 85],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot
index 681409dd0ecb..0544e38863cc 100644
--- a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/snapshots/5-AST-Alignment-AST.shot
@@ -21,11 +21,14 @@ exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameter-whitesp
end: { column: 18, line: 3 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'f',
+- optional: false,
range: [82, 83],
loc: {
@@ -43,7 +46,9 @@ exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameter-whitesp
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [84, 85],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot
index 591f2b9207cf..856ad229ef15 100644
--- a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 42, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
range: [82, 83],
loc: {
@@ -57,7 +60,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [84, 85],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot
index 2567fb6d1987..28879c1e23dd 100644
--- a/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/babylon-convergence/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot
@@ -21,11 +21,14 @@ exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameters AST Al
end: { column: 42, line: 3 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'f',
+- optional: false,
range: [82, 83],
loc: {
@@ -61,7 +64,9 @@ exports[`AST Fixtures legacy-fixtures babylon-convergence type-parameters AST Al
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [84, 85],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/fixture.ts
similarity index 100%
rename from packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/fixture.ts
rename to packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/fixture.ts
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..365be7ab31ef
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-constructor Babel - Error 1`] = `"NO ERROR"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..fd0e954ee515
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,11 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-constructor TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | export abstract class AbstractSocket {
+> 4 | abstract constructor();
+ | ^^^^^^^^ 'abstract' modifier can only appear on a class, method, or property declaration.
+ 5 | }
+ 6 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..2015736a7f2b
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-constructor Error Alignment 1`] = `"No errors"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..365be7ab31ef
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-constructor Babel - Error 1`] = `"NO ERROR"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..c2e76b6b75d8
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-constructor Error Alignment 1`] = `"TSESTree errored but Babel didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..6c591d66392a
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-static-constructor Babel - Error 1`] = `[SyntaxError: 'static' modifier cannot be used with 'abstract' modifier. (4:11)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-TSESTree-Error.shot
index bb695d9a0b19..500f8130606a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-static-constructor TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-static-constructor TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | export abstract class AbstractSocket {
+> 4 | abstract static constructor();
+ | ^^^^^^^^ 'abstract' modifier can only appear on a class, method, or property declaration.
+ 5 | }
+ 6 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..37fb30a105a3
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-static-constructor Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/3-Alignment-Error.shot
index 37fb30a105a3..fc418fa8c4bb 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-static-constructor Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-abstract-static-constructor Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..e48b2228671c
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-override-property Babel - Error 1`] = `[SyntaxError: Property 'foo' cannot have an initializer because it is marked abstract. (4:24)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-TSESTree-Error.shot
index 8afa44f7c60b..2c3eef0e00ac 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-override-property TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-override-property TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | abstract class SpecializedComponent extends SomeComponent {
+> 4 | abstract override foo = 1;
+ | ^ Abstract property cannot have an initializer.
+ 5 | }
+ 6 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..6de99caccfc8
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-override-property Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/3-Alignment-Error.shot
index 6de99caccfc8..6afce871c929 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-override-property Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-class-with-override-property Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..67e8635916be
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-interface Babel - Error 1`] = `[SyntaxError: 'abstract' modifier can only appear on a class, method, or property declaration. (3:7)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-TSESTree-Error.shot
index 43e910b9175e..c9a5983adf19 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ abstract-interface TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-interface TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | export abstract interface I {
+ | ^^^^^^^^ 'abstract' modifier can only appear on a class, method, or property declaration.
+ 4 | }"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..15c7f73220aa
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-interface Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/3-Alignment-Error.shot
index 15c7f73220aa..67a613a53ca4 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ abstract-interface Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ abstract-interface Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..6e36fa860668
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ await-without-async-function Babel - Error 1`] = `[SyntaxError: Unexpected reserved word 'await'. (4:14)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..e281e0edf2aa
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ await-without-async-function Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..40321a29047e
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-private-identifier-field-with-accessibility-error Babel - Error 1`] = `[SyntaxError: Private elements cannot have an accessibility modifier ('private'). (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..772471f96e26
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-private-identifier-field-with-accessibility-error Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..e61bb7cf0b49
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-constructor-and-type-parameters Babel - Error 1`] = `[SyntaxError: Type parameters cannot appear on a constructor declaration. (4:13)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..aa6535da513c
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-constructor-and-type-parameters Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..721146dd0f0e
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-export-parameter-properties Babel - Error 1`] = `[SyntaxError: Unexpected keyword 'export'. (4:16)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-TSESTree-Error.shot
index 2eb5b884fbe0..e685ce389b52 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ class-with-export-parameter-properties TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-export-parameter-properties TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | class Foo {
+> 4 | constructor(export a: string) {
+ | ^^^^^^ 'export' modifier cannot appear on a parameter.
+ 5 |
+ 6 | }
+ 7 | }"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..1cc73e1213a0
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-export-parameter-properties Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/3-Alignment-Error.shot
index 1cc73e1213a0..08681e3fc52d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ class-with-export-parameter-properties Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-export-parameter-properties Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..61594867ce5e
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-implements-and-extends Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "," (3:57)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-TSESTree-Error.shot
index 4c8400772794..66677cbe399c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ class-with-implements-and-extends TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-implements-and-extends TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | class ClassWithParentAndInterface implements MyInterface extends MyOtherClass {}
+ | ^^^^^^^^^^^^^^^^^^^^ 'extends' clause must precede 'implements' clause.
+ 4 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..8ca376cb9249
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-implements-and-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/3-Alignment-Error.shot
index 8ca376cb9249..fe9a7f7eec3f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ class-with-implements-and-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-implements-and-extends Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..11599244d24a
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-static-parameter-properties Babel - Error 1`] = `[SyntaxError: Unexpected reserved word 'static'. (4:16)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-TSESTree-Error.shot
index 4a14ecee2002..54b7990c8311 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ class-with-static-parameter-properties TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-static-parameter-properties TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | class Foo {
+> 4 | constructor(static a: string) {
+ | ^^^^^^ 'static' modifier cannot appear on a parameter.
+ 5 |
+ 6 | }
+ 7 | }"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..588fc5dd0366
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-static-parameter-properties Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/3-Alignment-Error.shot
index 588fc5dd0366..d5010c61e433 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ class-with-static-parameter-properties Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-static-parameter-properties Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..060e140c20f5
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-two-methods-computed-constructor Babel - Error 1`] = `[SyntaxError: Type parameters cannot appear on a constructor declaration. (4:15)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..81cc16ee83cf
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ class-with-two-methods-computed-constructor Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..203ef841fa38
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ const-assertions Babel - Error 1`] = `[SyntaxError: Identifier 'x' has already been declared. (13:4)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..a69ed0ed1cdb
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ const-assertions Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..92ac5f9b3f89
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-number Babel - Error 1`] = `[SyntaxError: Unexpected token (4:4)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..9ab87939ed92
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-number Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..54dece81c980
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-string Babel - Error 1`] = `[SyntaxError: Unexpected token (4:4)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..b81dfe8ab3e4
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-string Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..bf5d8d4312fe
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-var-ref Babel - Error 1`] = `[SyntaxError: Unexpected token (4:4)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..d0503e6badc9
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ export-named-enum-computed-var-ref Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..d16d6e9f798d
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ export-with-import-assertions Babel - Error 1`] = `[SyntaxError: A JSON module can only be imported with \`default\`. (3:9)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..a9ca6bf4e92e
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ export-with-import-assertions Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..fb7591e20893
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ import-type-error Babel - Error 1`] = `[SyntaxError: A type-only import can specify a default import or named bindings, but not both. (3:0)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..886a5e2d5b0f
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ import-type-error Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..824f587f17a3
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ interface-with-construct-signature-with-parameter-accessibility Babel - Error 1`] = `[SyntaxError: A parameter property is only allowed in a constructor implementation. (4:9)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-TSESTree-Error.shot
index fda3178b2721..db761981b7e1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ interface-with-construct-signature-with-parameter-accessibility TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ interface-with-construct-signature-with-parameter-accessibility TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Test {
+> 4 | new (public x, private y);
+ | ^^^^^^ A parameter property is only allowed in a constructor implementation.
+ 5 | }
+ 6 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..d39bd1e45e7d
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ interface-with-construct-signature-with-parameter-accessibility Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/3-Alignment-Error.shot
index d39bd1e45e7d..f863933783d5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures basics _error_ interface-with-construct-signature-with-parameter-accessibility Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures basics _error_ interface-with-construct-signature-with-parameter-accessibility Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..613bd109ceaa
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ new-target-in-arrow-function-body Babel - Error 1`] = `[SyntaxError: \`new.target\` can only be used in functions or class properties. (3:16)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..af2bc132861b
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ new-target-in-arrow-function-body Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..86beac1b20b5
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ var-with-definite-assignment Babel - Error 1`] = `[SyntaxError: Missing initializer in const declaration. (3:16)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..3dcc38e06038
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics _error_ var-with-definite-assignment Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/1-TSESTree-AST.shot
deleted file mode 100644
index 517f8d05bce7..000000000000
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/1-TSESTree-AST.shot
+++ /dev/null
@@ -1,99 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor TSESTree - AST 1`] = `
-Program {
- type: "Program",
- body: [
- ExportNamedDeclaration {
- type: "ExportNamedDeclaration",
- assertions: [],
- declaration: ClassDeclaration {
- type: "ClassDeclaration",
- abstract: true,
- body: ClassBody {
- type: "ClassBody",
- body: [
- TSAbstractMethodDefinition {
- type: "TSAbstractMethodDefinition",
- computed: false,
- key: Identifier {
- type: "Identifier",
- name: "constructor",
-
- range: [123, 134],
- loc: {
- start: { column: 11, line: 4 },
- end: { column: 22, line: 4 },
- },
- },
- kind: "constructor",
- override: false,
- static: false,
- value: TSEmptyBodyFunctionExpression {
- type: "TSEmptyBodyFunctionExpression",
- async: false,
- body: null,
- expression: false,
- generator: false,
- id: null,
- params: [],
-
- range: [134, 137],
- loc: {
- start: { column: 22, line: 4 },
- end: { column: 25, line: 4 },
- },
- },
-
- range: [114, 137],
- loc: {
- start: { column: 2, line: 4 },
- end: { column: 25, line: 4 },
- },
- },
- ],
-
- range: [110, 139],
- loc: {
- start: { column: 37, line: 3 },
- end: { column: 1, line: 5 },
- },
- },
- id: Identifier {
- type: "Identifier",
- name: "AbstractSocket",
-
- range: [95, 109],
- loc: {
- start: { column: 22, line: 3 },
- end: { column: 36, line: 3 },
- },
- },
- superClass: null,
-
- range: [80, 139],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 1, line: 5 },
- },
- },
- exportKind: "value",
- source: null,
- specifiers: [],
-
- range: [73, 139],
- loc: {
- start: { column: 0, line: 3 },
- end: { column: 1, line: 5 },
- },
- },
- ],
- sourceType: "module",
-
- range: [73, 140],
- loc: {
- start: { column: 0, line: 3 },
- end: { column: 0, line: 6 },
- },
-}
-`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/2-TSESTree-Tokens.shot
deleted file mode 100644
index efedccbc0602..000000000000
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/2-TSESTree-Tokens.shot
+++ /dev/null
@@ -1,116 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor TSESTree - Tokens 1`] = `
-[
- Keyword {
- type: "Keyword",
- value: "export",
-
- range: [73, 79],
- loc: {
- start: { column: 0, line: 3 },
- end: { column: 6, line: 3 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "abstract",
-
- range: [80, 88],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 15, line: 3 },
- },
- },
- Keyword {
- type: "Keyword",
- value: "class",
-
- range: [89, 94],
- loc: {
- start: { column: 16, line: 3 },
- end: { column: 21, line: 3 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "AbstractSocket",
-
- range: [95, 109],
- loc: {
- start: { column: 22, line: 3 },
- end: { column: 36, line: 3 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "{",
-
- range: [110, 111],
- loc: {
- start: { column: 37, line: 3 },
- end: { column: 38, line: 3 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "abstract",
-
- range: [114, 122],
- loc: {
- start: { column: 2, line: 4 },
- end: { column: 10, line: 4 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "constructor",
-
- range: [123, 134],
- loc: {
- start: { column: 11, line: 4 },
- end: { column: 22, line: 4 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "(",
-
- range: [134, 135],
- loc: {
- start: { column: 22, line: 4 },
- end: { column: 23, line: 4 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ")",
-
- range: [135, 136],
- loc: {
- start: { column: 23, line: 4 },
- end: { column: 24, line: 4 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ";",
-
- range: [136, 137],
- loc: {
- start: { column: 24, line: 4 },
- end: { column: 25, line: 4 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "}",
-
- range: [138, 139],
- loc: {
- start: { column: 0, line: 5 },
- end: { column: 1, line: 5 },
- },
- },
-]
-`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/3-Babel-AST.shot
deleted file mode 100644
index a53c2df0e583..000000000000
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/3-Babel-AST.shot
+++ /dev/null
@@ -1,98 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor Babel - AST 1`] = `
-Program {
- type: "Program",
- body: [
- ExportNamedDeclaration {
- type: "ExportNamedDeclaration",
- assertions: [],
- declaration: ClassDeclaration {
- type: "ClassDeclaration",
- abstract: true,
- body: ClassBody {
- type: "ClassBody",
- body: [
- MethodDefinition {
- type: "MethodDefinition",
- abstract: true,
- computed: false,
- key: Identifier {
- type: "Identifier",
- name: "constructor",
-
- range: [123, 134],
- loc: {
- start: { column: 11, line: 4 },
- end: { column: 22, line: 4 },
- },
- },
- kind: "constructor",
- static: false,
- value: FunctionExpression {
- type: "FunctionExpression",
- async: false,
- expression: false,
- generator: false,
- id: null,
- params: [],
-
- range: [134, 137],
- loc: {
- start: { column: 22, line: 4 },
- end: { column: 25, line: 4 },
- },
- },
-
- range: [114, 137],
- loc: {
- start: { column: 2, line: 4 },
- end: { column: 25, line: 4 },
- },
- },
- ],
-
- range: [110, 139],
- loc: {
- start: { column: 37, line: 3 },
- end: { column: 1, line: 5 },
- },
- },
- id: Identifier {
- type: "Identifier",
- name: "AbstractSocket",
-
- range: [95, 109],
- loc: {
- start: { column: 22, line: 3 },
- end: { column: 36, line: 3 },
- },
- },
- superClass: null,
-
- range: [80, 139],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 1, line: 5 },
- },
- },
- exportKind: "value",
- source: null,
- specifiers: [],
-
- range: [73, 139],
- loc: {
- start: { column: 0, line: 3 },
- end: { column: 1, line: 5 },
- },
- },
- ],
- sourceType: "module",
-
- range: [73, 140],
- loc: {
- start: { column: 0, line: 3 },
- end: { column: 0, line: 6 },
- },
-}
-`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/4-Babel-Tokens.shot
deleted file mode 100644
index a495e97a9ca7..000000000000
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/4-Babel-Tokens.shot
+++ /dev/null
@@ -1,116 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor Babel - Tokens 1`] = `
-[
- Keyword {
- type: "Keyword",
- value: "export",
-
- range: [73, 79],
- loc: {
- start: { column: 0, line: 3 },
- end: { column: 6, line: 3 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "abstract",
-
- range: [80, 88],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 15, line: 3 },
- },
- },
- Keyword {
- type: "Keyword",
- value: "class",
-
- range: [89, 94],
- loc: {
- start: { column: 16, line: 3 },
- end: { column: 21, line: 3 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "AbstractSocket",
-
- range: [95, 109],
- loc: {
- start: { column: 22, line: 3 },
- end: { column: 36, line: 3 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "{",
-
- range: [110, 111],
- loc: {
- start: { column: 37, line: 3 },
- end: { column: 38, line: 3 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "abstract",
-
- range: [114, 122],
- loc: {
- start: { column: 2, line: 4 },
- end: { column: 10, line: 4 },
- },
- },
- Identifier {
- type: "Identifier",
- value: "constructor",
-
- range: [123, 134],
- loc: {
- start: { column: 11, line: 4 },
- end: { column: 22, line: 4 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "(",
-
- range: [134, 135],
- loc: {
- start: { column: 22, line: 4 },
- end: { column: 23, line: 4 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ")",
-
- range: [135, 136],
- loc: {
- start: { column: 23, line: 4 },
- end: { column: 24, line: 4 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: ";",
-
- range: [136, 137],
- loc: {
- start: { column: 24, line: 4 },
- end: { column: 25, line: 4 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "}",
-
- range: [138, 139],
- loc: {
- start: { column: 0, line: 5 },
- end: { column: 1, line: 5 },
- },
- },
-]
-`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/5-AST-Alignment-AST.shot
deleted file mode 100644
index d6d511ccbfdd..000000000000
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/5-AST-Alignment-AST.shot
+++ /dev/null
@@ -1,108 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor AST Alignment - AST 1`] = `
-"Snapshot Diff:
-- TSESTree
-+ Babel
-
- Program {
- type: 'Program',
- body: Array [
- ExportNamedDeclaration {
- type: 'ExportNamedDeclaration',
- assertions: Array [],
- declaration: ClassDeclaration {
- type: 'ClassDeclaration',
- abstract: true,
- body: ClassBody {
- type: 'ClassBody',
- body: Array [
-- TSAbstractMethodDefinition {
-- type: 'TSAbstractMethodDefinition',
-+ MethodDefinition {
-+ type: 'MethodDefinition',
-+ abstract: true,
- computed: false,
- key: Identifier {
- type: 'Identifier',
- name: 'constructor',
-
- range: [123, 134],
- loc: {
- start: { column: 11, line: 4 },
- end: { column: 22, line: 4 },
- },
- },
- kind: 'constructor',
-- override: false,
- static: false,
-- value: TSEmptyBodyFunctionExpression {
-- type: 'TSEmptyBodyFunctionExpression',
-+ value: FunctionExpression {
-+ type: 'FunctionExpression',
- async: false,
-- body: null,
- expression: false,
- generator: false,
- id: null,
- params: Array [],
-
- range: [134, 137],
- loc: {
- start: { column: 22, line: 4 },
- end: { column: 25, line: 4 },
- },
- },
-
- range: [114, 137],
- loc: {
- start: { column: 2, line: 4 },
- end: { column: 25, line: 4 },
- },
- },
- ],
-
- range: [110, 139],
- loc: {
- start: { column: 37, line: 3 },
- end: { column: 1, line: 5 },
- },
- },
- id: Identifier {
- type: 'Identifier',
- name: 'AbstractSocket',
-
- range: [95, 109],
- loc: {
- start: { column: 22, line: 3 },
- end: { column: 36, line: 3 },
- },
- },
- superClass: null,
-
- range: [80, 139],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 1, line: 5 },
- },
- },
- exportKind: 'value',
- source: null,
- specifiers: Array [],
-
- range: [73, 139],
- loc: {
- start: { column: 0, line: 3 },
- end: { column: 1, line: 5 },
- },
- },
- ],
- sourceType: 'module',
-
- range: [73, 140],
- loc: {
- start: { column: 0, line: 3 },
- end: { column: 0, line: 6 },
- },
- }"
-`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/6-AST-Alignment-Tokens.shot
deleted file mode 100644
index b5d33dfde119..000000000000
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/snapshots/6-AST-Alignment-Tokens.shot
+++ /dev/null
@@ -1,6 +0,0 @@
-// Jest Snapshot v1, https://goo.gl/fbAQLP
-
-exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-constructor AST Alignment - Token 1`] = `
-"Snapshot Diff:
-Compared values have no visual difference."
-`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot
index 7f16295a0ea1..d9de87c19aa4 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,12 @@ Program {
TSAbstractMethodDefinition {
type: "TSAbstractMethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "createSocket",
+ optional: false,
range: [123, 135],
loc: {
@@ -27,12 +30,14 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: TSEmptyBodyFunctionExpression {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -41,17 +46,7 @@ Program {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Promise",
-
- range: [139, 146],
- loc: {
- start: { column: 27, line: 4 },
- end: { column: 34, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSStringKeyword {
@@ -71,6 +66,18 @@ Program {
end: { column: 42, line: 4 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Promise",
+ optional: false,
+
+ range: [139, 146],
+ loc: {
+ start: { column: 27, line: 4 },
+ end: { column: 34, line: 4 },
+ },
+ },
range: [139, 154],
loc: {
@@ -107,9 +114,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "AbstractSocket",
+ optional: false,
range: [95, 109],
loc: {
@@ -117,6 +128,7 @@ Program {
end: { column: 36, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [80, 157],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot
index cc059ebdd976..0ab1de91b9ec 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/snapshots/5-AST-Alignment-AST.shot
@@ -23,9 +23,12 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
+ type: 'MethodDefinition',
+ abstract: true,
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'createSocket',
+- optional: false,
range: [123, 135],
loc: {
@@ -34,6 +37,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
- value: TSEmptyBodyFunctionExpression {
@@ -42,6 +46,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -50,17 +55,18 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'Promise',
-
- range: [139, 146],
- loc: {
- start: { column: 27, line: 4 },
- end: { column: 34, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Promise',
++
++ range: [139, 146],
++ loc: {
++ start: { column: 27, line: 4 },
++ end: { column: 34, line: 4 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSStringKeyword {
@@ -78,6 +84,18 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
loc: {
start: { column: 34, line: 4 },
end: { column: 42, line: 4 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Promise',
+- optional: false,
+-
+- range: [139, 146],
+- loc: {
+- start: { column: 27, line: 4 },
+- end: { column: 34, line: 4 },
},
},
@@ -116,9 +134,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'AbstractSocket',
+- optional: false,
range: [95, 109],
loc: {
@@ -126,6 +148,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-method
end: { column: 36, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [80, 157],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/1-TSESTree-AST.shot
index 6c1840dc9e49..b8501ee7b5bf 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/1-TSESTree-AST.shot
@@ -14,9 +14,13 @@ Program {
type: "TSAbstractPropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [105, 108],
loc: {
@@ -24,7 +28,9 @@ Program {
end: { column: 14, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -38,9 +44,13 @@ Program {
type: "TSAbstractPropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [121, 124],
loc: {
@@ -48,7 +58,9 @@ Program {
end: { column: 14, line: 5 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -84,9 +96,13 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [88, 91],
loc: {
@@ -94,6 +110,7 @@ Program {
end: { column: 18, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 135],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/5-AST-Alignment-AST.shot
index 4989b7b35d17..4948c148db43 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/snapshots/5-AST-Alignment-AST.shot
@@ -21,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-proper
+ abstract: true,
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [105, 108],
loc: {
@@ -31,7 +35,9 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-proper
end: { column: 14, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -48,9 +54,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-proper
+ abstract: true,
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [121, 124],
loc: {
@@ -58,7 +68,9 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-proper
end: { column: 14, line: 5 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -94,9 +106,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-proper
end: { column: 1, line: 6 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [88, 91],
loc: {
@@ -104,6 +120,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-proper
end: { column: 18, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 135],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/1-TSESTree-AST.shot
index 9fad85e674fc..8fd609599458 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/1-TSESTree-AST.shot
@@ -15,9 +15,13 @@ Program {
accessibility: "public",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [121, 124],
loc: {
@@ -25,6 +29,7 @@ Program {
end: { column: 30, line: 4 },
},
},
+ optional: false,
override: false,
readonly: true,
static: false,
@@ -62,9 +67,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [88, 91],
loc: {
@@ -72,6 +81,7 @@ Program {
end: { column: 18, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 135],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/5-AST-Alignment-AST.shot
index c7d5ecccd101..ee46582f5bd3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/snapshots/5-AST-Alignment-AST.shot
@@ -22,9 +22,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-readon
accessibility: 'public',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [121, 124],
loc: {
@@ -32,6 +36,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-readon
end: { column: 30, line: 4 },
},
},
+- optional: false,
- override: false,
readonly: true,
static: false,
@@ -69,9 +74,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-readon
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [88, 91],
loc: {
@@ -79,6 +88,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-abstract-readon
end: { column: 18, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 135],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/1-TSESTree-AST.shot
index fd55179386c5..a96aff8a9774 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/1-TSESTree-AST.shot
@@ -14,9 +14,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop1",
+ optional: false,
range: [118, 123],
loc: {
@@ -24,7 +28,9 @@ Program {
end: { column: 15, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -56,9 +62,13 @@ Program {
type: "TSAbstractPropertyDefinition",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop2",
+ optional: false,
range: [152, 157],
loc: {
@@ -66,7 +76,9 @@ Program {
end: { column: 24, line: 5 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -99,9 +111,13 @@ Program {
accessibility: "public",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop3",
+ optional: false,
range: [193, 198],
loc: {
@@ -109,7 +125,9 @@ Program {
end: { column: 31, line: 6 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -141,9 +159,13 @@ Program {
type: "TSAbstractPropertyDefinition",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop4",
+ optional: false,
range: [236, 241],
loc: {
@@ -151,6 +173,7 @@ Program {
end: { column: 33, line: 7 },
},
},
+ optional: false,
override: false,
readonly: true,
static: false,
@@ -185,9 +208,13 @@ Program {
accessibility: "public",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop5",
+ optional: false,
range: [286, 291],
loc: {
@@ -195,6 +222,7 @@ Program {
end: { column: 40, line: 8 },
},
},
+ optional: false,
override: false,
readonly: true,
static: false,
@@ -232,9 +260,13 @@ Program {
end: { column: 1, line: 9 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "AbstractDeclProps",
+ optional: false,
range: [88, 105],
loc: {
@@ -242,6 +274,7 @@ Program {
end: { column: 32, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 302],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot
index e96ac30a3b55..74e0cfac27b5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot
@@ -18,9 +18,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
type: 'PropertyDefinition',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop1',
+- optional: false,
range: [118, 123],
loc: {
@@ -28,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
end: { column: 15, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -63,9 +69,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
+ abstract: true,
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop2',
+- optional: false,
range: [152, 157],
loc: {
@@ -73,7 +83,9 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
end: { column: 24, line: 5 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -109,9 +121,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
accessibility: 'public',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop3',
+- optional: false,
range: [193, 198],
loc: {
@@ -119,7 +135,9 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
end: { column: 31, line: 6 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -154,9 +172,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
+ abstract: true,
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop4',
+- optional: false,
range: [236, 241],
loc: {
@@ -164,6 +186,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
end: { column: 33, line: 7 },
},
},
+- optional: false,
- override: false,
readonly: true,
static: false,
@@ -201,9 +224,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
accessibility: 'public',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop5',
+- optional: false,
range: [286, 291],
loc: {
@@ -211,6 +238,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
end: { column: 40, line: 8 },
},
},
+- optional: false,
- override: false,
readonly: true,
static: false,
@@ -248,9 +276,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
end: { column: 1, line: 9 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'AbstractDeclProps',
+- optional: false,
range: [88, 105],
loc: {
@@ -258,6 +290,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-declare-propert
end: { column: 32, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 302],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot
index 36e577536e3b..391e52d7197a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "createSocket",
+ optional: false,
range: [114, 126],
loc: {
@@ -34,6 +37,7 @@ Program {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -42,17 +46,7 @@ Program {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Promise",
-
- range: [131, 138],
- loc: {
- start: { column: 19, line: 4 },
- end: { column: 26, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSStringKeyword {
@@ -72,6 +66,18 @@ Program {
end: { column: 34, line: 4 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Promise",
+ optional: false,
+
+ range: [131, 138],
+ loc: {
+ start: { column: 19, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
range: [131, 146],
loc: {
@@ -108,9 +114,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "AbstractSocket",
+ optional: false,
range: [95, 109],
loc: {
@@ -118,6 +128,7 @@ Program {
end: { column: 36, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [80, 149],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot
index ea291f87cbe6..b706fb052fb7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,12 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'createSocket',
+- optional: false,
range: [114, 126],
loc: {
@@ -40,6 +43,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -48,17 +52,18 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'Promise',
-
- range: [131, 138],
- loc: {
- start: { column: 19, line: 4 },
- end: { column: 26, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Promise',
++
++ range: [131, 138],
++ loc: {
++ start: { column: 19, line: 4 },
++ end: { column: 26, line: 4 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSStringKeyword {
@@ -78,7 +83,19 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
end: { column: 34, line: 4 },
},
},
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Promise',
+- optional: false,
+- range: [131, 138],
+- loc: {
+- start: { column: 19, line: 4 },
+- end: { column: 26, line: 4 },
+- },
+- },
+-
range: [131, 146],
loc: {
start: { column: 19, line: 4 },
@@ -114,9 +131,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'AbstractSocket',
+- optional: false,
range: [95, 109],
loc: {
@@ -124,6 +145,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-optional-method
end: { column: 36, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [80, 149],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/1-TSESTree-AST.shot
index a8f2d099a999..c1365d8d10e7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/1-TSESTree-AST.shot
@@ -13,9 +13,12 @@ Program {
TSAbstractMethodDefinition {
type: "TSAbstractMethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "show",
+ optional: false,
range: [153, 157],
loc: {
@@ -24,12 +27,14 @@ Program {
},
},
kind: "method",
+ optional: false,
override: true,
static: false,
value: TSEmptyBodyFunctionExpression {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -56,9 +61,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "SpecializedComponent",
+ optional: false,
range: [88, 108],
loc: {
@@ -66,9 +75,12 @@ Program {
end: { column: 35, line: 3 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "SomeComponent",
+ optional: false,
range: [117, 130],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/5-AST-Alignment-AST.shot
index a2123358d04c..ef2f2ca4f2ce 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/abstract-class-with-override-method/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,12 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method
+ type: 'MethodDefinition',
+ abstract: true,
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'show',
+- optional: false,
range: [153, 157],
loc: {
@@ -31,6 +34,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method
},
},
kind: 'method',
+- optional: false,
override: true,
static: false,
- value: TSEmptyBodyFunctionExpression {
@@ -39,6 +43,7 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -65,9 +70,13 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'SpecializedComponent',
+- optional: false,
range: [88, 108],
loc: {
@@ -75,9 +84,12 @@ exports[`AST Fixtures legacy-fixtures basics abstract-class-with-override-method
end: { column: 35, line: 3 },
},
},
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'SomeComponent',
+- optional: false,
range: [117, 130],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/1-TSESTree-AST.shot
index 66dc57f9ca40..e11949b56e68 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "asserted2",
+ optional: false,
range: [77, 86],
loc: {
@@ -31,7 +34,9 @@ Program {
type: "ReturnStatement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "n",
+ optional: false,
range: [111, 112],
loc: {
@@ -60,7 +65,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "n",
+ optional: false,
range: [95, 96],
loc: {
@@ -100,6 +107,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [73, 117],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/5-AST-Alignment-AST.shot
index 59f0d0c3ecd1..54b416cc3589 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,131 @@
exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion-arrow-function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'asserted2',
+- optional: false,
+
+ range: [77, 86],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ init: TSTypeAssertion {
+ type: 'TSTypeAssertion',
+ expression: ArrowFunctionExpression {
+ type: 'ArrowFunctionExpression',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'n',
+- optional: false,
+
+ range: [111, 112],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [104, 113],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+ ],
+
+ range: [100, 115],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ expression: false,
+ generator: false,
+ id: null,
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'n',
+- optional: false,
+
+ range: [95, 96],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ ],
+
+ range: [95, 115],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [90, 93],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [89, 116],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 2, line: 5 },
+ },
+ },
+
+ range: [77, 116],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 2, line: 5 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [73, 117],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 3, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 118],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/1-TSESTree-AST.shot
index cfebc39d3f1f..0ac4e6b2c8cd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -56,6 +59,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [73, 92],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/5-AST-Alignment-AST.shot
index bebd2e1766fb..84875d060dd9 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,83 @@
exports[`AST Fixtures legacy-fixtures basics angle-bracket-type-assertion AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [79, 82],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ init: TSTypeAssertion {
+ type: 'TSTypeAssertion',
+ expression: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [90, 91],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [86, 89],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+
+ range: [85, 91],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [79, 91],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 93],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/1-TSESTree-AST.shot
index f48e3a539804..5343015ddd2a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/1-TSESTree-AST.shot
@@ -16,7 +16,9 @@ Program {
type: "BinaryExpression",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "k",
+ optional: false,
range: [82, 83],
loc: {
@@ -49,6 +51,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "k",
optional: true,
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/5-AST-Alignment-AST.shot
index ca850e742148..bbd26b80e712 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,99 @@
exports[`AST Fixtures legacy-fixtures basics arrow-function-with-optional-parameter AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: ArrowFunctionExpression {
+ type: 'ArrowFunctionExpression',
+ async: false,
+ body: BinaryExpression {
+ type: 'BinaryExpression',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'k',
+- optional: false,
+
+ range: [82, 83],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+ operator: '+',
+ right: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [86, 87],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [82, 87],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ expression: true,
+ generator: false,
+ id: null,
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'k',
+ optional: true,
+
+ range: [75, 77],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 4, line: 3 },
+ },
+ },
+ ],
+
+ range: [74, 87],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ optional: false,
+
+ range: [73, 90],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot
index c86c5ea688a7..c417079cd497 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/1-TSESTree-AST.shot
@@ -16,7 +16,9 @@ Program {
type: "ReturnStatement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [100, 101],
loc: {
@@ -45,14 +47,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [80, 81],
loc: {
@@ -88,7 +94,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [84, 85],
loc: {
@@ -119,7 +127,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [74, 75],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
index 7f4ad90fdb0d..4d9cc58af3a5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
@@ -20,7 +20,9 @@ exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters
type: 'ReturnStatement',
argument: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [100, 101],
loc: {
@@ -49,14 +51,18 @@ exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [80, 81],
loc: {
@@ -92,7 +98,9 @@ exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [84, 85],
loc: {
@@ -123,7 +131,9 @@ exports[`AST Fixtures legacy-fixtures basics arrow-function-with-type-parameters
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'X',
+- optional: false,
-
- range: [74, 75],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/1-TSESTree-AST.shot
index a0bf4fc41ac5..acff3916587c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/1-TSESTree-AST.shot
@@ -22,11 +22,14 @@ Program {
end: { column: 25, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "test",
+ optional: false,
range: [89, 93],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/5-AST-Alignment-AST.shot
index 6db212a60497..cf09dbcceea3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-expression/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,75 @@
exports[`AST Fixtures legacy-fixtures basics async-function-expression AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: FunctionExpression {
+ type: 'FunctionExpression',
+ async: true,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [96, 98],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 25, line: 3 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'test',
+- optional: false,
+
+ range: [89, 93],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ params: Array [],
+
+ range: [74, 98],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 25, line: 3 },
+ },
+ },
+ optional: false,
+
+ range: [73, 101],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+
+ range: [73, 102],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 103],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/1-TSESTree-AST.shot
index 954ff56842f1..e0143b85dbbb 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/1-TSESTree-AST.shot
@@ -15,9 +15,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [103, 106],
loc: {
@@ -44,6 +47,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [99, 115],
@@ -57,9 +61,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [122, 125],
loc: {
@@ -86,6 +93,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [118, 134],
@@ -99,9 +107,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "fooBar",
+ optional: false,
range: [143, 149],
loc: {
@@ -128,6 +139,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [137, 161],
@@ -144,11 +156,14 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "test",
+ optional: false,
range: [88, 92],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/5-AST-Alignment-AST.shot
index f37f21626ebf..d97c7ec99c25 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,194 @@
exports[`AST Fixtures legacy-fixtures basics async-function-with-var-declaration AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: true,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [103, 106],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '\\'foo\\'',
+ value: 'foo',
+
+ range: [109, 114],
+ loc: {
+ start: { column: 12, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+
+ range: [103, 114],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [99, 115],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 18, line: 4 },
+ },
+ },
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [122, 125],
+ loc: {
+ start: { column: 6, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '\\'bar\\'',
+ value: 'bar',
+
+ range: [128, 133],
+ loc: {
+ start: { column: 12, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [122, 133],
+ loc: {
+ start: { column: 6, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [118, 134],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fooBar',
+- optional: false,
+
+ range: [143, 149],
+ loc: {
+ start: { column: 8, line: 6 },
+ end: { column: 14, line: 6 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '\\'fooBar\\'',
+ value: 'fooBar',
+
+ range: [152, 160],
+ loc: {
+ start: { column: 17, line: 6 },
+ end: { column: 25, line: 6 },
+ },
+ },
+
+ range: [143, 160],
+ loc: {
+ start: { column: 8, line: 6 },
+ end: { column: 25, line: 6 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [137, 161],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 26, line: 6 },
+ },
+ },
+ ],
+
+ range: [95, 163],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 1, line: 7 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'test',
+- optional: false,
+
+ range: [88, 92],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ params: Array [],
+
+ range: [73, 163],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 7 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 164],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 8 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot
index dae801b4eb5a..6313e008f58a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -24,7 +27,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -78,7 +83,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [89, 90],
loc: {
@@ -114,7 +121,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -168,7 +177,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [119, 120],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot
index a60f0ce742c7..98fb9a320218 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures-with-generics/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics AST A
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [78, 81],
loc: {
@@ -29,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics AST A
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -84,7 +89,9 @@ exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics AST A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [89, 90],
- loc: {
@@ -122,7 +129,9 @@ exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics AST A
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -177,7 +186,9 @@ exports[`AST Fixtures legacy-fixtures basics call-signatures-with-generics AST A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [119, 120],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/1-TSESTree-AST.shot
index 0add00e20a12..9f701dde2461 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -24,7 +27,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -81,7 +86,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/5-AST-Alignment-AST.shot
index 33b93128e072..2710a0bc2020 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/call-signatures/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures basics call-signatures AST Alignment - AST
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [78, 81],
loc: {
@@ -29,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics call-signatures AST Alignment - AST
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -88,7 +93,9 @@ exports[`AST Fixtures legacy-fixtures basics call-signatures AST Alignment - AST
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/1-TSESTree-AST.shot
index 2a7238338d75..0b739dd9aa9f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
type: "BinaryExpression",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [74, 75],
loc: {
@@ -23,7 +25,9 @@ Program {
operator: "<",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "y",
+ optional: false,
range: [78, 79],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/5-AST-Alignment-AST.shot
index 5a48762a7337..dcef318b25b7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-expression/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,80 @@
exports[`AST Fixtures legacy-fixtures basics cast-as-expression AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TSAsExpression {
+ type: 'TSAsExpression',
+ expression: BinaryExpression {
+ type: 'BinaryExpression',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [74, 75],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 2, line: 3 },
+ },
+ },
+ operator: '<',
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'y',
+- optional: false,
+
+ range: [78, 79],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 6, line: 3 },
+ },
+ },
+
+ range: [74, 79],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 6, line: 3 },
+ },
+ },
+ typeAnnotation: TSBooleanKeyword {
+ type: 'TSBooleanKeyword',
+
+ range: [84, 91],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 93],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/1-TSESTree-AST.shot
index 62a17423cc58..9c68eb96907e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
type: "TSAsExpression",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [74, 75],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/5-AST-Alignment-AST.shot
index a4c620a74b81..70b1609db0fe 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi-assign/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,97 @@
exports[`AST Fixtures legacy-fixtures basics cast-as-multi-assign AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AssignmentExpression {
+ type: 'AssignmentExpression',
+ left: TSAsExpression {
+ type: 'TSAsExpression',
+ expression: TSAsExpression {
+ type: 'TSAsExpression',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [74, 75],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 2, line: 3 },
+ },
+ },
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [79, 85],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ range: [74, 85],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [89, 92],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+
+ range: [74, 92],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ operator: '=',
+ right: Literal {
+ type: 'Literal',
+ raw: '42',
+ value: 42,
+
+ range: [96, 98],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 25, line: 3 },
+ },
+ },
+
+ range: [73, 98],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 25, line: 3 },
+ },
+ },
+
+ range: [73, 99],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 100],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/1-TSESTree-AST.shot
index a5279df235df..bbe6bf88a4f8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
type: "TSAsExpression",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [73, 74],
loc: {
@@ -40,7 +42,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [85, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/5-AST-Alignment-AST.shot
index 38599adfe7fa..7705dd06189e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-multi/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,88 @@
exports[`AST Fixtures legacy-fixtures basics cast-as-multi AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TSAsExpression {
+ type: 'TSAsExpression',
+ expression: TSAsExpression {
+ type: 'TSAsExpression',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [73, 74],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [73, 81],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'T',
+- optional: false,
+
+ range: [85, 86],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [85, 86],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [73, 86],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [73, 87],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 88],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/1-TSESTree-AST.shot
index d18ab49c7114..47510cad5857 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/1-TSESTree-AST.shot
@@ -10,7 +10,9 @@ Program {
type: "BinaryExpression",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [73, 74],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/5-AST-Alignment-AST.shot
index 4b0c8c0b06b7..d8af856f0d4f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-operator/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,79 @@
exports[`AST Fixtures legacy-fixtures basics cast-as-operator AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: BinaryExpression {
+ type: 'BinaryExpression',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [73, 74],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ operator: '===',
+ right: TSAsExpression {
+ type: 'TSAsExpression',
+ expression: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [80, 81],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [85, 91],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [80, 91],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+
+ range: [73, 93],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/1-TSESTree-AST.shot
index 94188993637b..77bae5e0fa41 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -23,7 +26,9 @@ Program {
type: "TSAsExpression",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [85, 86],
loc: {
@@ -55,6 +60,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [73, 94],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/5-AST-Alignment-AST.shot
index 2f9dfe1a2353..a61cfb5f5e78 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/cast-as-simple/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,84 @@
exports[`AST Fixtures legacy-fixtures basics cast-as-simple AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [79, 82],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ init: TSAsExpression {
+ type: 'TSAsExpression',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [85, 86],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [90, 93],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [85, 93],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [79, 93],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 95],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/1-TSESTree-AST.shot
index 4fd32ac88511..2e62c98bccf8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/1-TSESTree-AST.shot
@@ -31,7 +31,9 @@ Program {
},
param: Identifier {
type: "Identifier",
+ decorators: [],
name: "e",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
@@ -98,7 +100,9 @@ Program {
},
param: Identifier {
type: "Identifier",
+ decorators: [],
name: "e",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnknownKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/5-AST-Alignment-AST.shot
index 89b8eb95c595..9436e8fa2087 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-annotation/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,157 @@
exports[`AST Fixtures legacy-fixtures basics catch-clause-with-annotation AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TryStatement {
+ type: 'TryStatement',
+ block: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [77, 80],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ finalizer: null,
+ handler: CatchClause {
+ type: 'CatchClause',
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [96, 98],
+ loc: {
+ start: { column: 17, line: 4 },
+ end: { column: 19, line: 4 },
+ },
+ },
+ param: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'e',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [91, 94],
+ loc: {
+ start: { column: 12, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+
+ range: [89, 94],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+
+ range: [88, 94],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+
+ range: [81, 98],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 19, line: 4 },
+ },
+ },
+
+ range: [73, 98],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 19, line: 4 },
+ },
+ },
+ TryStatement {
+ type: 'TryStatement',
+ block: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [104, 107],
+ loc: {
+ start: { column: 4, line: 6 },
+ end: { column: 1, line: 7 },
+ },
+ },
+ finalizer: null,
+ handler: CatchClause {
+ type: 'CatchClause',
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [127, 129],
+ loc: {
+ start: { column: 21, line: 7 },
+ end: { column: 23, line: 7 },
+ },
+ },
+ param: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'e',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSUnknownKeyword {
+ type: 'TSUnknownKeyword',
+
+ range: [118, 125],
+ loc: {
+ start: { column: 12, line: 7 },
+ end: { column: 19, line: 7 },
+ },
+ },
+
+ range: [116, 125],
+ loc: {
+ start: { column: 10, line: 7 },
+ end: { column: 19, line: 7 },
+ },
+ },
+
+ range: [115, 125],
+ loc: {
+ start: { column: 9, line: 7 },
+ end: { column: 19, line: 7 },
+ },
+ },
+
+ range: [108, 129],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 23, line: 7 },
+ },
+ },
+
+ range: [100, 129],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 23, line: 7 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 130],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 8 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/1-TSESTree-AST.shot
index dd4a2c148a61..dc30f9f96cff 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/1-TSESTree-AST.shot
@@ -31,7 +31,9 @@ Program {
},
param: Identifier {
type: "Identifier",
+ decorators: [],
name: "e",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/5-AST-Alignment-AST.shot
index ff4be300dbe3..6aef5769b954 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,88 @@
exports[`AST Fixtures legacy-fixtures basics catch-clause-with-invalid-annotation AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TryStatement {
+ type: 'TryStatement',
+ block: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [77, 80],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ finalizer: null,
+ handler: CatchClause {
+ type: 'CatchClause',
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [99, 101],
+ loc: {
+ start: { column: 20, line: 4 },
+ end: { column: 22, line: 4 },
+ },
+ },
+ param: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'e',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [91, 97],
+ loc: {
+ start: { column: 12, line: 4 },
+ end: { column: 18, line: 4 },
+ },
+ },
+
+ range: [89, 97],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 18, line: 4 },
+ },
+ },
+
+ range: [88, 97],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 18, line: 4 },
+ },
+ },
+
+ range: [81, 101],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 22, line: 4 },
+ },
+ },
+
+ range: [73, 101],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 22, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 102],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/1-TSESTree-AST.shot
index 6658448bad02..ba043fdb916b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,9 @@ Program {
type: "ExpressionStatement",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "abstract",
+ optional: false,
range: [73, 81],
loc: {
@@ -25,6 +27,7 @@ Program {
},
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -35,9 +38,13 @@ Program {
end: { column: 10, line: 4 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [89, 90],
loc: {
@@ -45,6 +52,7 @@ Program {
end: { column: 7, line: 4 },
},
},
+ implements: [],
superClass: null,
range: [83, 93],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/5-AST-Alignment-AST.shot
index c36526457e79..107bcb11f9aa 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,76 @@
exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-abstract AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'abstract',
+- optional: false,
+
+ range: [73, 81],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [73, 82],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [91, 93],
+ loc: {
+ start: { column: 8, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'B',
+- optional: false,
+
+ range: [89, 90],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 7, line: 4 },
+ },
+ },
+- implements: Array [],
+ superClass: null,
+
+ range: [83, 93],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/1-TSESTree-AST.shot
index cbb19722f691..025639ca14b9 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,9 @@ Program {
type: "ExpressionStatement",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "declare",
+ optional: false,
range: [73, 80],
loc: {
@@ -25,6 +27,7 @@ Program {
},
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -35,9 +38,13 @@ Program {
end: { column: 10, line: 4 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [88, 89],
loc: {
@@ -45,6 +52,7 @@ Program {
end: { column: 7, line: 4 },
},
},
+ implements: [],
superClass: null,
range: [82, 92],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/5-AST-Alignment-AST.shot
index 91ba03ff880f..7b635aa1f266 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,76 @@
exports[`AST Fixtures legacy-fixtures basics class-multi-line-keyword-declare AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'declare',
+- optional: false,
+
+ range: [73, 80],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+
+ range: [73, 81],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [90, 92],
+ loc: {
+ start: { column: 8, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'B',
+- optional: false,
+
+ range: [88, 89],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 7, line: 4 },
+ },
+ },
+- implements: Array [],
+ superClass: null,
+
+ range: [82, 92],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 93],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/1-TSESTree-AST.shot
index 9ecd4e561899..37b23ebcae1b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,6 +14,8 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: PrivateIdentifier {
type: "PrivateIdentifier",
name: "priv1",
@@ -23,7 +26,9 @@ Program {
end: { column: 8, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -55,6 +60,8 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: PrivateIdentifier {
type: "PrivateIdentifier",
name: "priv2",
@@ -65,7 +72,9 @@ Program {
end: { column: 8, line: 5 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -106,9 +115,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [128, 139],
loc: {
@@ -117,6 +129,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -193,6 +206,7 @@ Program {
end: { column: 3, line: 9 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -219,9 +233,13 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -229,6 +247,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 170],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/5-AST-Alignment-AST.shot
index 50e07fdec6a3..8db2a072d5d5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,6 +18,8 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: PrivateIdentifier {
type: 'PrivateIdentifier',
name: 'priv1',
@@ -27,7 +30,9 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with
end: { column: 8, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -59,6 +64,8 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: PrivateIdentifier {
type: 'PrivateIdentifier',
name: 'priv2',
@@ -69,7 +76,9 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with
end: { column: 8, line: 5 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -110,9 +119,12 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [128, 139],
loc: {
@@ -121,6 +133,7 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -197,6 +210,7 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with
end: { column: 3, line: 9 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -223,9 +237,13 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with
end: { column: 1, line: 10 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -233,6 +251,7 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-field-with
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 170],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/1-TSESTree-AST.shot
index 321258d559b0..6325a410ae2e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,6 +14,8 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: PrivateIdentifier {
type: "PrivateIdentifier",
name: "priv",
@@ -23,6 +26,7 @@ Program {
end: { column: 16, line: 4 },
},
},
+ optional: false,
override: false,
readonly: true,
static: false,
@@ -60,9 +64,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -70,6 +78,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 112],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/5-AST-Alignment-AST.shot
index 4a94acfc12a9..9a97960820e8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-f
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,6 +18,8 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-f
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: PrivateIdentifier {
type: 'PrivateIdentifier',
name: 'priv',
@@ -27,6 +30,7 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-f
end: { column: 16, line: 4 },
},
},
+- optional: false,
- override: false,
readonly: true,
static: false,
@@ -64,9 +68,13 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-f
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -74,6 +82,7 @@ exports[`AST Fixtures legacy-fixtures basics class-private-identifier-readonly-f
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 112],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/1-TSESTree-AST.shot
index 3618d7741dc5..b92ad626eef4 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "count",
+ optional: false,
range: [94, 99],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 14, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: true,
value: Literal {
type: "Literal",
@@ -58,7 +65,9 @@ Program {
type: "UpdateExpression",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "count",
+ optional: false,
range: [149, 154],
loc: {
@@ -95,7 +104,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "someCondition",
+ optional: false,
range: [124, 137],
loc: {
@@ -134,9 +145,13 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -144,6 +159,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 169],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/5-AST-Alignment-AST.shot
index c937657039ca..ed9cb590a615 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-static-blocks/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-static-blocks AST Alignment -
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,9 +18,13 @@ exports[`AST Fixtures legacy-fixtures basics class-static-blocks AST Alignment -
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'count',
+- optional: false,
range: [94, 99],
loc: {
@@ -27,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics class-static-blocks AST Alignment -
end: { column: 14, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: true,
value: Literal {
type: 'Literal',
@@ -62,7 +69,9 @@ exports[`AST Fixtures legacy-fixtures basics class-static-blocks AST Alignment -
type: 'UpdateExpression',
argument: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'count',
+- optional: false,
range: [149, 154],
loc: {
@@ -99,7 +108,9 @@ exports[`AST Fixtures legacy-fixtures basics class-static-blocks AST Alignment -
arguments: Array [],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'someCondition',
+- optional: false,
range: [124, 137],
loc: {
@@ -138,9 +149,13 @@ exports[`AST Fixtures legacy-fixtures basics class-static-blocks AST Alignment -
end: { column: 1, line: 10 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -148,6 +163,7 @@ exports[`AST Fixtures legacy-fixtures basics class-static-blocks AST Alignment -
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 169],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/1-TSESTree-AST.shot
index 65e19032f445..f579822acb1c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -14,9 +15,13 @@ Program {
accessibility: "private",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [95, 98],
loc: {
@@ -24,7 +29,9 @@ Program {
end: { column: 13, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -57,9 +64,13 @@ Program {
accessibility: "public",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [124, 127],
loc: {
@@ -67,7 +78,9 @@ Program {
end: { column: 19, line: 5 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: true,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -99,9 +112,12 @@ Program {
type: "MethodDefinition",
accessibility: "public",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "getBar",
+ optional: false,
range: [146, 152],
loc: {
@@ -110,6 +126,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -135,7 +152,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [173, 176],
loc: {
@@ -165,6 +184,7 @@ Program {
end: { column: 3, line: 8 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -187,9 +207,12 @@ Program {
type: "MethodDefinition",
accessibility: "protected",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "setBar",
+ optional: false,
range: [194, 200],
loc: {
@@ -198,6 +221,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -225,7 +249,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [225, 228],
loc: {
@@ -243,7 +269,9 @@ Program {
operator: "=",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [231, 234],
loc: {
@@ -273,13 +301,16 @@ Program {
end: { column: 3, line: 11 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -328,9 +359,13 @@ Program {
end: { column: 1, line: 12 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -338,6 +373,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 241],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/5-AST-Alignment-AST.shot
index 3e92199a42e2..bb1a1c4bac1e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -18,9 +19,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
accessibility: 'private',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [95, 98],
loc: {
@@ -28,7 +33,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
end: { column: 13, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -61,9 +68,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
accessibility: 'public',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [124, 127],
loc: {
@@ -71,7 +82,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
end: { column: 19, line: 5 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: true,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -103,9 +116,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
type: 'MethodDefinition',
accessibility: 'public',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'getBar',
+- optional: false,
range: [146, 152],
loc: {
@@ -114,6 +130,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -139,7 +156,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [173, 176],
loc: {
@@ -169,6 +188,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
end: { column: 3, line: 8 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -191,9 +211,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
type: 'MethodDefinition',
accessibility: 'protected',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'setBar',
+- optional: false,
range: [194, 200],
loc: {
@@ -202,6 +225,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -229,7 +253,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [225, 228],
loc: {
@@ -247,7 +273,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
operator: '=',
right: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [231, 234],
loc: {
@@ -277,13 +305,16 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
end: { column: 3, line: 11 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -332,9 +363,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
end: { column: 1, line: 12 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -342,6 +377,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-accessibility-modifiers
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 241],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/1-TSESTree-AST.shot
index 24585ee10914..998b6207d4ce 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,12 @@ Program {
type: "MethodDefinition",
accessibility: "protected",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [95, 106],
loc: {
@@ -24,6 +28,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -39,6 +44,7 @@ Program {
end: { column: 28, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -61,6 +67,7 @@ Program {
type: "MethodDefinition",
accessibility: "public",
computed: true,
+ decorators: [],
key: Literal {
type: "Literal",
raw: "'constructor'",
@@ -73,6 +80,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -88,6 +96,7 @@ Program {
end: { column: 29, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -114,9 +123,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [79, 80],
loc: {
@@ -124,6 +137,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 144],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/5-AST-Alignment-AST.shot
index 9c0ef5e4b1d0..4f9a53a7ec51 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,9 +18,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier
type: 'MethodDefinition',
accessibility: 'protected',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [95, 106],
loc: {
@@ -28,6 +32,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -43,6 +48,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier
end: { column: 28, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -65,6 +71,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier
type: 'MethodDefinition',
accessibility: 'public',
computed: true,
+- decorators: Array [],
key: Literal {
type: 'Literal',
raw: '\\'constructor\\'',
@@ -77,6 +84,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -92,6 +100,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier
end: { column: 29, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -118,9 +127,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [79, 80],
loc: {
@@ -128,6 +141,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-modifier
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 144],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/1-TSESTree-AST.shot
index e225d3f8406c..dd0a87e7d3df 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [126, 137],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 59, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -45,10 +51,13 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "protected",
+ decorators: [],
override: true,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "param",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -75,6 +84,7 @@ Program {
},
},
readonly: true,
+ static: false,
range: [138, 179],
loc: {
@@ -105,9 +115,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "SpecializedComponent",
+ optional: false,
range: [79, 99],
loc: {
@@ -115,9 +129,12 @@ Program {
end: { column: 26, line: 3 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "SomeComponent",
+ optional: false,
range: [108, 121],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/5-AST-Alignment-AST.shot
index 1fad65fb13d2..e9cb84b1934f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [126, 137],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
end: { column: 59, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -49,10 +55,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'protected',
+- decorators: Array [],
override: true,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'param',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -79,6 +88,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
},
},
readonly: true,
+- static: false,
range: [138, 179],
loc: {
@@ -109,9 +119,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'SpecializedComponent',
+- optional: false,
range: [79, 99],
loc: {
@@ -119,9 +133,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
end: { column: 26, line: 3 },
},
},
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'SomeComponent',
+- optional: false,
range: [108, 121],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/1-TSESTree-AST.shot
index eb888a48f10a..95679527f61e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [126, 137],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -68,16 +73,20 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
TSParameterProperty {
type: "TSParameterProperty",
+ decorators: [],
override: true,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "param",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -103,6 +112,8 @@ Program {
end: { column: 36, line: 4 },
},
},
+ readonly: false,
+ static: false,
range: [138, 160],
loc: {
@@ -133,9 +144,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "SpecializedComponent",
+ optional: false,
range: [79, 99],
loc: {
@@ -143,9 +158,12 @@ Program {
end: { column: 26, line: 3 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "SomeComponent",
+ optional: false,
range: [108, 121],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/5-AST-Alignment-AST.shot
index fa57caf9773b..30ed3a5d2b9f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-proptery-with-override-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [126, 137],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -72,16 +77,20 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
end: { column: 3, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
TSParameterProperty {
type: 'TSParameterProperty',
+- decorators: Array [],
override: true,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'param',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -107,6 +116,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
end: { column: 36, line: 4 },
},
},
+- readonly: false,
+- static: false,
range: [138, 160],
loc: {
@@ -137,9 +148,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'SpecializedComponent',
+- optional: false,
range: [79, 99],
loc: {
@@ -147,9 +162,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-paramete
end: { column: 26, line: 3 },
},
},
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'SomeComponent',
+- optional: false,
range: [108, 121],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/1-TSESTree-AST.shot
index 142fe9623167..468b1d834e1e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [85, 96],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 26, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -77,6 +83,7 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: true,
+ decorators: [],
key: Literal {
type: "Literal",
raw: "'constructor'",
@@ -89,6 +96,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -104,6 +112,7 @@ Program {
end: { column: 30, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -148,9 +157,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [79, 80],
loc: {
@@ -158,6 +171,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 143],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/5-AST-Alignment-AST.shot
index 15311f586694..23d2de9832a3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-constructor-and-return-type/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-t
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [85, 96],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-t
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-t
end: { column: 26, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -81,6 +87,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-t
MethodDefinition {
type: 'MethodDefinition',
computed: true,
+- decorators: Array [],
key: Literal {
type: 'Literal',
raw: '\\'constructor\\'',
@@ -93,6 +100,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-t
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -108,6 +116,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-t
end: { column: 30, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -152,9 +161,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-t
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [79, 80],
loc: {
@@ -162,6 +175,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-constructor-and-return-t
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 143],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/1-TSESTree-AST.shot
index 6f873dd95528..a467ad9004bf 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop1",
+ optional: false,
range: [101, 106],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 15, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -56,9 +63,13 @@ Program {
accessibility: "public",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop2",
+ optional: false,
range: [133, 138],
loc: {
@@ -66,7 +77,9 @@ Program {
end: { column: 22, line: 5 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -98,9 +111,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop3",
+ optional: false,
range: [165, 170],
loc: {
@@ -108,7 +125,9 @@ Program {
end: { column: 22, line: 6 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: true,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -140,9 +159,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop3",
+ optional: false,
range: [199, 204],
loc: {
@@ -150,6 +173,7 @@ Program {
end: { column: 24, line: 7 },
},
},
+ optional: false,
override: false,
readonly: true,
static: false,
@@ -184,9 +208,13 @@ Program {
accessibility: "public",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop4",
+ optional: false,
range: [240, 245],
loc: {
@@ -194,6 +222,7 @@ Program {
end: { column: 31, line: 8 },
},
},
+ optional: false,
override: false,
readonly: true,
static: false,
@@ -228,9 +257,13 @@ Program {
accessibility: "public",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop5",
+ optional: false,
range: [279, 284],
loc: {
@@ -238,7 +271,9 @@ Program {
end: { column: 29, line: 9 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: true,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -271,9 +306,13 @@ Program {
accessibility: "public",
computed: false,
declare: true,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop6",
+ optional: false,
range: [327, 332],
loc: {
@@ -281,6 +320,7 @@ Program {
end: { column: 38, line: 10 },
},
},
+ optional: false,
override: false,
readonly: true,
static: true,
@@ -318,9 +358,13 @@ Program {
end: { column: 1, line: 11 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "DeclProps",
+ optional: false,
range: [79, 88],
loc: {
@@ -328,6 +372,7 @@ Program {
end: { column: 15, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 343],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot
index 66ba0b556620..07399bd45ca8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-declare-properties/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,9 +18,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
type: 'PropertyDefinition',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop1',
+- optional: false,
range: [101, 106],
loc: {
@@ -27,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
end: { column: 15, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -60,9 +67,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
accessibility: 'public',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop2',
+- optional: false,
range: [133, 138],
loc: {
@@ -70,7 +81,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
end: { column: 22, line: 5 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -102,9 +115,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
type: 'PropertyDefinition',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop3',
+- optional: false,
range: [165, 170],
loc: {
@@ -112,7 +129,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
end: { column: 22, line: 6 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: true,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -144,9 +163,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
type: 'PropertyDefinition',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop3',
+- optional: false,
range: [199, 204],
loc: {
@@ -154,6 +177,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
end: { column: 24, line: 7 },
},
},
+- optional: false,
- override: false,
readonly: true,
static: false,
@@ -188,9 +212,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
accessibility: 'public',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop4',
+- optional: false,
range: [240, 245],
loc: {
@@ -198,6 +226,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
end: { column: 31, line: 8 },
},
},
+- optional: false,
- override: false,
readonly: true,
static: false,
@@ -232,9 +261,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
accessibility: 'public',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop5',
+- optional: false,
range: [279, 284],
loc: {
@@ -242,7 +275,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
end: { column: 29, line: 9 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: true,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -275,9 +310,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
accessibility: 'public',
computed: false,
declare: true,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop6',
+- optional: false,
range: [327, 332],
loc: {
@@ -285,6 +324,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
end: { column: 38, line: 10 },
},
},
+- optional: false,
- override: false,
readonly: true,
static: true,
@@ -322,9 +362,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
end: { column: 1, line: 11 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'DeclProps',
+- optional: false,
range: [79, 88],
loc: {
@@ -332,6 +376,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-declare-properties AST A
end: { column: 15, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 343],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/1-TSESTree-AST.shot
index 463c5cde7de3..7f5aeb6fee1d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,10 +14,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
definite: true,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [85, 86],
loc: {
@@ -24,7 +28,9 @@ Program {
end: { column: 3, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -60,9 +66,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [79, 80],
loc: {
@@ -70,6 +80,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 98],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/5-AST-Alignment-AST.shot
index 12dd36c717ab..21ac2c6a3ca2 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-definite-assignment/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment AST
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,10 +18,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment AST
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
definite: true,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [85, 86],
loc: {
@@ -28,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment AST
end: { column: 3, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -64,9 +70,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment AST
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [79, 80],
loc: {
@@ -74,6 +84,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-definite-assignment AST
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 98],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/1-TSESTree-AST.shot
index 52b855e69317..aec123dc3e0d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 80, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "ClassWithParentAndInterface",
+ optional: false,
range: [79, 106],
loc: {
@@ -31,7 +36,9 @@ Program {
type: "TSClassImplements",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "MyInterface",
+ optional: false,
range: [139, 150],
loc: {
@@ -49,7 +56,9 @@ Program {
],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "MyOtherClass",
+ optional: false,
range: [115, 127],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/5-AST-Alignment-AST.shot
index bb0b1427d253..9345b10e9855 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-and-implements/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-and-implements A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-and-implements A
end: { column: 80, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'ClassWithParentAndInterface',
+- optional: false,
range: [79, 106],
loc: {
@@ -37,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-and-implements A
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'MyInterface',
+- optional: false,
range: [139, 150],
loc: {
@@ -55,7 +62,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-and-implements A
],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'MyOtherClass',
+- optional: false,
range: [115, 127],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot
index cdbec66bb972..137500002d8b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 43, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -26,9 +31,12 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [104, 107],
loc: {
@@ -36,14 +44,16 @@ Program {
end: { column: 34, line: 3 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+ superTypeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [108, 109],
loc: {
@@ -62,7 +72,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "D",
+ optional: false,
range: [111, 112],
loc: {
@@ -95,7 +107,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [93, 94],
loc: {
@@ -113,7 +127,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [83, 84],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot
index baf4e31b33b6..1073c725f416 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic-multiple/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple
end: { column: 43, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -30,9 +35,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [104, 107],
loc: {
@@ -40,14 +48,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple
end: { column: 34, line: 3 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+- superTypeArguments: TSTypeParameterInstantiation {
++ superTypeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [108, 109],
loc: {
@@ -66,7 +77,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'D',
+- optional: false,
range: [111, 112],
loc: {
@@ -99,7 +112,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [93, 94],
loc: {
@@ -117,7 +132,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'A',
+- optional: false,
-
- range: [83, 84],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot
index 63825cb2349b..3e3d64d818c2 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 30, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -26,9 +31,12 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [94, 97],
loc: {
@@ -36,14 +44,16 @@ Program {
end: { column: 24, line: 3 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+ superTypeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [98, 99],
loc: {
@@ -75,7 +85,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [83, 84],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot
index ac7c601b7ec5..ba394f6be498 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-extends-generic/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alig
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alig
end: { column: 30, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -30,9 +35,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alig
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [94, 97],
loc: {
@@ -40,14 +48,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alig
end: { column: 24, line: 3 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+- superTypeArguments: TSTypeParameterInstantiation {
++ superTypeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [98, 99],
loc: {
@@ -79,7 +90,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-extends-generic AST Alig
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'A',
+- optional: false,
-
- range: [83, 84],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot
index b6e4b7f8e223..88e4438bb064 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "getBar",
+ optional: false,
range: [87, 93],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 22, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -52,7 +58,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [98, 101],
loc: {
@@ -70,7 +78,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [94, 95],
loc: {
@@ -116,9 +126,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -126,6 +140,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 109],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot
index e9e2c7244b24..e58c25fa024c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method-default/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'getBar',
+- optional: false,
range: [87, 93],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default A
end: { column: 22, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -56,7 +62,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default A
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [98, 101],
loc: {
@@ -74,7 +82,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [94, 95],
- loc: {
@@ -123,9 +133,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default A
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -133,6 +147,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method-default A
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 109],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot
index 6c852735c5a5..952efb711752 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "getBar",
+ optional: false,
range: [87, 93],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 16, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -51,7 +57,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [94, 95],
loc: {
@@ -97,9 +105,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -107,6 +119,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 103],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot
index d823b4570e5f..ebf99595a806 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-generic-method/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method AST Align
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'getBar',
+- optional: false,
range: [87, 93],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method AST Align
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method AST Align
end: { column: 16, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -55,7 +61,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method AST Align
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [94, 95],
- loc: {
@@ -104,9 +112,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method AST Align
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -114,6 +126,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-generic-method AST Align
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 103],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot
index da2c200699aa..62bd5c01b74f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 33, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -31,7 +36,9 @@ Program {
type: "TSClassImplements",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [94, 97],
loc: {
@@ -39,14 +46,16 @@ Program {
end: { column: 24, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "S",
+ optional: false,
range: [98, 99],
loc: {
@@ -65,7 +74,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [101, 102],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot
index 41b0e58926bb..9ac4c609f858 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic-multiple/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multi
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multi
end: { column: 33, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -37,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multi
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [94, 97],
loc: {
@@ -45,14 +52,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multi
end: { column: 24, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'S',
+- optional: false,
range: [98, 99],
loc: {
@@ -71,7 +81,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic-multi
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [101, 102],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot
index f50ed36f9225..056cda75ff68 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 30, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -31,7 +36,9 @@ Program {
type: "TSClassImplements",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [94, 97],
loc: {
@@ -39,14 +46,16 @@ Program {
end: { column: 24, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "S",
+ optional: false,
range: [98, 99],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot
index 74cc49838e1f..861c924cb00a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements-generic/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic AST A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic AST A
end: { column: 30, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -37,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic AST A
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [94, 97],
loc: {
@@ -45,14 +52,17 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements-generic AST A
end: { column: 24, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'S',
+- optional: false,
range: [98, 99],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/1-TSESTree-AST.shot
index 9bf39dac1585..c632c3a9afaf 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 27, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -31,7 +36,9 @@ Program {
type: "TSClassImplements",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [94, 97],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/5-AST-Alignment-AST.shot
index 67f56c863706..cbb9b19f3454 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-implements/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements AST Alignment
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements AST Alignment
end: { column: 27, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -37,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-implements AST Alignment
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [94, 97],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot
index 86ecdb4e040b..76c8fca66261 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [85, 88],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 18, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -77,9 +83,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [104, 107],
loc: {
@@ -88,6 +97,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -103,6 +113,7 @@ Program {
end: { column: 13, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -116,7 +127,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [108, 109],
loc: {
@@ -157,9 +170,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [118, 121],
loc: {
@@ -168,6 +184,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -183,6 +200,7 @@ Program {
end: { column: 10, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -209,9 +227,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [79, 80],
loc: {
@@ -219,6 +241,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 128],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot
index 8b3757898e92..cd6eeae54ca6 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-method/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [85, 88],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
end: { column: 18, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -81,9 +87,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [104, 107],
loc: {
@@ -92,6 +101,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -107,6 +117,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
end: { column: 13, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -120,7 +131,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [108, 109],
- loc: {
@@ -164,9 +177,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [118, 121],
loc: {
@@ -175,6 +191,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -190,6 +207,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
end: { column: 10, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -216,9 +234,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [79, 80],
loc: {
@@ -226,6 +248,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-method AST Alignment - A
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 128],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot
index 6b695ed3a9ee..b9bbc8413430 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 48, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "M",
+ optional: false,
range: [82, 83],
loc: {
@@ -32,14 +35,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "Base",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [116, 117],
loc: {
@@ -77,24 +84,16 @@ Program {
const: false,
constraint: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Constructor",
-
- range: [94, 105],
- loc: {
- start: { column: 21, line: 3 },
- end: { column: 32, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "M",
+ optional: false,
range: [106, 107],
loc: {
@@ -117,6 +116,18 @@ Program {
end: { column: 35, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Constructor",
+ optional: false,
+
+ range: [94, 105],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
range: [94, 108],
loc: {
@@ -127,7 +138,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [84, 85],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot
index f215d2b9478e..18e0e9767afd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin-reference/snapshots/5-AST-Alignment-AST.shot
@@ -21,11 +21,14 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig
end: { column: 48, line: 3 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'M',
+- optional: false,
range: [82, 83],
loc: {
@@ -36,14 +39,18 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Base',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [116, 117],
loc: {
@@ -81,24 +88,27 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig
- const: false,
constraint: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'Constructor',
-
- range: [94, 105],
- loc: {
- start: { column: 21, line: 3 },
- end: { column: 32, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Constructor',
++
++ range: [94, 105],
++ loc: {
++ start: { column: 21, line: 3 },
++ end: { column: 32, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'M',
+- optional: false,
range: [106, 107],
loc: {
@@ -121,6 +131,18 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig
end: { column: 35, line: 3 },
},
},
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Constructor',
+- optional: false,
+-
+- range: [94, 105],
+- loc: {
+- start: { column: 21, line: 3 },
+- end: { column: 32, line: 3 },
+- },
+- },
range: [94, 108],
loc: {
@@ -131,7 +153,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin-reference AST Alig
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [84, 85],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot
index e35887f92414..48529cb0405b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/1-TSESTree-AST.shot
@@ -14,6 +14,7 @@ Program {
type: "ReturnStatement",
argument: ClassExpression {
type: "ClassExpression",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -24,10 +25,15 @@ Program {
end: { column: 30, line: 4 },
},
},
+ declare: false,
+ decorators: [],
id: null,
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "Base",
+ optional: false,
range: [145, 149],
loc: {
@@ -57,11 +63,14 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "M",
+ optional: false,
range: [82, 83],
loc: {
@@ -72,14 +81,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "Base",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [117, 118],
loc: {
@@ -117,17 +130,7 @@ Program {
const: false,
constraint: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Constructor",
-
- range: [94, 105],
- loc: {
- start: { column: 21, line: 3 },
- end: { column: 32, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeLiteral {
@@ -148,6 +151,18 @@ Program {
end: { column: 36, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Constructor",
+ optional: false,
+
+ range: [94, 105],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
range: [94, 109],
loc: {
@@ -158,7 +173,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [84, 85],
loc: {
@@ -191,6 +208,7 @@ Program {
},
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -201,9 +219,13 @@ Program {
end: { column: 41, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [163, 164],
loc: {
@@ -216,7 +238,9 @@ Program {
type: "TSClassImplements",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "I",
+ optional: false,
range: [194, 195],
loc: {
@@ -237,7 +261,9 @@ Program {
arguments: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [180, 181],
loc: {
@@ -248,7 +274,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "M",
+ optional: false,
range: [173, 174],
loc: {
@@ -257,7 +285,7 @@ Program {
},
},
optional: false,
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSAnyKeyword {
@@ -293,6 +321,7 @@ Program {
},
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -303,9 +332,13 @@ Program {
end: { column: 10, line: 9 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [206, 207],
loc: {
@@ -313,6 +346,7 @@ Program {
end: { column: 7, line: 9 },
},
},
+ implements: [],
superClass: null,
range: [200, 210],
@@ -333,9 +367,13 @@ Program {
end: { column: 14, line: 10 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "I",
+ optional: false,
range: [221, 222],
loc: {
@@ -352,9 +390,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Constructor",
+ optional: false,
range: [231, 242],
loc: {
@@ -370,7 +411,9 @@ Program {
type: "RestElement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "args",
+ optional: false,
range: [256, 260],
loc: {
@@ -378,6 +421,8 @@ Program {
end: { column: 34, line: 11 },
},
},
+ decorators: [],
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSArrayType {
@@ -419,7 +464,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [272, 273],
loc: {
@@ -457,7 +504,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [243, 244],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot
index b113f663f51f..4d5c6677152b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-mixin/snapshots/5-AST-Alignment-AST.shot
@@ -18,6 +18,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
type: 'ReturnStatement',
argument: ClassExpression {
type: 'ClassExpression',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -28,10 +29,15 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
end: { column: 30, line: 4 },
},
},
+- declare: false,
+- decorators: Array [],
id: null,
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Base',
+- optional: false,
range: [145, 149],
loc: {
@@ -61,11 +67,14 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
end: { column: 1, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'M',
+- optional: false,
range: [82, 83],
loc: {
@@ -76,14 +85,18 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Base',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [117, 118],
loc: {
@@ -121,17 +134,18 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
- const: false,
constraint: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'Constructor',
-
- range: [94, 105],
- loc: {
- start: { column: 21, line: 3 },
- end: { column: 32, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Constructor',
++
++ range: [94, 105],
++ loc: {
++ start: { column: 21, line: 3 },
++ end: { column: 32, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeLiteral {
@@ -150,6 +164,18 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
loc: {
start: { column: 32, line: 3 },
end: { column: 36, line: 3 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Constructor',
+- optional: false,
+-
+- range: [94, 105],
+- loc: {
+- start: { column: 21, line: 3 },
+- end: { column: 32, line: 3 },
},
},
@@ -162,7 +188,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [84, 85],
- loc: {
@@ -196,6 +224,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
},
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -206,9 +235,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
end: { column: 41, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [163, 164],
loc: {
@@ -223,7 +256,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'I',
+- optional: false,
range: [194, 195],
loc: {
@@ -244,7 +279,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
arguments: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [180, 181],
loc: {
@@ -255,7 +292,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'M',
+- optional: false,
range: [173, 174],
loc: {
@@ -264,7 +303,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
},
},
optional: false,
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSAnyKeyword {
@@ -300,6 +340,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
},
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -310,9 +351,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
end: { column: 10, line: 9 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [206, 207],
loc: {
@@ -320,6 +365,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
end: { column: 7, line: 9 },
},
},
+- implements: Array [],
superClass: null,
range: [200, 210],
@@ -340,9 +386,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
end: { column: 14, line: 10 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'I',
+- optional: false,
range: [221, 222],
loc: {
@@ -359,9 +409,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Constructor',
+- optional: false,
range: [231, 242],
loc: {
@@ -378,7 +431,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
type: 'RestElement',
argument: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'args',
+- optional: false,
range: [256, 260],
loc: {
@@ -386,6 +441,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
end: { column: 34, line: 11 },
},
},
+- decorators: Array [],
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSArrayType {
@@ -428,7 +485,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [272, 273],
loc: {
@@ -466,7 +525,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-mixin AST Alignment - AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [243, 244],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/1-TSESTree-AST.shot
index 8763d72bcca4..7fa804c7c58d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "computed1",
+ optional: false,
range: [79, 88],
loc: {
@@ -38,6 +41,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [73, 98],
@@ -51,9 +55,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "computed2",
+ optional: false,
range: [105, 114],
loc: {
@@ -80,6 +87,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [99, 124],
@@ -93,9 +101,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "obj",
+ optional: false,
range: [131, 134],
loc: {
@@ -111,7 +122,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "member",
+ optional: false,
range: [141, 147],
loc: {
@@ -121,6 +134,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: Literal {
type: "Literal",
@@ -145,7 +159,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "member2",
+ optional: false,
range: [161, 168],
loc: {
@@ -155,6 +171,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: Literal {
type: "Literal",
@@ -190,6 +207,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [125, 183],
@@ -200,15 +218,19 @@ Program {
},
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: true,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "computed1",
+ optional: false,
range: [197, 206],
loc: {
@@ -224,6 +246,7 @@ Program {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -245,9 +268,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: true,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "computed2",
+ optional: false,
range: [215, 224],
loc: {
@@ -272,6 +298,7 @@ Program {
end: { column: 19, line: 11 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -293,6 +320,7 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: true,
+ decorators: [],
key: Literal {
type: "Literal",
raw: "1",
@@ -312,6 +340,7 @@ Program {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -333,6 +362,7 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: true,
+ decorators: [],
key: Literal {
type: "Literal",
raw: "2",
@@ -361,6 +391,7 @@ Program {
end: { column: 11, line: 13 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -382,6 +413,7 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: true,
+ decorators: [],
key: Literal {
type: "Literal",
raw: "'literal1'",
@@ -401,6 +433,7 @@ Program {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -422,6 +455,7 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: true,
+ decorators: [],
key: Literal {
type: "Literal",
raw: "'literal2'",
@@ -450,6 +484,7 @@ Program {
end: { column: 20, line: 15 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -471,12 +506,15 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: true,
+ decorators: [],
key: MemberExpression {
type: "MemberExpression",
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "obj",
+ optional: false,
range: [297, 300],
loc: {
@@ -487,7 +525,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "member",
+ optional: false,
range: [301, 307],
loc: {
@@ -519,6 +559,7 @@ Program {
end: { column: 20, line: 16 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -540,12 +581,15 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: true,
+ decorators: [],
key: MemberExpression {
type: "MemberExpression",
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "obj",
+ optional: false,
range: [318, 321],
loc: {
@@ -556,7 +600,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "member2",
+ optional: false,
range: [322, 329],
loc: {
@@ -579,6 +625,7 @@ Program {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -600,12 +647,15 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: true,
+ decorators: [],
key: CallExpression {
type: "CallExpression",
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
range: [338, 339],
loc: {
@@ -638,6 +688,7 @@ Program {
end: { column: 13, line: 18 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -664,9 +715,13 @@ Program {
end: { column: 1, line: 19 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [190, 191],
loc: {
@@ -674,6 +729,7 @@ Program {
end: { column: 7, line: 9 },
},
},
+ implements: [],
superClass: null,
range: [184, 350],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/5-AST-Alignment-AST.shot
index e142bb454dc6..6781e3075a27 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-method/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'computed1',
+- optional: false,
range: [79, 88],
loc: {
@@ -42,6 +45,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
},
},
],
+- declare: false,
kind: 'const',
range: [73, 98],
@@ -55,9 +59,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'computed2',
+- optional: false,
range: [105, 114],
loc: {
@@ -84,6 +91,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
},
},
],
+- declare: false,
kind: 'const',
range: [99, 124],
@@ -97,9 +105,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'obj',
+- optional: false,
range: [131, 134],
loc: {
@@ -115,7 +126,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'member',
+- optional: false,
range: [141, 147],
loc: {
@@ -125,6 +138,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
},
kind: 'init',
method: false,
+- optional: false,
shorthand: false,
value: Literal {
type: 'Literal',
@@ -149,7 +163,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'member2',
+- optional: false,
range: [161, 168],
loc: {
@@ -159,6 +175,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
},
kind: 'init',
method: false,
+- optional: false,
shorthand: false,
value: Literal {
type: 'Literal',
@@ -194,6 +211,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
},
},
],
+- declare: false,
kind: 'const',
range: [125, 183],
@@ -204,15 +222,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
},
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: true,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'computed1',
+- optional: false,
range: [197, 206],
loc: {
@@ -230,6 +252,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -251,9 +274,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
MethodDefinition {
type: 'MethodDefinition',
computed: true,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'computed2',
+- optional: false,
range: [215, 224],
loc: {
@@ -278,6 +304,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
end: { column: 19, line: 11 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -299,6 +326,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
MethodDefinition {
type: 'MethodDefinition',
computed: true,
+- decorators: Array [],
key: Literal {
type: 'Literal',
raw: '1',
@@ -320,6 +348,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -341,6 +370,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
MethodDefinition {
type: 'MethodDefinition',
computed: true,
+- decorators: Array [],
key: Literal {
type: 'Literal',
raw: '2',
@@ -369,6 +399,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
end: { column: 11, line: 13 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -390,6 +421,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
MethodDefinition {
type: 'MethodDefinition',
computed: true,
+- decorators: Array [],
key: Literal {
type: 'Literal',
raw: '\\'literal1\\'',
@@ -411,6 +443,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -432,6 +465,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
MethodDefinition {
type: 'MethodDefinition',
computed: true,
+- decorators: Array [],
key: Literal {
type: 'Literal',
raw: '\\'literal2\\'',
@@ -460,6 +494,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
end: { column: 20, line: 15 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -481,12 +516,15 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
MethodDefinition {
type: 'MethodDefinition',
computed: true,
+- decorators: Array [],
key: MemberExpression {
type: 'MemberExpression',
computed: false,
object: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'obj',
+- optional: false,
range: [297, 300],
loc: {
@@ -497,7 +535,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'member',
+- optional: false,
range: [301, 307],
loc: {
@@ -529,6 +569,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
end: { column: 20, line: 16 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -550,12 +591,15 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
MethodDefinition {
type: 'MethodDefinition',
computed: true,
+- decorators: Array [],
key: MemberExpression {
type: 'MemberExpression',
computed: false,
object: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'obj',
+- optional: false,
range: [318, 321],
loc: {
@@ -566,7 +610,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'member2',
+- optional: false,
range: [322, 329],
loc: {
@@ -591,6 +637,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -612,12 +659,15 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
MethodDefinition {
type: 'MethodDefinition',
computed: true,
+- decorators: Array [],
key: CallExpression {
type: 'CallExpression',
arguments: Array [],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'f',
+- optional: false,
range: [338, 339],
loc: {
@@ -650,6 +700,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
end: { column: 13, line: 18 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -676,9 +727,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
end: { column: 1, line: 19 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [190, 191],
loc: {
@@ -686,6 +741,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-method
end: { column: 7, line: 9 },
},
},
+- implements: Array [],
superClass: null,
range: [184, 350],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/1-TSESTree-AST.shot
index 1443a0bda66c..8227bc871a44 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -14,6 +15,8 @@ Program {
accessibility: "private",
computed: true,
declare: false,
+ decorators: [],
+ definite: false,
key: Literal {
type: "Literal",
raw: "'foo'",
@@ -27,10 +30,13 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
value: Identifier {
type: "Identifier",
+ decorators: [],
name: "undefined",
+ optional: false,
range: [104, 113],
loc: {
@@ -53,9 +59,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [79, 80],
loc: {
@@ -63,6 +73,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 116],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/5-AST-Alignment-AST.shot
index 27d8a0ad1e4a..959f8eb28d31 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-computed-property/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-proper
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -18,6 +19,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-proper
accessibility: 'private',
computed: true,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Literal {
type: 'Literal',
raw: '\\'foo\\'',
@@ -31,10 +34,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-proper
},
optional: true,
- override: false,
+- readonly: false,
static: false,
value: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'undefined',
+- optional: false,
range: [104, 113],
loc: {
@@ -57,9 +63,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-proper
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [79, 80],
loc: {
@@ -67,6 +77,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-computed-proper
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 116],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/1-TSESTree-AST.shot
index f5565827c154..2c8c6549a92b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [87, 90],
loc: {
@@ -30,6 +34,7 @@ Program {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -51,9 +56,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [97, 100],
loc: {
@@ -69,6 +77,7 @@ Program {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -109,9 +118,12 @@ Program {
type: "MethodDefinition",
accessibility: "private",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [123, 126],
loc: {
@@ -127,6 +139,7 @@ Program {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -171,9 +184,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -181,6 +198,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 140],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/5-AST-Alignment-AST.shot
index 9e3032b56954..d75b7e9bb3bd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-methods/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods AST Ali
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [87, 90],
loc: {
@@ -36,6 +40,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods AST Ali
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -57,9 +62,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods AST Ali
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [97, 100],
loc: {
@@ -77,6 +85,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods AST Ali
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -117,9 +126,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods AST Ali
type: 'MethodDefinition',
accessibility: 'private',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [123, 126],
loc: {
@@ -137,6 +149,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods AST Ali
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -181,9 +194,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods AST Ali
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -191,6 +208,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-methods AST Ali
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 140],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/1-TSESTree-AST.shot
index 22254044fb91..9a03b50c7b0b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "computed",
+ optional: false,
range: [79, 87],
loc: {
@@ -38,6 +41,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [73, 97],
@@ -51,9 +55,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "computed2",
+ optional: false,
range: [104, 113],
loc: {
@@ -80,6 +87,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [98, 123],
@@ -90,6 +98,7 @@ Program {
},
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -97,9 +106,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [138, 141],
loc: {
@@ -109,6 +122,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -122,9 +136,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [146, 149],
loc: {
@@ -134,6 +152,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -166,9 +185,13 @@ Program {
accessibility: "private",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [170, 173],
loc: {
@@ -178,6 +201,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -209,9 +233,13 @@ Program {
type: "PropertyDefinition",
computed: true,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "computed",
+ optional: false,
range: [187, 195],
loc: {
@@ -221,6 +249,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -234,6 +263,8 @@ Program {
type: "PropertyDefinition",
computed: true,
declare: false,
+ decorators: [],
+ definite: false,
key: Literal {
type: "Literal",
raw: "'literal'",
@@ -247,6 +278,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -260,6 +292,8 @@ Program {
type: "PropertyDefinition",
computed: true,
declare: false,
+ decorators: [],
+ definite: false,
key: Literal {
type: "Literal",
raw: "1",
@@ -273,6 +307,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -286,9 +321,13 @@ Program {
type: "PropertyDefinition",
computed: true,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "computed2",
+ optional: false,
range: [226, 235],
loc: {
@@ -298,6 +337,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -329,6 +369,8 @@ Program {
type: "PropertyDefinition",
computed: true,
declare: false,
+ decorators: [],
+ definite: false,
key: Literal {
type: "Literal",
raw: "'literal2'",
@@ -342,6 +384,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -373,6 +416,8 @@ Program {
type: "PropertyDefinition",
computed: true,
declare: false,
+ decorators: [],
+ definite: false,
key: Literal {
type: "Literal",
raw: "2",
@@ -386,6 +431,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -421,9 +467,13 @@ Program {
end: { column: 1, line: 15 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [130, 133],
loc: {
@@ -431,6 +481,7 @@ Program {
end: { column: 9, line: 5 },
},
},
+ implements: [],
superClass: null,
range: [124, 289],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/5-AST-Alignment-AST.shot
index 47aa2d089f30..b581e542fbd6 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-properties/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'computed',
+- optional: false,
range: [79, 87],
loc: {
@@ -42,6 +45,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
},
],
+- declare: false,
kind: 'const',
range: [73, 97],
@@ -55,9 +59,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'computed2',
+- optional: false,
range: [104, 113],
loc: {
@@ -84,6 +91,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
},
],
+- declare: false,
kind: 'const',
range: [98, 123],
@@ -94,6 +102,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -101,9 +110,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [138, 141],
loc: {
@@ -113,6 +126,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
optional: true,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -126,9 +140,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [146, 149],
loc: {
@@ -138,6 +156,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
optional: true,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -170,9 +189,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
accessibility: 'private',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [170, 173],
loc: {
@@ -182,6 +205,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
optional: true,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -213,9 +237,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
type: 'PropertyDefinition',
computed: true,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'computed',
+- optional: false,
range: [187, 195],
loc: {
@@ -225,6 +253,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
optional: true,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -238,6 +267,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
type: 'PropertyDefinition',
computed: true,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Literal {
type: 'Literal',
raw: '\\'literal\\'',
@@ -251,6 +282,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
optional: true,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -264,6 +296,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
type: 'PropertyDefinition',
computed: true,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Literal {
type: 'Literal',
raw: '1',
@@ -277,6 +311,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
optional: true,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -290,9 +325,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
type: 'PropertyDefinition',
computed: true,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'computed2',
+- optional: false,
range: [226, 235],
loc: {
@@ -302,6 +341,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
optional: true,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -333,6 +373,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
type: 'PropertyDefinition',
computed: true,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Literal {
type: 'Literal',
raw: '\\'literal2\\'',
@@ -346,6 +388,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
optional: true,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -377,6 +420,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
type: 'PropertyDefinition',
computed: true,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Literal {
type: 'Literal',
raw: '2',
@@ -390,6 +435,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
},
optional: true,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -425,9 +471,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
end: { column: 1, line: 15 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [130, 133],
loc: {
@@ -435,6 +485,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-properties AST
end: { column: 9, line: 5 },
},
},
+- implements: Array [],
superClass: null,
range: [124, 289],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/1-TSESTree-AST.shot
index 6abdce915ee9..068063caaced 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -14,9 +15,13 @@ Program {
accessibility: "private",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [93, 96],
loc: {
@@ -26,10 +31,13 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
value: Identifier {
type: "Identifier",
+ decorators: [],
name: "undefined",
+ optional: false,
range: [100, 109],
loc: {
@@ -52,9 +60,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [79, 80],
loc: {
@@ -62,6 +74,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 112],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/5-AST-Alignment-AST.shot
index bf276da33e3e..c720da83ff5e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefi
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -18,9 +19,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefi
accessibility: 'private',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [93, 96],
loc: {
@@ -30,10 +35,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefi
},
optional: true,
- override: false,
+- readonly: false,
static: false,
value: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'undefined',
+- optional: false,
range: [100, 109],
loc: {
@@ -56,9 +64,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefi
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [79, 80],
loc: {
@@ -66,6 +78,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-optional-property-undefi
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 112],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/1-TSESTree-AST.shot
index 6c360848e819..2197513374bf 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "show",
+ optional: false,
range: [135, 139],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: true,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -64,9 +70,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "SpecializedComponent",
+ optional: false,
range: [79, 99],
loc: {
@@ -74,9 +84,12 @@ Program {
end: { column: 26, line: 3 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "SomeComponent",
+ optional: false,
range: [108, 121],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/5-AST-Alignment-AST.shot
index 6d916c72d855..1d2e6f791eeb 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-method/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,119 @@
exports[`AST Fixtures legacy-fixtures basics class-with-override-method AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [
+ MethodDefinition {
+ type: 'MethodDefinition',
+ computed: false,
+- decorators: Array [],
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'show',
+- optional: false,
+
+ range: [135, 139],
+ loc: {
+ start: { column: 11, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+ kind: 'method',
+- optional: false,
+ override: true,
+ static: false,
+ value: FunctionExpression {
+ type: 'FunctionExpression',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [142, 158],
+ loc: {
+ start: { column: 18, line: 4 },
+ end: { column: 3, line: 6 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: null,
+ params: Array [],
+
+ range: [139, 158],
+ loc: {
+ start: { column: 15, line: 4 },
+ end: { column: 3, line: 6 },
+ },
+ },
+
+ range: [126, 158],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 3, line: 6 },
+ },
+ },
+ ],
+
+ range: [122, 160],
+ loc: {
+ start: { column: 49, line: 3 },
+ end: { column: 1, line: 7 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'SpecializedComponent',
+- optional: false,
+
+ range: [79, 99],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+- implements: Array [],
+ superClass: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'SomeComponent',
+- optional: false,
+
+ range: [108, 121],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 48, line: 3 },
+ },
+ },
+
+ range: [73, 160],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 7 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 161],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 8 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/1-TSESTree-AST.shot
index 61da284abee9..c45a39c6ed01 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [135, 138],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 14, line: 4 },
},
},
+ optional: false,
override: true,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -51,9 +58,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "SpecializedComponent",
+ optional: false,
range: [79, 99],
loc: {
@@ -61,9 +72,12 @@ Program {
end: { column: 26, line: 3 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "SomeComponent",
+ optional: false,
range: [108, 121],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/5-AST-Alignment-AST.shot
index 644f6e34e871..78cbdbf91c7a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-override-property/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-override-property AST Al
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,9 +18,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-override-property AST Al
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [135, 138],
loc: {
@@ -27,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-override-property AST Al
end: { column: 14, line: 4 },
},
},
+- optional: false,
override: true,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -55,9 +62,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-override-property AST Al
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'SpecializedComponent',
+- optional: false,
range: [79, 99],
loc: {
@@ -65,9 +76,12 @@ exports[`AST Fixtures legacy-fixtures basics class-with-override-property AST Al
end: { column: 26, line: 3 },
},
},
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'SomeComponent',
+- optional: false,
range: [108, 121],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/1-TSESTree-AST.shot
index 2345a59e2458..136ce8c0a909 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,6 +14,8 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: PrivateIdentifier {
type: "PrivateIdentifier",
name: "prop",
@@ -25,6 +28,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -56,6 +60,8 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: PrivateIdentifier {
type: "PrivateIdentifier",
name: "propExplicitWithValue",
@@ -68,6 +74,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -109,6 +116,8 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: PrivateIdentifier {
type: "PrivateIdentifier",
name: "propImplicitWithValue",
@@ -121,6 +130,7 @@ Program {
},
optional: true,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -148,9 +158,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -158,6 +172,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 176],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/5-AST-Alignment-AST.shot
index 74230c6766ad..69ea76bfb71b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-optional-property/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-propert
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,6 +18,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-propert
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: PrivateIdentifier {
type: 'PrivateIdentifier',
name: 'prop',
@@ -29,6 +32,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-propert
},
optional: true,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -60,6 +64,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-propert
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: PrivateIdentifier {
type: 'PrivateIdentifier',
name: 'propExplicitWithValue',
@@ -72,6 +78,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-propert
},
optional: true,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -113,6 +120,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-propert
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: PrivateIdentifier {
type: 'PrivateIdentifier',
name: 'propImplicitWithValue',
@@ -125,6 +134,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-propert
},
optional: true,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -152,9 +162,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-propert
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -162,6 +176,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-optional-propert
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 176],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/1-TSESTree-AST.shot
index cc50481ad32d..4f20f32c5f4a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [87, 98],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 6, line: 9 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -45,9 +51,13 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "private",
+ decorators: [],
+ override: false,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "firstName",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -73,6 +83,8 @@ Program {
end: { column: 29, line: 5 },
},
},
+ readonly: false,
+ static: false,
range: [104, 129],
loc: {
@@ -83,9 +95,13 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "private",
+ decorators: [],
+ override: false,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "lastName",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -112,6 +128,7 @@ Program {
},
},
readonly: true,
+ static: false,
range: [135, 168],
loc: {
@@ -122,11 +139,16 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "private",
+ decorators: [],
+ override: false,
parameter: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "age",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -152,6 +174,7 @@ Program {
end: { column: 23, line: 7 },
},
},
+ optional: false,
right: Literal {
type: "Literal",
raw: "30",
@@ -170,6 +193,8 @@ Program {
end: { column: 28, line: 7 },
},
},
+ readonly: false,
+ static: false,
range: [174, 198],
loc: {
@@ -180,11 +205,16 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "private",
+ decorators: [],
+ override: false,
parameter: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "student",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSBooleanKeyword {
@@ -210,6 +240,7 @@ Program {
end: { column: 37, line: 8 },
},
},
+ optional: false,
right: Literal {
type: "Literal",
raw: "false",
@@ -229,6 +260,7 @@ Program {
},
},
readonly: true,
+ static: false,
range: [204, 245],
loc: {
@@ -259,9 +291,13 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -269,6 +305,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 255],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/5-AST-Alignment-AST.shot
index ff7c7f9bdd3b..e4442ac9ee39 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [87, 98],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
end: { column: 6, line: 9 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -49,9 +55,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'private',
+- decorators: Array [],
+- override: false,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'firstName',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -77,6 +87,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
end: { column: 29, line: 5 },
},
},
+- readonly: false,
+- static: false,
range: [104, 129],
loc: {
@@ -87,9 +99,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'private',
+- decorators: Array [],
+- override: false,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'lastName',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -116,6 +132,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
},
},
readonly: true,
+- static: false,
range: [135, 168],
loc: {
@@ -126,11 +143,16 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'private',
+- decorators: Array [],
+- override: false,
parameter: AssignmentPattern {
type: 'AssignmentPattern',
+- decorators: Array [],
left: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'age',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -156,6 +178,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
end: { column: 23, line: 7 },
},
},
+- optional: false,
right: Literal {
type: 'Literal',
raw: '30',
@@ -174,6 +197,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
end: { column: 28, line: 7 },
},
},
+- readonly: false,
+- static: false,
range: [174, 198],
loc: {
@@ -184,11 +209,16 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'private',
+- decorators: Array [],
+- override: false,
parameter: AssignmentPattern {
type: 'AssignmentPattern',
+- decorators: Array [],
left: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'student',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSBooleanKeyword {
@@ -214,6 +244,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
end: { column: 37, line: 8 },
},
},
+- optional: false,
right: Literal {
type: 'Literal',
raw: 'false',
@@ -233,6 +264,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
},
},
readonly: true,
+- static: false,
range: [204, 245],
loc: {
@@ -263,9 +295,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
end: { column: 1, line: 10 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -273,6 +309,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-private-parameter-proper
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 255],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/1-TSESTree-AST.shot
index 08731622aee7..1b7cbd923199 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [87, 90],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 5, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -116,9 +123,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [131, 134],
loc: {
@@ -126,7 +137,9 @@ Program {
end: { column: 5, line: 5 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -151,7 +164,9 @@ Program {
async: false,
body: Identifier {
type: "Identifier",
+ decorators: [],
name: "test",
+ optional: false,
range: [151, 155],
loc: {
@@ -185,9 +200,13 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -195,6 +214,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 158],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/5-AST-Alignment-AST.shot
index bcee1481572e..fb9a4cf2fd1f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-function/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-function AST Al
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,9 +18,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-function AST Al
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [87, 90],
loc: {
@@ -27,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-function AST Al
end: { column: 5, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -122,9 +129,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-function AST Al
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [131, 134],
loc: {
@@ -132,7 +143,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-function AST Al
end: { column: 5, line: 5 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -157,7 +170,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-function AST Al
async: false,
body: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'test',
+- optional: false,
range: [151, 155],
loc: {
@@ -191,9 +206,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-function AST Al
end: { column: 1, line: 6 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -201,6 +220,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-function AST Al
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 158],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/1-TSESTree-AST.shot
index 8c99f343cb7c..b647ce5bec95 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [87, 88],
loc: {
@@ -23,7 +28,9 @@ Program {
end: { column: 3, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -47,9 +54,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [96, 97],
loc: {
@@ -57,7 +68,9 @@ Program {
end: { column: 3, line: 5 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: ObjectExpression {
type: "ObjectExpression",
@@ -80,9 +93,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [106, 107],
loc: {
@@ -90,7 +107,9 @@ Program {
end: { column: 3, line: 6 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: ArrayExpression {
type: "ArrayExpression",
@@ -113,9 +132,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "d",
+ optional: false,
range: [116, 117],
loc: {
@@ -123,7 +146,9 @@ Program {
end: { column: 3, line: 7 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -147,9 +172,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "e",
+ optional: false,
range: [126, 127],
loc: {
@@ -157,7 +186,9 @@ Program {
end: { column: 3, line: 8 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: NewExpression {
type: "NewExpression",
@@ -207,7 +238,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "Array",
+ optional: false,
range: [134, 139],
loc: {
@@ -237,9 +270,13 @@ Program {
end: { column: 1, line: 9 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -247,6 +284,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 155],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/5-AST-Alignment-AST.shot
index 2994f248b8dd..2e8c6d128813 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-property-values/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,9 +18,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [87, 88],
loc: {
@@ -27,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
end: { column: 3, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -51,9 +58,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [96, 97],
loc: {
@@ -61,7 +72,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
end: { column: 3, line: 5 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: ObjectExpression {
type: 'ObjectExpression',
@@ -84,9 +97,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'c',
+- optional: false,
range: [106, 107],
loc: {
@@ -94,7 +111,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
end: { column: 3, line: 6 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: ArrayExpression {
type: 'ArrayExpression',
@@ -117,9 +136,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'd',
+- optional: false,
range: [116, 117],
loc: {
@@ -127,7 +150,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
end: { column: 3, line: 7 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -151,9 +176,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'e',
+- optional: false,
range: [126, 127],
loc: {
@@ -161,7 +190,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
end: { column: 3, line: 8 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: NewExpression {
type: 'NewExpression',
@@ -211,7 +242,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Array',
+- optional: false,
range: [134, 139],
loc: {
@@ -241,9 +274,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
end: { column: 1, line: 9 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -251,6 +288,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-property-values AST Alig
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 155],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/1-TSESTree-AST.shot
index 08f9c25204a9..9d7508893291 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [87, 98],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 6, line: 9 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -45,9 +51,13 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "protected",
+ decorators: [],
+ override: false,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "firstName",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -73,6 +83,8 @@ Program {
end: { column: 31, line: 5 },
},
},
+ readonly: false,
+ static: false,
range: [104, 131],
loc: {
@@ -83,9 +95,13 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "protected",
+ decorators: [],
+ override: false,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "lastName",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -112,6 +128,7 @@ Program {
},
},
readonly: true,
+ static: false,
range: [137, 172],
loc: {
@@ -122,11 +139,16 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "protected",
+ decorators: [],
+ override: false,
parameter: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "age",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -152,6 +174,7 @@ Program {
end: { column: 25, line: 7 },
},
},
+ optional: false,
right: Literal {
type: "Literal",
raw: "30",
@@ -170,6 +193,8 @@ Program {
end: { column: 30, line: 7 },
},
},
+ readonly: false,
+ static: false,
range: [178, 204],
loc: {
@@ -180,11 +205,16 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "protected",
+ decorators: [],
+ override: false,
parameter: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "student",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSBooleanKeyword {
@@ -210,6 +240,7 @@ Program {
end: { column: 39, line: 8 },
},
},
+ optional: false,
right: Literal {
type: "Literal",
raw: "false",
@@ -229,6 +260,7 @@ Program {
},
},
readonly: true,
+ static: false,
range: [210, 253],
loc: {
@@ -259,9 +291,13 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -269,6 +305,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 263],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/5-AST-Alignment-AST.shot
index 74a8495047cc..ad237190d0e3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-protected-parameter-properties/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [87, 98],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
end: { column: 6, line: 9 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -49,9 +55,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'protected',
+- decorators: Array [],
+- override: false,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'firstName',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -77,6 +87,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
end: { column: 31, line: 5 },
},
},
+- readonly: false,
+- static: false,
range: [104, 131],
loc: {
@@ -87,9 +99,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'protected',
+- decorators: Array [],
+- override: false,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'lastName',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -116,6 +132,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
},
},
readonly: true,
+- static: false,
range: [137, 172],
loc: {
@@ -126,11 +143,16 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'protected',
+- decorators: Array [],
+- override: false,
parameter: AssignmentPattern {
type: 'AssignmentPattern',
+- decorators: Array [],
left: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'age',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -156,6 +178,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
end: { column: 25, line: 7 },
},
},
+- optional: false,
right: Literal {
type: 'Literal',
raw: '30',
@@ -174,6 +197,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
end: { column: 30, line: 7 },
},
},
+- readonly: false,
+- static: false,
range: [178, 204],
loc: {
@@ -184,11 +209,16 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'protected',
+- decorators: Array [],
+- override: false,
parameter: AssignmentPattern {
type: 'AssignmentPattern',
+- decorators: Array [],
left: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'student',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSBooleanKeyword {
@@ -214,6 +244,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
end: { column: 39, line: 8 },
},
},
+- optional: false,
right: Literal {
type: 'Literal',
raw: 'false',
@@ -233,6 +264,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
},
},
readonly: true,
+- static: false,
range: [210, 253],
loc: {
@@ -263,9 +295,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
end: { column: 1, line: 10 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -273,6 +309,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-protected-parameter-prop
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 263],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/1-TSESTree-AST.shot
index 8730d2fe21c4..6203a0e5ab6e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [87, 98],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 6, line: 9 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -45,9 +51,13 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "public",
+ decorators: [],
+ override: false,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "firstName",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -73,6 +83,8 @@ Program {
end: { column: 28, line: 5 },
},
},
+ readonly: false,
+ static: false,
range: [104, 128],
loc: {
@@ -83,9 +95,13 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "public",
+ decorators: [],
+ override: false,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "lastName",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -112,6 +128,7 @@ Program {
},
},
readonly: true,
+ static: false,
range: [134, 166],
loc: {
@@ -122,11 +139,16 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "public",
+ decorators: [],
+ override: false,
parameter: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "age",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -152,6 +174,7 @@ Program {
end: { column: 22, line: 7 },
},
},
+ optional: false,
right: Literal {
type: "Literal",
raw: "30",
@@ -170,6 +193,8 @@ Program {
end: { column: 27, line: 7 },
},
},
+ readonly: false,
+ static: false,
range: [172, 195],
loc: {
@@ -180,11 +205,16 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "public",
+ decorators: [],
+ override: false,
parameter: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "student",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSBooleanKeyword {
@@ -210,6 +240,7 @@ Program {
end: { column: 36, line: 8 },
},
},
+ optional: false,
right: Literal {
type: "Literal",
raw: "false",
@@ -229,6 +260,7 @@ Program {
},
},
readonly: true,
+ static: false,
range: [201, 241],
loc: {
@@ -259,9 +291,13 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -269,6 +305,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 251],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/5-AST-Alignment-AST.shot
index ce5f1910bb79..44c167b1a1e3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-public-parameter-properties/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [87, 98],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
end: { column: 6, line: 9 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -49,9 +55,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'public',
+- decorators: Array [],
+- override: false,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'firstName',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -77,6 +87,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
end: { column: 28, line: 5 },
},
},
+- readonly: false,
+- static: false,
range: [104, 128],
loc: {
@@ -87,9 +99,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'public',
+- decorators: Array [],
+- override: false,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'lastName',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -116,6 +132,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
},
},
readonly: true,
+- static: false,
range: [134, 166],
loc: {
@@ -126,11 +143,16 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'public',
+- decorators: Array [],
+- override: false,
parameter: AssignmentPattern {
type: 'AssignmentPattern',
+- decorators: Array [],
left: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'age',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -156,6 +178,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
end: { column: 22, line: 7 },
},
},
+- optional: false,
right: Literal {
type: 'Literal',
raw: '30',
@@ -174,6 +197,8 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
end: { column: 27, line: 7 },
},
},
+- readonly: false,
+- static: false,
range: [172, 195],
loc: {
@@ -184,11 +209,16 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'public',
+- decorators: Array [],
+- override: false,
parameter: AssignmentPattern {
type: 'AssignmentPattern',
+- decorators: Array [],
left: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'student',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSBooleanKeyword {
@@ -214,6 +244,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
end: { column: 36, line: 8 },
},
},
+- optional: false,
right: Literal {
type: 'Literal',
raw: 'false',
@@ -233,6 +264,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
},
},
readonly: true,
+- static: false,
range: [201, 241],
loc: {
@@ -263,9 +295,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
end: { column: 1, line: 10 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -273,6 +309,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-public-parameter-propert
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 251],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/1-TSESTree-AST.shot
index 21c719fd677d..a6f0867e59c8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [87, 98],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,15 +43,20 @@ Program {
end: { column: 6, line: 7 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
TSParameterProperty {
type: "TSParameterProperty",
+ decorators: [],
+ override: false,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "firstName",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -73,6 +83,7 @@ Program {
},
},
readonly: true,
+ static: false,
range: [104, 130],
loc: {
@@ -82,11 +93,16 @@ Program {
},
TSParameterProperty {
type: "TSParameterProperty",
+ decorators: [],
+ override: false,
parameter: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "lastName",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -112,6 +128,7 @@ Program {
end: { column: 29, line: 6 },
},
},
+ optional: false,
right: Literal {
type: "Literal",
raw: "'Smith'",
@@ -131,6 +148,7 @@ Program {
},
},
readonly: true,
+ static: false,
range: [136, 171],
loc: {
@@ -161,9 +179,13 @@ Program {
end: { column: 1, line: 8 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -171,6 +193,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 181],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/5-AST-Alignment-AST.shot
index 1db770be545d..1ca1af2cf8a9 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-parameter-properties/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-prope
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [87, 98],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-prope
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,15 +47,20 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-prope
end: { column: 6, line: 7 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
TSParameterProperty {
type: 'TSParameterProperty',
+- decorators: Array [],
+- override: false,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'firstName',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -77,6 +87,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-prope
},
},
readonly: true,
+- static: false,
range: [104, 130],
loc: {
@@ -86,11 +97,16 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-prope
},
TSParameterProperty {
type: 'TSParameterProperty',
+- decorators: Array [],
+- override: false,
parameter: AssignmentPattern {
type: 'AssignmentPattern',
+- decorators: Array [],
left: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'lastName',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -116,6 +132,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-prope
end: { column: 29, line: 6 },
},
},
+- optional: false,
right: Literal {
type: 'Literal',
raw: '\\'Smith\\'',
@@ -135,6 +152,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-prope
},
},
readonly: true,
+- static: false,
range: [136, 171],
loc: {
@@ -165,9 +183,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-prope
end: { column: 1, line: 8 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -175,6 +197,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-parameter-prope
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 181],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/1-TSESTree-AST.shot
index ca701f29c922..e88857f97661 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -14,9 +15,13 @@ Program {
accessibility: "public",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [103, 106],
loc: {
@@ -24,6 +29,7 @@ Program {
end: { column: 21, line: 4 },
},
},
+ optional: false,
override: false,
readonly: true,
static: false,
@@ -53,9 +59,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -63,6 +73,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 120],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/5-AST-Alignment-AST.shot
index 05e055f18681..f9625e1c3d8c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-readonly-property/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property AST Al
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -18,9 +19,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property AST Al
accessibility: 'public',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [103, 106],
loc: {
@@ -28,6 +33,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property AST Al
end: { column: 21, line: 4 },
},
},
+- optional: false,
- override: false,
readonly: true,
static: false,
@@ -57,9 +63,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property AST Al
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -67,6 +77,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-readonly-property AST Al
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 120],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot
index bc32cf62cdc6..5767b8e1490d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 21, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -37,7 +43,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [87, 90],
loc: {
@@ -55,7 +63,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [83, 84],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot
index 83d183469759..d240107e7973 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-default/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default A
end: { column: 21, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -30,6 +35,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default A
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -41,7 +47,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default A
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [87, 90],
loc: {
@@ -59,7 +67,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-default A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [83, 84],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot
index ab0d61339b4f..aad8bbe2661d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 15, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [79, 80],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -36,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "__P",
+ optional: false,
range: [81, 84],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot
index d4ed8c5b153b..cba6e4ec96d9 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscor
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscor
end: { column: 15, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [79, 80],
loc: {
@@ -30,6 +35,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscor
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -40,7 +46,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter-underscor
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: '__P',
+- optional: false,
-
- range: [81, 84],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot
index 2fc7b07e32f1..5d3fe4d7fedb 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 15, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -36,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [83, 84],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot
index 8a7308c52fc9..8e9b7c04328e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/class-with-type-parameter/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter AST Align
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter AST Align
end: { column: 15, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -30,6 +35,7 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter AST Align
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -40,7 +46,9 @@ exports[`AST Fixtures legacy-fixtures basics class-with-type-parameter AST Align
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [83, 84],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot
index 525ff8bf7dad..6afdeed4fd39 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot
@@ -7,9 +7,12 @@ Program {
TSEnumDeclaration {
type: "TSEnumDeclaration",
const: true,
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [84, 87],
loc: {
@@ -20,9 +23,12 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [92, 95],
loc: {
@@ -50,9 +56,12 @@ Program {
},
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [103, 106],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot
index 51feccb1a784..3ca65220e227 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,99 @@
exports[`AST Fixtures legacy-fixtures basics const-enum AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSEnumDeclaration {
+ type: 'TSEnumDeclaration',
+ const: true,
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [84, 87],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ members: Array [
+ TSEnumMember {
+ type: 'TSEnumMember',
+- computed: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [92, 95],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ initializer: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [98, 99],
+ loc: {
+ start: { column: 8, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+
+ range: [92, 99],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ TSEnumMember {
+ type: 'TSEnumMember',
+- computed: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [103, 106],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+
+ range: [103, 106],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+ ],
+
+ range: [73, 109],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 110],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 7 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/1-TSESTree-AST.shot
index ab799166a14e..2db687cb7f9f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [95, 98],
loc: {
@@ -30,6 +34,7 @@ Program {
type: "TSEmptyBodyFunctionExpression",
async: false,
body: null,
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -75,9 +80,12 @@ Program {
},
},
declare: true,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [87, 90],
loc: {
@@ -85,6 +93,7 @@ Program {
end: { column: 17, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 109],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot
index 7d0c4c30d1a3..ac37aadfa0f5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-class-with-optional-method/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics declare-class-with-optional-method
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [95, 98],
loc: {
@@ -36,6 +40,7 @@ exports[`AST Fixtures legacy-fixtures basics declare-class-with-optional-method
+ type: 'FunctionExpression',
async: false,
- body: null,
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -81,9 +86,12 @@ exports[`AST Fixtures legacy-fixtures basics declare-class-with-optional-method
},
},
declare: true,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [87, 90],
loc: {
@@ -91,6 +99,7 @@ exports[`AST Fixtures legacy-fixtures basics declare-class-with-optional-method
end: { column: 17, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 109],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/1-TSESTree-AST.shot
index f85238b8cce5..7d54f723e058 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [90, 93],
loc: {
@@ -23,7 +25,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot
index 286d6f2f74f8..ab61cdfdda66 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/declare-function/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,94 @@
exports[`AST Fixtures legacy-fixtures basics declare-function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSDeclareFunction {
+ type: 'TSDeclareFunction',
+ async: false,
+ declare: true,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [90, 93],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [99, 105],
+ loc: {
+ start: { column: 26, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
+
+ range: [97, 105],
+ loc: {
+ start: { column: 24, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
+
+ range: [94, 105],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [108, 114],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+
+ range: [106, 114],
+ loc: {
+ start: { column: 33, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+
+ range: [73, 115],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 42, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 116],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/1-TSESTree-AST.shot
index 0208520f6fc4..2b65620857ea 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/1-TSESTree-AST.shot
@@ -10,13 +10,17 @@ Program {
type: "AssignmentExpression",
left: ObjectPattern {
type: "ObjectPattern",
+ decorators: [],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -26,18 +30,24 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: ObjectPattern {
type: "ObjectPattern",
+ decorators: [],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [85, 88],
loc: {
@@ -47,18 +57,24 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: ObjectPattern {
type: "ObjectPattern",
+ decorators: [],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [92, 95],
loc: {
@@ -68,15 +84,20 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: ArrayPattern {
type: "ArrayPattern",
+ decorators: [],
elements: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [98, 99],
loc: {
@@ -86,15 +107,20 @@ Program {
},
AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: ObjectPattern {
type: "ObjectPattern",
+ decorators: [],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [103, 106],
loc: {
@@ -104,15 +130,20 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: ArrayPattern {
type: "ArrayPattern",
+ decorators: [],
elements: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [109, 110],
loc: {
@@ -121,6 +152,7 @@ Program {
},
},
],
+ optional: false,
range: [108, 111],
loc: {
@@ -128,6 +160,7 @@ Program {
end: { column: 35, line: 4 },
},
},
+ optional: false,
right: ArrayExpression {
type: "ArrayExpression",
elements: [
@@ -172,6 +205,7 @@ Program {
end: { column: 43, line: 4 },
},
},
+ optional: false,
right: ObjectExpression {
type: "ObjectExpression",
properties: [
@@ -180,7 +214,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [124, 127],
loc: {
@@ -190,6 +226,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: ArrayExpression {
type: "ArrayExpression",
@@ -236,6 +273,7 @@ Program {
},
},
],
+ optional: false,
range: [97, 135],
loc: {
@@ -243,6 +281,7 @@ Program {
end: { column: 59, line: 4 },
},
},
+ optional: false,
right: ArrayExpression {
type: "ArrayExpression",
elements: [],
@@ -275,6 +314,7 @@ Program {
end: { column: 66, line: 4 },
},
},
+ optional: false,
right: ObjectExpression {
type: "ObjectExpression",
properties: [],
@@ -307,6 +347,7 @@ Program {
end: { column: 73, line: 4 },
},
},
+ optional: false,
right: ObjectExpression {
type: "ObjectExpression",
properties: [],
@@ -348,7 +389,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [162, 165],
loc: {
@@ -358,6 +401,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: ObjectExpression {
type: "ObjectExpression",
@@ -367,7 +411,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [169, 172],
loc: {
@@ -377,6 +423,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: ObjectExpression {
type: "ObjectExpression",
@@ -386,7 +433,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [176, 179],
loc: {
@@ -396,6 +445,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: ArrayExpression {
type: "ArrayExpression",
@@ -419,7 +469,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [187, 190],
loc: {
@@ -429,6 +481,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: ArrayExpression {
type: "ArrayExpression",
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/5-AST-Alignment-AST.shot
index 5dac5966e175..ccff1fdb9974 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-nested/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,602 @@
exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-nested AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AssignmentExpression {
+ type: 'AssignmentExpression',
+ left: ObjectPattern {
+ type: 'ObjectPattern',
+- decorators: Array [],
+- optional: false,
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: AssignmentPattern {
+ type: 'AssignmentPattern',
+- decorators: Array [],
+ left: ObjectPattern {
+ type: 'ObjectPattern',
+- decorators: Array [],
+- optional: false,
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [85, 88],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 12, line: 4 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: AssignmentPattern {
+ type: 'AssignmentPattern',
+- decorators: Array [],
+ left: ObjectPattern {
+ type: 'ObjectPattern',
+- decorators: Array [],
+- optional: false,
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'baz',
+- optional: false,
+
+ range: [92, 95],
+ loc: {
+ start: { column: 16, line: 4 },
+ end: { column: 19, line: 4 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: AssignmentPattern {
+ type: 'AssignmentPattern',
+- decorators: Array [],
+ left: ArrayPattern {
+ type: 'ArrayPattern',
+- decorators: Array [],
+ elements: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [98, 99],
+ loc: {
+ start: { column: 22, line: 4 },
+ end: { column: 23, line: 4 },
+ },
+ },
+ AssignmentPattern {
+ type: 'AssignmentPattern',
+- decorators: Array [],
+ left: ObjectPattern {
+ type: 'ObjectPattern',
+- decorators: Array [],
+- optional: false,
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [103, 106],
+ loc: {
+ start: { column: 27, line: 4 },
+ end: { column: 30, line: 4 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: AssignmentPattern {
+ type: 'AssignmentPattern',
+- decorators: Array [],
+ left: ArrayPattern {
+ type: 'ArrayPattern',
+- decorators: Array [],
+ elements: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [109, 110],
+ loc: {
+ start: { column: 33, line: 4 },
+ end: { column: 34, line: 4 },
+ },
+ },
+ ],
+- optional: false,
+
+ range: [108, 111],
+ loc: {
+ start: { column: 32, line: 4 },
+ end: { column: 35, line: 4 },
+ },
+ },
+- optional: false,
+ right: ArrayExpression {
+ type: 'ArrayExpression',
+ elements: Array [
+ Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [115, 116],
+ loc: {
+ start: { column: 39, line: 4 },
+ end: { column: 40, line: 4 },
+ },
+ },
+ ],
+
+ range: [114, 117],
+ loc: {
+ start: { column: 38, line: 4 },
+ end: { column: 41, line: 4 },
+ },
+ },
+
+ range: [108, 117],
+ loc: {
+ start: { column: 32, line: 4 },
+ end: { column: 41, line: 4 },
+ },
+ },
+
+ range: [103, 117],
+ loc: {
+ start: { column: 27, line: 4 },
+ end: { column: 41, line: 4 },
+ },
+ },
+ ],
+
+ range: [101, 119],
+ loc: {
+ start: { column: 25, line: 4 },
+ end: { column: 43, line: 4 },
+ },
+ },
+- optional: false,
+ right: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [124, 127],
+ loc: {
+ start: { column: 48, line: 4 },
+ end: { column: 51, line: 4 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: ArrayExpression {
+ type: 'ArrayExpression',
+ elements: Array [
+ Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [130, 131],
+ loc: {
+ start: { column: 54, line: 4 },
+ end: { column: 55, line: 4 },
+ },
+ },
+ ],
+
+ range: [129, 132],
+ loc: {
+ start: { column: 53, line: 4 },
+ end: { column: 56, line: 4 },
+ },
+ },
+
+ range: [124, 132],
+ loc: {
+ start: { column: 48, line: 4 },
+ end: { column: 56, line: 4 },
+ },
+ },
+ ],
+
+ range: [122, 134],
+ loc: {
+ start: { column: 46, line: 4 },
+ end: { column: 58, line: 4 },
+ },
+ },
+
+ range: [101, 134],
+ loc: {
+ start: { column: 25, line: 4 },
+ end: { column: 58, line: 4 },
+ },
+ },
+ ],
+- optional: false,
+
+ range: [97, 135],
+ loc: {
+ start: { column: 21, line: 4 },
+ end: { column: 59, line: 4 },
+ },
+ },
+- optional: false,
+ right: ArrayExpression {
+ type: 'ArrayExpression',
+ elements: Array [],
+
+ range: [138, 140],
+ loc: {
+ start: { column: 62, line: 4 },
+ end: { column: 64, line: 4 },
+ },
+ },
+
+ range: [97, 140],
+ loc: {
+ start: { column: 21, line: 4 },
+ end: { column: 64, line: 4 },
+ },
+ },
+
+ range: [92, 140],
+ loc: {
+ start: { column: 16, line: 4 },
+ end: { column: 64, line: 4 },
+ },
+ },
+ ],
+
+ range: [90, 142],
+ loc: {
+ start: { column: 14, line: 4 },
+ end: { column: 66, line: 4 },
+ },
+ },
+- optional: false,
+ right: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [],
+
+ range: [145, 147],
+ loc: {
+ start: { column: 69, line: 4 },
+ end: { column: 71, line: 4 },
+ },
+ },
+
+ range: [90, 147],
+ loc: {
+ start: { column: 14, line: 4 },
+ end: { column: 71, line: 4 },
+ },
+ },
+
+ range: [85, 147],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 71, line: 4 },
+ },
+ },
+ ],
+
+ range: [83, 149],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 73, line: 4 },
+ },
+ },
+- optional: false,
+ right: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [],
+
+ range: [152, 154],
+ loc: {
+ start: { column: 76, line: 4 },
+ end: { column: 78, line: 4 },
+ },
+ },
+
+ range: [83, 154],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 78, line: 4 },
+ },
+ },
+
+ range: [78, 154],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 78, line: 4 },
+ },
+ },
+ ],
+
+ range: [74, 157],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ operator: '=',
+ right: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [162, 165],
+ loc: {
+ start: { column: 6, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [169, 172],
+ loc: {
+ start: { column: 13, line: 5 },
+ end: { column: 16, line: 5 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'baz',
+- optional: false,
+
+ range: [176, 179],
+ loc: {
+ start: { column: 20, line: 5 },
+ end: { column: 23, line: 5 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: ArrayExpression {
+ type: 'ArrayExpression',
+ elements: Array [
+ Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [182, 183],
+ loc: {
+ start: { column: 26, line: 5 },
+ end: { column: 27, line: 5 },
+ },
+ },
+ ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [187, 190],
+ loc: {
+ start: { column: 31, line: 5 },
+ end: { column: 34, line: 5 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: ArrayExpression {
+ type: 'ArrayExpression',
+ elements: Array [
+ Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [193, 194],
+ loc: {
+ start: { column: 37, line: 5 },
+ end: { column: 38, line: 5 },
+ },
+ },
+ ],
+
+ range: [192, 195],
+ loc: {
+ start: { column: 36, line: 5 },
+ end: { column: 39, line: 5 },
+ },
+ },
+
+ range: [187, 195],
+ loc: {
+ start: { column: 31, line: 5 },
+ end: { column: 39, line: 5 },
+ },
+ },
+ ],
+
+ range: [185, 197],
+ loc: {
+ start: { column: 29, line: 5 },
+ end: { column: 41, line: 5 },
+ },
+ },
+ ],
+
+ range: [181, 198],
+ loc: {
+ start: { column: 25, line: 5 },
+ end: { column: 42, line: 5 },
+ },
+ },
+
+ range: [176, 198],
+ loc: {
+ start: { column: 20, line: 5 },
+ end: { column: 42, line: 5 },
+ },
+ },
+ ],
+
+ range: [174, 200],
+ loc: {
+ start: { column: 18, line: 5 },
+ end: { column: 44, line: 5 },
+ },
+ },
+
+ range: [169, 200],
+ loc: {
+ start: { column: 13, line: 5 },
+ end: { column: 44, line: 5 },
+ },
+ },
+ ],
+
+ range: [167, 202],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 46, line: 5 },
+ },
+ },
+
+ range: [162, 202],
+ loc: {
+ start: { column: 6, line: 5 },
+ end: { column: 46, line: 5 },
+ },
+ },
+ ],
+
+ range: [160, 204],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 48, line: 5 },
+ },
+ },
+
+ range: [74, 204],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 48, line: 5 },
+ },
+ },
+
+ range: [73, 206],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 50, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 207],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/1-TSESTree-AST.shot
index 65038c760f7b..10dd0ffe1bd1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/1-TSESTree-AST.shot
@@ -10,13 +10,17 @@ Program {
type: "AssignmentExpression",
left: ObjectPattern {
type: "ObjectPattern",
+ decorators: [],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [76, 79],
loc: {
@@ -26,12 +30,16 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: true,
value: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [76, 79],
loc: {
@@ -39,6 +47,7 @@ Program {
end: { column: 6, line: 3 },
},
},
+ optional: false,
right: ObjectExpression {
type: "ObjectExpression",
properties: [],
@@ -74,7 +83,9 @@ Program {
operator: "=",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [89, 92],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/5-AST-Alignment-AST.shot
index ae08e0c3a918..55963364596d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-object/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,122 @@
exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-object AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AssignmentExpression {
+ type: 'AssignmentExpression',
+ left: ObjectPattern {
+ type: 'ObjectPattern',
+- decorators: Array [],
+- optional: false,
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [76, 79],
+ loc: {
+ start: { column: 3, line: 3 },
+ end: { column: 6, line: 3 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: true,
+ value: AssignmentPattern {
+ type: 'AssignmentPattern',
+- decorators: Array [],
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [76, 79],
+ loc: {
+ start: { column: 3, line: 3 },
+ end: { column: 6, line: 3 },
+ },
+ },
+- optional: false,
+ right: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [],
+
+ range: [82, 84],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+
+ range: [76, 84],
+ loc: {
+ start: { column: 3, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+
+ range: [76, 84],
+ loc: {
+ start: { column: 3, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ ],
+
+ range: [74, 86],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ operator: '=',
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [89, 92],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+
+ range: [74, 92],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 95],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/1-TSESTree-AST.shot
index 64289d39b278..5621e6238f03 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 35, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [82, 85],
loc: {
@@ -32,15 +35,20 @@ Program {
params: [
AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: ObjectPattern {
type: "ObjectPattern",
+ decorators: [],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [88, 91],
loc: {
@@ -50,12 +58,16 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: true,
value: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [88, 91],
loc: {
@@ -63,6 +75,7 @@ Program {
end: { column: 18, line: 3 },
},
},
+ optional: false,
right: ArrayExpression {
type: "ArrayExpression",
elements: [],
@@ -95,9 +108,12 @@ Program {
end: { column: 25, line: 3 },
},
},
+ optional: false,
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [101, 104],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/5-AST-Alignment-AST.shot
index c4b496ef8564..d79e152fe48f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment-property/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,151 @@
exports[`AST Fixtures legacy-fixtures basics destructuring-assignment-property AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [106, 108],
+ loc: {
+ start: { column: 33, line: 3 },
+ end: { column: 35, line: 3 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [82, 85],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ params: Array [
+ AssignmentPattern {
+ type: 'AssignmentPattern',
+- decorators: Array [],
+ left: ObjectPattern {
+ type: 'ObjectPattern',
+- decorators: Array [],
+- optional: false,
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: true,
+ value: AssignmentPattern {
+ type: 'AssignmentPattern',
+- decorators: Array [],
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+- optional: false,
+ right: ArrayExpression {
+ type: 'ArrayExpression',
+ elements: Array [],
+
+ range: [94, 96],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+
+ range: [88, 96],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+
+ range: [88, 96],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ ],
+
+ range: [86, 98],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 25, line: 3 },
+ },
+ },
+- optional: false,
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [101, 104],
+ loc: {
+ start: { column: 28, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+
+ range: [86, 104],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 108],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 35, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 109],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/1-TSESTree-AST.shot
index a62db8717c44..d30825466015 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/1-TSESTree-AST.shot
@@ -10,13 +10,17 @@ Program {
type: "AssignmentExpression",
left: ObjectPattern {
type: "ObjectPattern",
+ decorators: [],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [76, 79],
loc: {
@@ -26,12 +30,16 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: true,
value: AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [76, 79],
loc: {
@@ -39,6 +47,7 @@ Program {
end: { column: 6, line: 3 },
},
},
+ optional: false,
right: ArrayExpression {
type: "ArrayExpression",
elements: [],
@@ -74,7 +83,9 @@ Program {
operator: "=",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [89, 92],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/5-AST-Alignment-AST.shot
index 004656cc596c..c3df90d7c072 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/destructuring-assignment/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,122 @@
exports[`AST Fixtures legacy-fixtures basics destructuring-assignment AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AssignmentExpression {
+ type: 'AssignmentExpression',
+ left: ObjectPattern {
+ type: 'ObjectPattern',
+- decorators: Array [],
+- optional: false,
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [76, 79],
+ loc: {
+ start: { column: 3, line: 3 },
+ end: { column: 6, line: 3 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: true,
+ value: AssignmentPattern {
+ type: 'AssignmentPattern',
+- decorators: Array [],
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [76, 79],
+ loc: {
+ start: { column: 3, line: 3 },
+ end: { column: 6, line: 3 },
+ },
+ },
+- optional: false,
+ right: ArrayExpression {
+ type: 'ArrayExpression',
+ elements: Array [],
+
+ range: [82, 84],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+
+ range: [76, 84],
+ loc: {
+ start: { column: 3, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+
+ range: [76, 84],
+ loc: {
+ start: { column: 3, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ ],
+
+ range: [74, 86],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ operator: '=',
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [89, 92],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+
+ range: [74, 92],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 95],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot
index f289b977ef4e..7c05eb3cdd17 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/1-TSESTree-AST.shot
@@ -35,9 +35,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [108, 109],
loc: {
@@ -64,6 +67,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [104, 114],
@@ -100,9 +104,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [80, 83],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot
index 983df429af09..27076dd3da2b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-module/snapshots/5-AST-Alignment-AST.shot
@@ -39,9 +39,12 @@ exports[`AST Fixtures legacy-fixtures basics directive-in-module AST Alignment -
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [108, 109],
loc: {
@@ -68,6 +71,7 @@ exports[`AST Fixtures legacy-fixtures basics directive-in-module AST Alignment -
},
},
],
+- declare: false,
kind: 'var',
range: [104, 114],
@@ -104,9 +108,13 @@ exports[`AST Fixtures legacy-fixtures basics directive-in-module AST Alignment -
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [80, 83],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-Babel-AST.shot
new file mode 100644
index 000000000000..79bfb11b0650
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-Babel-AST.shot
@@ -0,0 +1,128 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics directive-in-namespace Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: Array [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: Array [
+ ExpressionStatement {
+ type: "ExpressionStatement",
+ expression: Literal {
+ type: "Literal",
+ raw: "'use strict'",
+ value: "use strict",
+
+ range: [91, 103],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+
+ range: [91, 104],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+ VariableDeclaration {
+ type: "VariableDeclaration",
+ declarations: Array [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ id: Identifier {
+ type: "Identifier",
+ name: "a",
+
+ range: [111, 112],
+ loc: {
+ start: { column: 6, line: 5 },
+ end: { column: 7, line: 5 },
+ },
+ },
+ init: Literal {
+ type: "Literal",
+ raw: "1",
+ value: 1,
+
+ range: [115, 116],
+ loc: {
+ start: { column: 10, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+
+ range: [111, 116],
+ loc: {
+ start: { column: 6, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+ ],
+ kind: "var",
+
+ range: [107, 117],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 12, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: "ExpressionStatement",
+ expression: Literal {
+ type: "Literal",
+ raw: "'use strict'",
+ value: "use strict",
+
+ range: [120, 132],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 14, line: 6 },
+ },
+ },
+
+ range: [120, 133],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 15, line: 6 },
+ },
+ },
+ ],
+
+ range: [87, 135],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 1, line: 7 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "foo",
+
+ range: [83, 86],
+ loc: {
+ start: { column: 10, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [73, 135],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 7 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [73, 136],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 8 },
+ },
+}
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot
index 034c72640690..548efbed006f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/1-TSESTree-AST.shot
@@ -35,9 +35,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [111, 112],
loc: {
@@ -64,6 +67,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [107, 117],
@@ -100,9 +104,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/2-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/2-Babel-Tokens.shot
new file mode 100644
index 000000000000..d3ffef96096b
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/2-Babel-Tokens.shot
@@ -0,0 +1,136 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures basics directive-in-namespace Babel - Tokens 1`] = `
+Array [
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [73, 82],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "foo",
+
+ range: [83, 86],
+ loc: {
+ start: { column: 10, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [87, 88],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ String {
+ type: "String",
+ value: "'use strict'",
+
+ range: [91, 103],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [103, 104],
+ loc: {
+ start: { column: 14, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "var",
+
+ range: [107, 110],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "a",
+
+ range: [111, 112],
+ loc: {
+ start: { column: 6, line: 5 },
+ end: { column: 7, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [113, 114],
+ loc: {
+ start: { column: 8, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ Numeric {
+ type: "Numeric",
+ value: "1",
+
+ range: [115, 116],
+ loc: {
+ start: { column: 10, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [116, 117],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 12, line: 5 },
+ },
+ },
+ String {
+ type: "String",
+ value: "'use strict'",
+
+ range: [120, 132],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 14, line: 6 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [132, 133],
+ loc: {
+ start: { column: 14, line: 6 },
+ end: { column: 15, line: 6 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [134, 135],
+ loc: {
+ start: { column: 0, line: 7 },
+ end: { column: 1, line: 7 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot
index 75f2472ffbcf..a087b50a3820 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/directive-in-namespace/snapshots/5-AST-Alignment-AST.shot
@@ -39,9 +39,12 @@ exports[`AST Fixtures legacy-fixtures basics directive-in-namespace AST Alignmen
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [111, 112],
loc: {
@@ -68,6 +71,7 @@ exports[`AST Fixtures legacy-fixtures basics directive-in-namespace AST Alignmen
},
},
],
+- declare: false,
kind: 'var',
range: [107, 117],
@@ -104,9 +108,13 @@ exports[`AST Fixtures legacy-fixtures basics directive-in-namespace AST Alignmen
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/1-TSESTree-AST.shot
index de0b160d2c8c..75537c0edbdd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/1-TSESTree-AST.shot
@@ -16,7 +16,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "assert",
+ optional: false,
range: [89, 95],
loc: {
@@ -26,6 +28,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: ObjectExpression {
type: "ObjectExpression",
@@ -35,7 +38,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "type",
+ optional: false,
range: [99, 103],
loc: {
@@ -45,6 +50,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: Literal {
type: "Literal",
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot
index 30c981d13d04..e2f15f25d11e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,133 @@
exports[`AST Fixtures legacy-fixtures basics dynamic-import-with-import-assertions AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ImportExpression {
+ type: 'ImportExpression',
+ attributes: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'assert',
+- optional: false,
+
+ range: [89, 95],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'type',
+- optional: false,
+
+ range: [99, 103],
+ loc: {
+ start: { column: 26, line: 3 },
+ end: { column: 30, line: 3 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: Literal {
+ type: 'Literal',
+ raw: '\\'json\\'',
+ value: 'json',
+
+ range: [105, 111],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [99, 111],
+ loc: {
+ start: { column: 26, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+ ],
+
+ range: [97, 113],
+ loc: {
+ start: { column: 24, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+
+ range: [89, 113],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+ ],
+
+ range: [87, 115],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 42, line: 3 },
+ },
+ },
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'foo\\'',
+ value: 'foo',
+
+ range: [80, 85],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ range: [73, 116],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 43, line: 3 },
+ },
+ },
+
+ range: [73, 117],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 118],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot
index 91065f7d377f..370da1994725 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/1-TSESTree-AST.shot
@@ -11,7 +11,9 @@ Program {
type: "ImportAttribute",
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "type",
+ optional: false,
range: [102, 106],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot
index 2993c4da95d1..58f3e3de323b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-all-with-import-assertions/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,75 @@
exports[`AST Fixtures legacy-fixtures basics export-all-with-import-assertions AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportAllDeclaration {
+ type: 'ExportAllDeclaration',
+ assertions: Array [
+ ImportAttribute {
+ type: 'ImportAttribute',
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'type',
+- optional: false,
+
+ range: [102, 106],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
+ value: Literal {
+ type: 'Literal',
+ raw: '\\'json\\'',
+ value: 'json',
+
+ range: [108, 114],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+
+ range: [102, 114],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+ ],
+ exported: null,
+ exportKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [87, 92],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+
+ range: [73, 117],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [73, 118],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/1-TSESTree-AST.shot
index 85787e9178f6..1b635af9404b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,9 @@ Program {
type: "TSNamespaceExportDeclaration",
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [93, 94],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/5-AST-Alignment-AST.shot
index aa1998499a42..7eb5256b9213 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-as-namespace/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,40 @@
exports[`AST Fixtures legacy-fixtures basics export-as-namespace AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSNamespaceExportDeclaration {
+ type: 'TSNamespaceExportDeclaration',
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [93, 94],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+
+ range: [73, 95],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 96],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/1-TSESTree-AST.shot
index 8c71fbb0d3c5..0445aaa80636 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,9 @@ Program {
type: "TSExportAssignment",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [82, 85],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/5-AST-Alignment-AST.shot
index 06a9e4da38ed..152aef092c8d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/5-AST-Alignment-AST.shot
@@ -12,7 +12,9 @@ exports[`AST Fixtures legacy-fixtures basics export-assignment AST Alignment - A
type: 'TSExportAssignment',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [82, 85],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot
index acd54640c923..f1169f5926c4 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot
@@ -13,7 +13,9 @@ Program {
declare: true,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [99, 102],
loc: {
@@ -24,9 +26,12 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [107, 110],
loc: {
@@ -54,9 +59,12 @@ Program {
},
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [118, 121],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot
index 5dced47878b0..b3b73fdb4019 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot
@@ -17,7 +17,9 @@ exports[`AST Fixtures legacy-fixtures basics export-declare-const-named-enum AST
declare: true,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [99, 102],
loc: {
@@ -28,9 +30,12 @@ exports[`AST Fixtures legacy-fixtures basics export-declare-const-named-enum AST
members: Array [
TSEnumMember {
type: 'TSEnumMember',
+- computed: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [107, 110],
loc: {
@@ -58,9 +63,12 @@ exports[`AST Fixtures legacy-fixtures basics export-declare-const-named-enum AST
},
TSEnumMember {
type: 'TSEnumMember',
+- computed: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [118, 121],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot
index 1981d24b5416..3b057de32f42 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot
@@ -9,10 +9,13 @@ Program {
assertions: [],
declaration: TSEnumDeclaration {
type: "TSEnumDeclaration",
+ const: false,
declare: true,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [93, 96],
loc: {
@@ -23,9 +26,12 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [101, 104],
loc: {
@@ -53,9 +59,12 @@ Program {
},
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [112, 115],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot
index 73d878a12ec5..2d768bbf61bc 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot
@@ -13,10 +13,13 @@ exports[`AST Fixtures legacy-fixtures basics export-declare-named-enum AST Align
assertions: Array [],
declaration: TSEnumDeclaration {
type: 'TSEnumDeclaration',
+- const: false,
declare: true,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [93, 96],
loc: {
@@ -27,9 +30,12 @@ exports[`AST Fixtures legacy-fixtures basics export-declare-named-enum AST Align
members: Array [
TSEnumMember {
type: 'TSEnumMember',
+- computed: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [101, 104],
loc: {
@@ -57,9 +63,12 @@ exports[`AST Fixtures legacy-fixtures basics export-declare-named-enum AST Align
},
TSEnumMember {
type: 'TSEnumMember',
+- computed: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [112, 115],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot
index f14b54d6f6fd..02a82deb45fd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/1-TSESTree-AST.shot
@@ -8,6 +8,7 @@ Program {
type: "ExportDefaultDeclaration",
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,7 +19,10 @@ Program {
end: { column: 26, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: null,
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -29,7 +33,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [94, 95],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot
index 64dc9ab9f6f5..cac3d3b9badd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-generic/snapshots/5-AST-Alignment-AST.shot
@@ -12,6 +12,7 @@ exports[`AST Fixtures legacy-fixtures basics export-default-class-with-generic A
type: 'ExportDefaultDeclaration',
declaration: ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -22,7 +23,10 @@ exports[`AST Fixtures legacy-fixtures basics export-default-class-with-generic A
end: { column: 26, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: null,
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -33,7 +37,9 @@ exports[`AST Fixtures legacy-fixtures basics export-default-class-with-generic A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [94, 95],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot
index d89a9df30ad8..5e0be290b4a5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot
@@ -8,6 +8,7 @@ Program {
type: "ExportDefaultDeclaration",
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,7 +19,10 @@ Program {
end: { column: 29, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: null,
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -29,7 +33,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [94, 95],
loc: {
@@ -51,7 +57,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [97, 98],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot
index 77a16a4302d1..420e9c2ef197 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot
@@ -12,6 +12,7 @@ exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple-
type: 'ExportDefaultDeclaration',
declaration: ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -22,7 +23,10 @@ exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple-
end: { column: 29, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: null,
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -33,7 +37,9 @@ exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple-
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [94, 95],
- loc: {
@@ -56,7 +62,9 @@ exports[`AST Fixtures legacy-fixtures basics export-default-class-with-multiple-
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [97, 98],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/1-TSESTree-AST.shot
index 8123d01f3ce5..89ac186b96db 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/1-TSESTree-AST.shot
@@ -16,7 +16,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "method1",
+ optional: false,
range: [104, 111],
loc: {
@@ -25,7 +27,9 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSVoidKeyword {
@@ -44,6 +48,7 @@ Program {
end: { column: 17, line: 4 },
},
},
+ static: false,
range: [104, 120],
loc: {
@@ -59,9 +64,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [98, 99],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/5-AST-Alignment-AST.shot
index 201605ce2b53..28434626438a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-default-interface/snapshots/5-AST-Alignment-AST.shot
@@ -20,7 +20,9 @@ exports[`AST Fixtures legacy-fixtures basics export-default-interface AST Alignm
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'method1',
+- optional: false,
range: [104, 111],
loc: {
@@ -29,7 +31,9 @@ exports[`AST Fixtures legacy-fixtures basics export-default-interface AST Alignm
},
},
kind: 'method',
+- optional: false,
- params: Array [],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ parameters: Array [],
+ typeAnnotation: TSTypeAnnotation {
@@ -50,6 +54,7 @@ exports[`AST Fixtures legacy-fixtures basics export-default-interface AST Alignm
end: { column: 17, line: 4 },
},
},
+- static: false,
range: [104, 120],
loc: {
@@ -65,9 +70,13 @@ exports[`AST Fixtures legacy-fixtures basics export-default-interface AST Alignm
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [98, 99],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot
index 7422a63cf75e..937557783dae 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/1-TSESTree-AST.shot
@@ -9,6 +9,7 @@ Program {
assertions: [],
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -19,9 +20,13 @@ Program {
end: { column: 22, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [86, 89],
loc: {
@@ -29,6 +34,7 @@ Program {
end: { column: 16, line: 3 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -39,7 +45,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [90, 91],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot
index 45815b0a9780..cd249e319cc3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-generic/snapshots/5-AST-Alignment-AST.shot
@@ -13,6 +13,7 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic AST
assertions: Array [],
declaration: ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -23,9 +24,13 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic AST
end: { column: 22, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [86, 89],
loc: {
@@ -33,6 +38,7 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic AST
end: { column: 16, line: 3 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -43,7 +49,9 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-generic AST
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [90, 91],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot
index 2691f90e0a9b..efc242f4dfdf 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/1-TSESTree-AST.shot
@@ -9,6 +9,7 @@ Program {
assertions: [],
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -19,9 +20,13 @@ Program {
end: { column: 25, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [86, 89],
loc: {
@@ -29,6 +34,7 @@ Program {
end: { column: 16, line: 3 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -39,7 +45,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [90, 91],
loc: {
@@ -61,7 +69,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [93, 94],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot
index cafef05a22f2..122e2a3401f4 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/snapshots/5-AST-Alignment-AST.shot
@@ -13,6 +13,7 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-ge
assertions: Array [],
declaration: ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -23,9 +24,13 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-ge
end: { column: 25, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [86, 89],
loc: {
@@ -33,6 +38,7 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-ge
end: { column: 16, line: 3 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -43,7 +49,9 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-ge
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [90, 91],
- loc: {
@@ -66,7 +74,9 @@ exports[`AST Fixtures legacy-fixtures basics export-named-class-with-multiple-ge
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [93, 94],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot
index 0f3b87238913..cb3489f2b02c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,13 @@ Program {
assertions: [],
declaration: TSEnumDeclaration {
type: "TSEnumDeclaration",
+ const: false,
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [85, 88],
loc: {
@@ -22,9 +26,12 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [93, 96],
loc: {
@@ -52,9 +59,12 @@ Program {
},
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [104, 107],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot
index 596d7bfe3564..1471fe301277 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,112 @@
exports[`AST Fixtures legacy-fixtures basics export-named-enum AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportNamedDeclaration {
+ type: 'ExportNamedDeclaration',
+ assertions: Array [],
+ declaration: TSEnumDeclaration {
+ type: 'TSEnumDeclaration',
+- const: false,
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [85, 88],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ members: Array [
+ TSEnumMember {
+ type: 'TSEnumMember',
+- computed: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [93, 96],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ initializer: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [99, 100],
+ loc: {
+ start: { column: 8, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+
+ range: [93, 100],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ TSEnumMember {
+ type: 'TSEnumMember',
+- computed: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [104, 107],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+
+ range: [104, 107],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+ ],
+
+ range: [80, 110],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ exportKind: 'value',
+ source: null,
+ specifiers: Array [],
+
+ range: [73, 110],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [73, 111],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 7 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot
index db21ea312284..20335c1996f3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/1-TSESTree-AST.shot
@@ -9,7 +9,9 @@ Program {
assertions: [],
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [85, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot
index b102f45164be..e6b5545d6af4 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-star-as-ns-from/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,53 @@
exports[`AST Fixtures legacy-fixtures basics export-star-as-ns-from AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportAllDeclaration {
+ type: 'ExportAllDeclaration',
+ assertions: Array [],
+ exported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [85, 88],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ exportKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'bar\\'',
+ value: 'bar',
+
+ range: [94, 99],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+
+ range: [73, 100],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [73, 101],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot
index 4d3b0b70ad02..afa8b1708821 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/1-TSESTree-AST.shot
@@ -15,7 +15,9 @@ Program {
type: "ExportSpecifier",
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [92, 93],
loc: {
@@ -26,7 +28,9 @@ Program {
exportKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [87, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot
index 8526243ea236..c9dea6f3214b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-as/snapshots/5-AST-Alignment-AST.shot
@@ -19,7 +19,9 @@ exports[`AST Fixtures legacy-fixtures basics export-type-as AST Alignment - AST
type: 'ExportSpecifier',
exported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [92, 93],
loc: {
@@ -30,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics export-type-as AST Alignment - AST
exportKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [87, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot
index d3ce9d5bfaba..ddf7996e773e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/1-TSESTree-AST.shot
@@ -25,7 +25,9 @@ Program {
type: "ExportSpecifier",
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [92, 93],
loc: {
@@ -36,7 +38,9 @@ Program {
exportKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [87, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot
index c56c283e4934..0192033c1684 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from-as/snapshots/5-AST-Alignment-AST.shot
@@ -29,7 +29,9 @@ exports[`AST Fixtures legacy-fixtures basics export-type-from-as AST Alignment -
type: 'ExportSpecifier',
exported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [92, 93],
loc: {
@@ -40,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures basics export-type-from-as AST Alignment -
exportKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [87, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot
index 4b41be24d989..4c12ca941c00 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/1-TSESTree-AST.shot
@@ -25,7 +25,9 @@ Program {
type: "ExportSpecifier",
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [87, 90],
loc: {
@@ -36,7 +38,9 @@ Program {
exportKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [87, 90],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot
index 66480f7b11f6..47d6b2af6f20 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type-from/snapshots/5-AST-Alignment-AST.shot
@@ -29,7 +29,9 @@ exports[`AST Fixtures legacy-fixtures basics export-type-from AST Alignment - AS
type: 'ExportSpecifier',
exported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [87, 90],
loc: {
@@ -40,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures basics export-type-from AST Alignment - AS
exportKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [87, 90],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot
index 8cc6dd169787..017fb0f7bed7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/1-TSESTree-AST.shot
@@ -15,7 +15,9 @@ Program {
type: "ExportSpecifier",
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [87, 90],
loc: {
@@ -26,7 +28,9 @@ Program {
exportKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [87, 90],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot
index dca27176e25a..b34ddb187f67 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-type/snapshots/5-AST-Alignment-AST.shot
@@ -19,7 +19,9 @@ exports[`AST Fixtures legacy-fixtures basics export-type AST Alignment - AST 1`]
type: 'ExportSpecifier',
exported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [87, 90],
loc: {
@@ -30,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics export-type AST Alignment - AST 1`]
exportKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [87, 90],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot
index a517f7dd0c19..098ac45c2342 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "obj",
+ optional: false,
range: [77, 80],
loc: {
@@ -29,7 +32,9 @@ Program {
type: "ReturnStatement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [118, 119],
loc: {
@@ -52,13 +57,16 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -94,7 +102,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [93, 94],
loc: {
@@ -133,6 +143,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [73, 123],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
index 5f19d6e96e4e..48c04d40f70f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-paramet
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'obj',
+- optional: false,
range: [77, 80],
loc: {
@@ -33,7 +36,9 @@ exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-paramet
type: 'ReturnStatement',
argument: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [118, 119],
loc: {
@@ -56,13 +61,16 @@ exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-paramet
end: { column: 1, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -98,7 +106,9 @@ exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-paramet
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [93, 94],
- loc: {
@@ -138,6 +148,7 @@ exports[`AST Fixtures legacy-fixtures basics function-anonymus-with-type-paramet
},
},
],
+- declare: false,
kind: 'var',
range: [73, 123],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/1-TSESTree-AST.shot
index e321751787b9..cb7cfa023686 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "obj",
+ optional: false,
range: [77, 80],
loc: {
@@ -32,6 +35,7 @@ Program {
end: { column: 30, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -69,6 +73,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [73, 104],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/5-AST-Alignment-AST.shot
index 9fe3b48e4567..98998cbaa448 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,97 @@
exports[`AST Fixtures legacy-fixtures basics function-anynomus-with-return-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'obj',
+- optional: false,
+
+ range: [77, 80],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ init: FunctionExpression {
+ type: 'FunctionExpression',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [101, 103],
+ loc: {
+ start: { column: 28, line: 3 },
+ end: { column: 30, line: 3 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: null,
+ params: Array [],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSVoidKeyword {
+ type: 'TSVoidKeyword',
+
+ range: [96, 100],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+
+ range: [94, 100],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+
+ range: [83, 103],
+ loc: {
+ start: { column: 10, line: 3 },
+ end: { column: 30, line: 3 },
+ },
+ },
+
+ range: [77, 103],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 30, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [73, 104],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 105],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot
index 3a08ae462175..7472805c4261 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/1-TSESTree-AST.shot
@@ -10,11 +10,14 @@ Program {
declaration: TSDeclareFunction {
type: "TSDeclareFunction",
async: false,
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
range: [89, 90],
loc: {
@@ -25,7 +28,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -93,11 +98,14 @@ Program {
declaration: TSDeclareFunction {
type: "TSDeclareFunction",
async: false,
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
range: [127, 128],
loc: {
@@ -108,7 +116,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -183,7 +193,9 @@ Program {
type: "ReturnStatement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [215, 216],
loc: {
@@ -206,11 +218,14 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
range: [165, 166],
loc: {
@@ -221,7 +236,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnionType {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot
index 76b94490a41e..4af306c530cd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-overloads/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,355 @@
exports[`AST Fixtures legacy-fixtures basics function-overloads AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportNamedDeclaration {
+ type: 'ExportNamedDeclaration',
+ assertions: Array [],
+ declaration: TSDeclareFunction {
+ type: 'TSDeclareFunction',
+ async: false,
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'f',
+- optional: false,
+
+ range: [89, 90],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [94, 100],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+
+ range: [92, 100],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+
+ range: [91, 100],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [103, 109],
+ loc: {
+ start: { column: 30, line: 3 },
+ end: { column: 36, line: 3 },
+ },
+ },
+
+ range: [101, 109],
+ loc: {
+ start: { column: 28, line: 3 },
+ end: { column: 36, line: 3 },
+ },
+ },
+
+ range: [80, 110],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 37, line: 3 },
+ },
+ },
+ exportKind: 'value',
+ source: null,
+ specifiers: Array [],
+
+ range: [73, 110],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 37, line: 3 },
+ },
+ },
+ ExportNamedDeclaration {
+ type: 'ExportNamedDeclaration',
+ assertions: Array [],
+ declaration: TSDeclareFunction {
+ type: 'TSDeclareFunction',
+ async: false,
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'f',
+- optional: false,
+
+ range: [127, 128],
+ loc: {
+ start: { column: 16, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [132, 138],
+ loc: {
+ start: { column: 21, line: 4 },
+ end: { column: 27, line: 4 },
+ },
+ },
+
+ range: [130, 138],
+ loc: {
+ start: { column: 19, line: 4 },
+ end: { column: 27, line: 4 },
+ },
+ },
+
+ range: [129, 138],
+ loc: {
+ start: { column: 18, line: 4 },
+ end: { column: 27, line: 4 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [141, 147],
+ loc: {
+ start: { column: 30, line: 4 },
+ end: { column: 36, line: 4 },
+ },
+ },
+
+ range: [139, 147],
+ loc: {
+ start: { column: 28, line: 4 },
+ end: { column: 36, line: 4 },
+ },
+ },
+
+ range: [118, 148],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+ exportKind: 'value',
+ source: null,
+ specifiers: Array [],
+
+ range: [111, 148],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+ ExportNamedDeclaration {
+ type: 'ExportNamedDeclaration',
+ assertions: Array [],
+ declaration: FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [215, 216],
+ loc: {
+ start: { column: 9, line: 6 },
+ end: { column: 10, line: 6 },
+ },
+ },
+
+ range: [208, 217],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 11, line: 6 },
+ },
+ },
+ ],
+
+ range: [204, 219],
+ loc: {
+ start: { column: 55, line: 5 },
+ end: { column: 1, line: 7 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'f',
+- optional: false,
+
+ range: [165, 166],
+ loc: {
+ start: { column: 16, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSUnionType {
+ type: 'TSUnionType',
+ types: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [170, 176],
+ loc: {
+ start: { column: 21, line: 5 },
+ end: { column: 27, line: 5 },
+ },
+ },
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [179, 185],
+ loc: {
+ start: { column: 30, line: 5 },
+ end: { column: 36, line: 5 },
+ },
+ },
+ ],
+
+ range: [170, 185],
+ loc: {
+ start: { column: 21, line: 5 },
+ end: { column: 36, line: 5 },
+ },
+ },
+
+ range: [168, 185],
+ loc: {
+ start: { column: 19, line: 5 },
+ end: { column: 36, line: 5 },
+ },
+ },
+
+ range: [167, 185],
+ loc: {
+ start: { column: 18, line: 5 },
+ end: { column: 36, line: 5 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSUnionType {
+ type: 'TSUnionType',
+ types: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [188, 194],
+ loc: {
+ start: { column: 39, line: 5 },
+ end: { column: 45, line: 5 },
+ },
+ },
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [197, 203],
+ loc: {
+ start: { column: 48, line: 5 },
+ end: { column: 54, line: 5 },
+ },
+ },
+ ],
+
+ range: [188, 203],
+ loc: {
+ start: { column: 39, line: 5 },
+ end: { column: 54, line: 5 },
+ },
+ },
+
+ range: [186, 203],
+ loc: {
+ start: { column: 37, line: 5 },
+ end: { column: 54, line: 5 },
+ },
+ },
+
+ range: [156, 219],
+ loc: {
+ start: { column: 7, line: 5 },
+ end: { column: 1, line: 7 },
+ },
+ },
+ exportKind: 'value',
+ source: null,
+ specifiers: Array [],
+
+ range: [149, 219],
+ loc: {
+ start: { column: 0, line: 5 },
+ end: { column: 1, line: 7 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [73, 220],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 8 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/1-TSESTree-AST.shot
index cc8333d69f82..ea042f62a709 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/1-TSESTree-AST.shot
@@ -16,7 +16,9 @@ Program {
type: "AwaitExpression",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "future",
+ optional: false,
range: [111, 117],
loc: {
@@ -46,11 +48,14 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "hope",
+ optional: false,
range: [88, 92],
loc: {
@@ -61,7 +66,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "future",
+ optional: false,
range: [93, 99],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/5-AST-Alignment-AST.shot
index 101a3738026d..bb4bbd0d6a1f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-await/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,99 @@
exports[`AST Fixtures legacy-fixtures basics function-with-await AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: true,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AwaitExpression {
+ type: 'AwaitExpression',
+ argument: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'future',
+- optional: false,
+
+ range: [111, 117],
+ loc: {
+ start: { column: 8, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+
+ range: [105, 117],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+
+ range: [105, 118],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+ ],
+
+ range: [101, 120],
+ loc: {
+ start: { column: 28, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'hope',
+- optional: false,
+
+ range: [88, 92],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'future',
+- optional: false,
+
+ range: [93, 99],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 120],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 121],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/1-TSESTree-AST.shot
index ceac643045da..0b4da9c4e48e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 53, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [82, 85],
loc: {
@@ -32,13 +35,17 @@ Program {
params: [
ObjectPattern {
type: "ObjectPattern",
+ decorators: [],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [88, 91],
loc: {
@@ -48,10 +55,13 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: true,
value: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [88, 91],
loc: {
@@ -71,7 +81,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [93, 96],
loc: {
@@ -81,10 +93,13 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: true,
value: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [93, 96],
loc: {
@@ -110,7 +125,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [102, 105],
loc: {
@@ -119,6 +136,8 @@ Program {
},
},
optional: true,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -149,7 +168,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [116, 119],
loc: {
@@ -158,6 +179,8 @@ Program {
},
},
optional: true,
+ readonly: false,
+ static: false,
range: [116, 120],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/5-AST-Alignment-AST.shot
index d8a406bb7e9a..9403dbbd2a95 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,233 @@
exports[`AST Fixtures legacy-fixtures basics function-with-object-type-with-optional-properties AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [124, 126],
+ loc: {
+ start: { column: 51, line: 3 },
+ end: { column: 53, line: 3 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [82, 85],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ params: Array [
+ ObjectPattern {
+ type: 'ObjectPattern',
+- decorators: Array [],
+- optional: false,
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: true,
+ value: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'baz',
+- optional: false,
+
+ range: [93, 96],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: true,
+ value: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'baz',
+- optional: false,
+
+ range: [93, 96],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+
+ range: [93, 96],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ ],
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeLiteral {
+ type: 'TSTypeLiteral',
+ members: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [102, 105],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
+ optional: true,
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [108, 114],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+
+ range: [106, 114],
+ loc: {
+ start: { column: 33, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+
+ range: [102, 115],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 42, line: 3 },
+ },
+ },
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'baz',
+- optional: false,
+
+ range: [116, 119],
+ loc: {
+ start: { column: 43, line: 3 },
+ end: { column: 46, line: 3 },
+ },
+ },
+ optional: true,
+- readonly: false,
+- static: false,
+
+ range: [116, 120],
+ loc: {
+ start: { column: 43, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+ ],
+
+ range: [100, 122],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 49, line: 3 },
+ },
+ },
+
+ range: [98, 122],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 49, line: 3 },
+ },
+ },
+
+ range: [86, 122],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 49, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 126],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 53, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 127],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/1-TSESTree-AST.shot
index fdcd9f2678ee..79b756b93730 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 51, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [82, 85],
loc: {
@@ -32,13 +35,17 @@ Program {
params: [
ObjectPattern {
type: "ObjectPattern",
+ decorators: [],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [88, 91],
loc: {
@@ -48,10 +55,13 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: true,
value: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [88, 91],
loc: {
@@ -71,7 +81,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [93, 96],
loc: {
@@ -81,10 +93,13 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: true,
value: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [93, 96],
loc: {
@@ -110,7 +125,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [102, 105],
loc: {
@@ -118,6 +135,9 @@ Program {
end: { column: 32, line: 3 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -148,7 +168,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [115, 118],
loc: {
@@ -156,6 +178,9 @@ Program {
end: { column: 45, line: 3 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
range: [115, 118],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/5-AST-Alignment-AST.shot
index 3f1b0bd4bc49..718411382118 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,233 @@
exports[`AST Fixtures legacy-fixtures basics function-with-object-type-without-annotation AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [122, 124],
+ loc: {
+ start: { column: 49, line: 3 },
+ end: { column: 51, line: 3 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [82, 85],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ params: Array [
+ ObjectPattern {
+ type: 'ObjectPattern',
+- decorators: Array [],
+- optional: false,
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: true,
+ value: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'baz',
+- optional: false,
+
+ range: [93, 96],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: true,
+ value: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'baz',
+- optional: false,
+
+ range: [93, 96],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+
+ range: [93, 96],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ ],
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeLiteral {
+ type: 'TSTypeLiteral',
+ members: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [102, 105],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [107, 113],
+ loc: {
+ start: { column: 34, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+
+ range: [105, 113],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+
+ range: [102, 114],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'baz',
+- optional: false,
+
+ range: [115, 118],
+ loc: {
+ start: { column: 42, line: 3 },
+ end: { column: 45, line: 3 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+
+ range: [115, 118],
+ loc: {
+ start: { column: 42, line: 3 },
+ end: { column: 45, line: 3 },
+ },
+ },
+ ],
+
+ range: [100, 120],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+
+ range: [98, 120],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+
+ range: [86, 120],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 124],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 51, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 125],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot
index d11b181c592e..f6ea490cce31 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 36, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "compare",
+ optional: false,
range: [82, 89],
loc: {
@@ -39,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [102, 103],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot
index c096db788aa2..af719ee6a526 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/snapshots/5-AST-Alignment-AST.shot
@@ -21,11 +21,14 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-that-
end: { column: 36, line: 3 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'compare',
+- optional: false,
range: [82, 89],
loc: {
@@ -43,7 +46,9 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-that-
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [102, 103],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot
index 90107e35f6de..7335f3531341 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
type: "ReturnStatement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [118, 119],
loc: {
@@ -37,11 +39,14 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [82, 83],
loc: {
@@ -52,14 +57,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [101, 102],
loc: {
@@ -95,7 +104,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [105, 106],
loc: {
@@ -136,7 +147,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [84, 85],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot
index 76444e06f3c3..958d02dbd056 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-
type: 'ReturnStatement',
argument: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [118, 119],
loc: {
@@ -41,11 +43,14 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-
end: { column: 1, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [82, 83],
loc: {
@@ -56,14 +61,18 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [101, 102],
loc: {
@@ -99,7 +108,9 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [105, 106],
loc: {
@@ -140,7 +151,9 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters-with-
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'X',
+- optional: false,
-
- range: [84, 85],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot
index 3bf1239b8201..359f76eafd50 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
type: "ReturnStatement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [107, 108],
loc: {
@@ -37,11 +39,14 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [82, 83],
loc: {
@@ -52,14 +57,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [90, 91],
loc: {
@@ -95,7 +104,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [94, 95],
loc: {
@@ -126,7 +137,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [84, 85],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
index a47e9957bd9d..efeb1329956a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters AST A
type: 'ReturnStatement',
argument: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [107, 108],
loc: {
@@ -41,11 +43,14 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters AST A
end: { column: 1, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [82, 83],
loc: {
@@ -56,14 +61,18 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters AST A
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [90, 91],
loc: {
@@ -99,7 +108,9 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters AST A
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [94, 95],
loc: {
@@ -130,7 +141,9 @@ exports[`AST Fixtures legacy-fixtures basics function-with-type-parameters AST A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'X',
+- optional: false,
-
- range: [84, 85],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot
index 28a1cf6468ad..989c307d0982 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
type: "ReturnStatement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "name",
+ optional: false,
range: [174, 178],
loc: {
@@ -37,11 +39,14 @@ Program {
end: { column: 1, line: 9 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "message",
+ optional: false,
range: [82, 89],
loc: {
@@ -52,7 +57,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "name",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -80,9 +87,12 @@ Program {
},
AssignmentPattern {
type: "AssignmentPattern",
+ decorators: [],
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "age",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -108,6 +118,7 @@ Program {
end: { column: 13, line: 5 },
},
},
+ optional: false,
right: Literal {
type: "Literal",
raw: "100",
@@ -130,7 +141,9 @@ Program {
type: "RestElement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "args",
+ optional: false,
range: [133, 137],
loc: {
@@ -138,21 +151,13 @@ Program {
end: { column: 9, line: 6 },
},
},
+ decorators: [],
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Array",
-
- range: [139, 144],
- loc: {
- start: { column: 11, line: 6 },
- end: { column: 16, line: 6 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSStringKeyword {
@@ -172,6 +177,18 @@ Program {
end: { column: 24, line: 6 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Array",
+ optional: false,
+
+ range: [139, 144],
+ loc: {
+ start: { column: 11, line: 6 },
+ end: { column: 16, line: 6 },
+ },
+ },
range: [139, 152],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot
index 71bd9bfc1f11..19856aa2f16c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types-assignation/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,262 @@
exports[`AST Fixtures legacy-fixtures basics function-with-types-assignation AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'name',
+- optional: false,
+
+ range: [174, 178],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 13, line: 8 },
+ },
+ },
+
+ range: [167, 179],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 14, line: 8 },
+ },
+ },
+ ],
+
+ range: [163, 181],
+ loc: {
+ start: { column: 10, line: 7 },
+ end: { column: 1, line: 9 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'message',
+- optional: false,
+
+ range: [82, 89],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'name',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [99, 105],
+ loc: {
+ start: { column: 8, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+
+ range: [97, 105],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+
+ range: [93, 105],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+ AssignmentPattern {
+ type: 'AssignmentPattern',
+- decorators: Array [],
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'age',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [114, 120],
+ loc: {
+ start: { column: 7, line: 5 },
+ end: { column: 13, line: 5 },
+ },
+ },
+
+ range: [112, 120],
+ loc: {
+ start: { column: 5, line: 5 },
+ end: { column: 13, line: 5 },
+ },
+ },
+
+ range: [109, 120],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 13, line: 5 },
+ },
+ },
+- optional: false,
+ right: Literal {
+ type: 'Literal',
+ raw: '100',
+ value: 100,
+
+ range: [123, 126],
+ loc: {
+ start: { column: 16, line: 5 },
+ end: { column: 19, line: 5 },
+ },
+ },
+
+ range: [109, 126],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 19, line: 5 },
+ },
+ },
+ RestElement {
+ type: 'RestElement',
+ argument: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'args',
+- optional: false,
+
+ range: [133, 137],
+ loc: {
+ start: { column: 5, line: 6 },
+ end: { column: 9, line: 6 },
+ },
+ },
+- decorators: Array [],
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Array',
++
++ range: [139, 144],
++ loc: {
++ start: { column: 11, line: 6 },
++ end: { column: 16, line: 6 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [145, 151],
+ loc: {
+ start: { column: 17, line: 6 },
+ end: { column: 23, line: 6 },
+ },
+ },
+ ],
+
+ range: [144, 152],
+ loc: {
+ start: { column: 16, line: 6 },
+ end: { column: 24, line: 6 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Array',
+- optional: false,
+-
+- range: [139, 144],
+- loc: {
+- start: { column: 11, line: 6 },
+- end: { column: 16, line: 6 },
+ },
+ },
+
+ range: [139, 152],
+ loc: {
+ start: { column: 11, line: 6 },
+ end: { column: 24, line: 6 },
+ },
+ },
+
+ range: [137, 152],
+ loc: {
+ start: { column: 9, line: 6 },
+ end: { column: 24, line: 6 },
+ },
+ },
+
+ range: [130, 152],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 24, line: 6 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [156, 162],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 9, line: 7 },
+ },
+ },
+
+ range: [154, 162],
+ loc: {
+ start: { column: 1, line: 7 },
+ end: { column: 9, line: 7 },
+ },
+ },
+
+ range: [73, 181],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 9 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 182],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 10 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/1-TSESTree-AST.shot
index 146b379f5ba3..1e6617e87dc0 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
type: "ReturnStatement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "name",
+ optional: false,
range: [123, 127],
loc: {
@@ -37,11 +39,14 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "message",
+ optional: false,
range: [82, 89],
loc: {
@@ -52,7 +57,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "name",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/5-AST-Alignment-AST.shot
index 9de6b2018683..590df108c3b1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/function-with-types/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,126 @@
exports[`AST Fixtures legacy-fixtures basics function-with-types AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'name',
+- optional: false,
+
+ range: [123, 127],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 13, line: 4 },
+ },
+ },
+
+ range: [116, 128],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+ ],
+
+ range: [112, 130],
+ loc: {
+ start: { column: 39, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'message',
+- optional: false,
+
+ range: [82, 89],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'name',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [96, 102],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+
+ range: [94, 102],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+
+ range: [90, 102],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [105, 111],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [103, 111],
+ loc: {
+ start: { column: 30, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [73, 130],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 131],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/1-TSESTree-AST.shot
index dac7d52338c9..fcd4699e4b3d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "abc",
+ optional: false,
range: [99, 102],
loc: {
@@ -38,6 +41,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [95, 109],
@@ -55,7 +59,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "globalThis",
+ optional: false,
range: [142, 152],
loc: {
@@ -66,7 +72,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "abc",
+ optional: false,
range: [153, 156],
loc: {
@@ -112,9 +120,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "answer",
+ optional: false,
range: [169, 175],
loc: {
@@ -141,6 +152,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [165, 181],
@@ -158,7 +170,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "globalThis",
+ optional: false,
range: [250, 260],
loc: {
@@ -169,7 +183,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "answer",
+ optional: false,
range: [261, 267],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/5-AST-Alignment-AST.shot
index cb8e3363dc52..30ab32a0a4f7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,241 @@
exports[`AST Fixtures legacy-fixtures basics global-this AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'abc',
+- optional: false,
+
+ range: [99, 102],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 7, line: 5 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '100',
+ value: 100,
+
+ range: [105, 108],
+ loc: {
+ start: { column: 10, line: 5 },
+ end: { column: 13, line: 5 },
+ },
+ },
+
+ range: [99, 108],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 13, line: 5 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [95, 109],
+ loc: {
+ start: { column: 0, line: 5 },
+ end: { column: 14, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AssignmentExpression {
+ type: 'AssignmentExpression',
+ left: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'globalThis',
+- optional: false,
+
+ range: [142, 152],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 10, line: 8 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'abc',
+- optional: false,
+
+ range: [153, 156],
+ loc: {
+ start: { column: 11, line: 8 },
+ end: { column: 14, line: 8 },
+ },
+ },
+
+ range: [142, 156],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 14, line: 8 },
+ },
+ },
+ operator: '=',
+ right: Literal {
+ type: 'Literal',
+ raw: '200',
+ value: 200,
+
+ range: [159, 162],
+ loc: {
+ start: { column: 17, line: 8 },
+ end: { column: 20, line: 8 },
+ },
+ },
+
+ range: [142, 162],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 20, line: 8 },
+ },
+ },
+
+ range: [142, 163],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 21, line: 8 },
+ },
+ },
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'answer',
+- optional: false,
+
+ range: [169, 175],
+ loc: {
+ start: { column: 4, line: 10 },
+ end: { column: 10, line: 10 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '42',
+ value: 42,
+
+ range: [178, 180],
+ loc: {
+ start: { column: 13, line: 10 },
+ end: { column: 15, line: 10 },
+ },
+ },
+
+ range: [169, 180],
+ loc: {
+ start: { column: 4, line: 10 },
+ end: { column: 15, line: 10 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [165, 181],
+ loc: {
+ start: { column: 0, line: 10 },
+ end: { column: 16, line: 10 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AssignmentExpression {
+ type: 'AssignmentExpression',
+ left: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'globalThis',
+- optional: false,
+
+ range: [250, 260],
+ loc: {
+ start: { column: 0, line: 13 },
+ end: { column: 10, line: 13 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'answer',
+- optional: false,
+
+ range: [261, 267],
+ loc: {
+ start: { column: 11, line: 13 },
+ end: { column: 17, line: 13 },
+ },
+ },
+
+ range: [250, 267],
+ loc: {
+ start: { column: 0, line: 13 },
+ end: { column: 17, line: 13 },
+ },
+ },
+ operator: '=',
+ right: Literal {
+ type: 'Literal',
+ raw: '333333',
+ value: 333333,
+
+ range: [270, 276],
+ loc: {
+ start: { column: 20, line: 13 },
+ end: { column: 26, line: 13 },
+ },
+ },
+
+ range: [250, 276],
+ loc: {
+ start: { column: 0, line: 13 },
+ end: { column: 26, line: 13 },
+ },
+ },
+
+ range: [250, 277],
+ loc: {
+ start: { column: 0, line: 13 },
+ end: { column: 27, line: 13 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [95, 278],
+ loc: {
+ start: { column: 0, line: 5 },
+ end: { column: 0, line: 14 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/1-TSESTree-AST.shot
index 66d593436f10..a536f4a1981c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,9 @@ Program {
type: "TSImportEqualsDeclaration",
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [80, 83],
loc: {
@@ -17,7 +19,6 @@ Program {
},
},
importKind: "value",
- isExport: false,
moduleReference: TSExternalModuleReference {
type: "TSExternalModuleReference",
expression: Literal {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/5-AST-Alignment-AST.shot
index 9e99b2d139bd..fdba48eee23a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/5-AST-Alignment-AST.shot
@@ -12,7 +12,9 @@ exports[`AST Fixtures legacy-fixtures basics import-equal-declaration AST Alignm
type: 'TSImportEqualsDeclaration',
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [80, 83],
loc: {
@@ -21,7 +23,7 @@ exports[`AST Fixtures legacy-fixtures basics import-equal-declaration AST Alignm
},
},
importKind: 'value',
- isExport: false,
++ isExport: false,
moduleReference: TSExternalModuleReference {
type: 'TSExternalModuleReference',
expression: Literal {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/1-TSESTree-AST.shot
index 2c76c91d63b5..f679d5877a0c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,9 @@ Program {
type: "TSImportEqualsDeclaration",
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [85, 88],
loc: {
@@ -17,7 +19,6 @@ Program {
},
},
importKind: "type",
- isExport: false,
moduleReference: TSExternalModuleReference {
type: "TSExternalModuleReference",
expression: Literal {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot
index 38dd0ac42d69..e770be556a1f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot
@@ -12,7 +12,9 @@ exports[`AST Fixtures legacy-fixtures basics import-equal-type-declaration AST A
type: 'TSImportEqualsDeclaration',
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [85, 88],
loc: {
@@ -21,7 +23,7 @@ exports[`AST Fixtures legacy-fixtures basics import-equal-type-declaration AST A
},
},
importKind: 'type',
- isExport: false,
++ isExport: false,
moduleReference: TSExternalModuleReference {
type: 'TSExternalModuleReference',
expression: Literal {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot
index 1f3bcfef849f..0d8da7b441ea 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/1-TSESTree-AST.shot
@@ -4,40 +4,54 @@ exports[`AST Fixtures legacy-fixtures basics import-export-equal-declaration TSE
Program {
type: "Program",
body: [
- TSImportEqualsDeclaration {
- type: "TSImportEqualsDeclaration",
- id: Identifier {
- type: "Identifier",
- name: "foo",
+ ExportNamedDeclaration {
+ type: "ExportNamedDeclaration",
+ assertions: [],
+ declaration: TSImportEqualsDeclaration {
+ type: "TSImportEqualsDeclaration",
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "foo",
+ optional: false,
- range: [87, 90],
- loc: {
- start: { column: 14, line: 3 },
- end: { column: 17, line: 3 },
+ range: [87, 90],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 17, line: 3 },
+ },
},
- },
- importKind: "value",
- isExport: true,
- moduleReference: TSExternalModuleReference {
- type: "TSExternalModuleReference",
- expression: Literal {
- type: "Literal",
- raw: "'bar'",
- value: "bar",
+ importKind: "value",
+ moduleReference: TSExternalModuleReference {
+ type: "TSExternalModuleReference",
+ expression: Literal {
+ type: "Literal",
+ raw: "'bar'",
+ value: "bar",
+
+ range: [101, 106],
+ loc: {
+ start: { column: 28, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
- range: [101, 106],
+ range: [93, 107],
loc: {
- start: { column: 28, line: 3 },
- end: { column: 33, line: 3 },
+ start: { column: 20, line: 3 },
+ end: { column: 34, line: 3 },
},
},
- range: [93, 107],
+ range: [80, 108],
loc: {
- start: { column: 20, line: 3 },
- end: { column: 34, line: 3 },
+ start: { column: 7, line: 3 },
+ end: { column: 35, line: 3 },
},
},
+ exportKind: "value",
+ source: null,
+ specifiers: [],
range: [73, 108],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot
index a8124bb42647..4f911c4573c0 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/5-AST-Alignment-AST.shot
@@ -8,40 +8,78 @@ exports[`AST Fixtures legacy-fixtures basics import-export-equal-declaration AST
Program {
type: 'Program',
body: Array [
- TSImportEqualsDeclaration {
- type: 'TSImportEqualsDeclaration',
- id: Identifier {
- type: 'Identifier',
- name: 'foo',
+- ExportNamedDeclaration {
+- type: 'ExportNamedDeclaration',
+- assertions: Array [],
+- declaration: TSImportEqualsDeclaration {
+- type: 'TSImportEqualsDeclaration',
+- id: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'foo',
+- optional: false,
++ TSImportEqualsDeclaration {
++ type: 'TSImportEqualsDeclaration',
++ id: Identifier {
++ type: 'Identifier',
++ name: 'foo',
- range: [87, 90],
- loc: {
- start: { column: 14, line: 3 },
- end: { column: 17, line: 3 },
+- range: [87, 90],
+- loc: {
+- start: { column: 14, line: 3 },
+- end: { column: 17, line: 3 },
+- },
++ range: [87, 90],
++ loc: {
++ start: { column: 14, line: 3 },
++ end: { column: 17, line: 3 },
},
- },
- importKind: 'value',
- isExport: true,
- moduleReference: TSExternalModuleReference {
- type: 'TSExternalModuleReference',
- expression: Literal {
- type: 'Literal',
- raw: '\\'bar\\'',
- value: 'bar',
+- importKind: 'value',
+- moduleReference: TSExternalModuleReference {
+- type: 'TSExternalModuleReference',
+- expression: Literal {
+- type: 'Literal',
+- raw: '\\'bar\\'',
+- value: 'bar',
+-
+- range: [101, 106],
+- loc: {
+- start: { column: 28, line: 3 },
+- end: { column: 33, line: 3 },
+- },
+- },
++ },
++ importKind: 'value',
++ isExport: true,
++ moduleReference: TSExternalModuleReference {
++ type: 'TSExternalModuleReference',
++ expression: Literal {
++ type: 'Literal',
++ raw: '\\'bar\\'',
++ value: 'bar',
- range: [101, 106],
+- range: [93, 107],
++ range: [101, 106],
loc: {
- start: { column: 28, line: 3 },
- end: { column: 33, line: 3 },
+- start: { column: 20, line: 3 },
+- end: { column: 34, line: 3 },
++ start: { column: 28, line: 3 },
++ end: { column: 33, line: 3 },
},
},
- range: [93, 107],
+- range: [80, 108],
++ range: [93, 107],
loc: {
- start: { column: 20, line: 3 },
- end: { column: 34, line: 3 },
+- start: { column: 7, line: 3 },
+- end: { column: 35, line: 3 },
++ start: { column: 20, line: 3 },
++ end: { column: 34, line: 3 },
},
},
+- exportKind: 'value',
+- source: null,
+- specifiers: Array [],
range: [73, 108],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot
index a05c975eae46..a518cab77f4b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/1-TSESTree-AST.shot
@@ -4,40 +4,54 @@ exports[`AST Fixtures legacy-fixtures basics import-export-equal-type-declaratio
Program {
type: "Program",
body: [
- TSImportEqualsDeclaration {
- type: "TSImportEqualsDeclaration",
- id: Identifier {
- type: "Identifier",
- name: "foo",
+ ExportNamedDeclaration {
+ type: "ExportNamedDeclaration",
+ assertions: [],
+ declaration: TSImportEqualsDeclaration {
+ type: "TSImportEqualsDeclaration",
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "foo",
+ optional: false,
- range: [92, 95],
- loc: {
- start: { column: 19, line: 3 },
- end: { column: 22, line: 3 },
+ range: [92, 95],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 22, line: 3 },
+ },
},
- },
- importKind: "type",
- isExport: true,
- moduleReference: TSExternalModuleReference {
- type: "TSExternalModuleReference",
- expression: Literal {
- type: "Literal",
- raw: "'bar'",
- value: "bar",
+ importKind: "type",
+ moduleReference: TSExternalModuleReference {
+ type: "TSExternalModuleReference",
+ expression: Literal {
+ type: "Literal",
+ raw: "'bar'",
+ value: "bar",
+
+ range: [106, 111],
+ loc: {
+ start: { column: 33, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
- range: [106, 111],
+ range: [98, 112],
loc: {
- start: { column: 33, line: 3 },
- end: { column: 38, line: 3 },
+ start: { column: 25, line: 3 },
+ end: { column: 39, line: 3 },
},
},
- range: [98, 112],
+ range: [80, 113],
loc: {
- start: { column: 25, line: 3 },
- end: { column: 39, line: 3 },
+ start: { column: 7, line: 3 },
+ end: { column: 40, line: 3 },
},
},
+ exportKind: "value",
+ source: null,
+ specifiers: [],
range: [73, 113],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot
index 94fa819efc7f..5cb5ed8f4c4a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/5-AST-Alignment-AST.shot
@@ -8,40 +8,78 @@ exports[`AST Fixtures legacy-fixtures basics import-export-equal-type-declaratio
Program {
type: 'Program',
body: Array [
- TSImportEqualsDeclaration {
- type: 'TSImportEqualsDeclaration',
- id: Identifier {
- type: 'Identifier',
- name: 'foo',
+- ExportNamedDeclaration {
+- type: 'ExportNamedDeclaration',
+- assertions: Array [],
+- declaration: TSImportEqualsDeclaration {
+- type: 'TSImportEqualsDeclaration',
+- id: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'foo',
+- optional: false,
++ TSImportEqualsDeclaration {
++ type: 'TSImportEqualsDeclaration',
++ id: Identifier {
++ type: 'Identifier',
++ name: 'foo',
- range: [92, 95],
- loc: {
- start: { column: 19, line: 3 },
- end: { column: 22, line: 3 },
+- range: [92, 95],
+- loc: {
+- start: { column: 19, line: 3 },
+- end: { column: 22, line: 3 },
+- },
++ range: [92, 95],
++ loc: {
++ start: { column: 19, line: 3 },
++ end: { column: 22, line: 3 },
},
- },
- importKind: 'type',
- isExport: true,
- moduleReference: TSExternalModuleReference {
- type: 'TSExternalModuleReference',
- expression: Literal {
- type: 'Literal',
- raw: '\\'bar\\'',
- value: 'bar',
+- importKind: 'type',
+- moduleReference: TSExternalModuleReference {
+- type: 'TSExternalModuleReference',
+- expression: Literal {
+- type: 'Literal',
+- raw: '\\'bar\\'',
+- value: 'bar',
+-
+- range: [106, 111],
+- loc: {
+- start: { column: 33, line: 3 },
+- end: { column: 38, line: 3 },
+- },
+- },
++ },
++ importKind: 'type',
++ isExport: true,
++ moduleReference: TSExternalModuleReference {
++ type: 'TSExternalModuleReference',
++ expression: Literal {
++ type: 'Literal',
++ raw: '\\'bar\\'',
++ value: 'bar',
- range: [106, 111],
+- range: [98, 112],
++ range: [106, 111],
loc: {
- start: { column: 33, line: 3 },
- end: { column: 38, line: 3 },
+- start: { column: 25, line: 3 },
+- end: { column: 39, line: 3 },
++ start: { column: 33, line: 3 },
++ end: { column: 38, line: 3 },
},
},
- range: [98, 112],
+- range: [80, 113],
++ range: [98, 112],
loc: {
- start: { column: 25, line: 3 },
- end: { column: 39, line: 3 },
+- start: { column: 7, line: 3 },
+- end: { column: 40, line: 3 },
++ start: { column: 25, line: 3 },
++ end: { column: 39, line: 3 },
},
},
+- exportKind: 'value',
+- source: null,
+- specifiers: Array [],
range: [73, 113],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot
index ca33471e646a..4388729bbf12 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportDefaultSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [85, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot
index 27e470522605..5775e847e8a1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-default/snapshots/5-AST-Alignment-AST.shot
@@ -28,7 +28,9 @@ exports[`AST Fixtures legacy-fixtures basics import-type-default AST Alignment -
type: 'ImportDefaultSpecifier',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [85, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot
index fadbb01b2291..ee238f4d3eb7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportDefaultSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "type",
+ optional: false,
range: [135, 139],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot
index c7fc07efd943..bf6a7ff82093 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-empty/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,64 @@
exports[`AST Fixtures legacy-fixtures basics import-type-empty AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'./foo\\'',
+ value: './foo',
+
+ range: [145, 152],
+ loc: {
+ start: { column: 17, line: 4 },
+ end: { column: 24, line: 4 },
+ },
+ },
+ specifiers: Array [
+ ImportDefaultSpecifier {
+ type: 'ImportDefaultSpecifier',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'type',
+- optional: false,
+
+ range: [135, 139],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+
+ range: [135, 139],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+ ],
+
+ range: [128, 153],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 25, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [128, 154],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot
index 92cbbe233f45..3331ec4e3a45 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [87, 90],
loc: {
@@ -35,7 +37,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [94, 97],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot
index 460aa5f7e67b..61bb15fad45a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named-as/snapshots/5-AST-Alignment-AST.shot
@@ -28,7 +28,9 @@ exports[`AST Fixtures legacy-fixtures basics import-type-named-as AST Alignment
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [87, 90],
loc: {
@@ -39,7 +41,9 @@ exports[`AST Fixtures legacy-fixtures basics import-type-named-as AST Alignment
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [94, 97],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot
index 68df555343c3..c9cf66adce7a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [87, 90],
loc: {
@@ -35,7 +37,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [87, 90],
loc: {
@@ -54,7 +58,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [92, 95],
loc: {
@@ -65,7 +71,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [92, 95],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot
index 3260482a080a..3f0bb385ba5a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-named/snapshots/5-AST-Alignment-AST.shot
@@ -28,7 +28,9 @@ exports[`AST Fixtures legacy-fixtures basics import-type-named AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [87, 90],
loc: {
@@ -39,7 +41,9 @@ exports[`AST Fixtures legacy-fixtures basics import-type-named AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [87, 90],
loc: {
@@ -58,7 +62,9 @@ exports[`AST Fixtures legacy-fixtures basics import-type-named AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [92, 95],
loc: {
@@ -69,7 +75,9 @@ exports[`AST Fixtures legacy-fixtures basics import-type-named AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [92, 95],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot
index fe2b766c1de5..539671c284e3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportNamespaceSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [90, 93],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot
index 222cc519cf2d..91d204bd4e34 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-type-star-as-ns/snapshots/5-AST-Alignment-AST.shot
@@ -28,7 +28,9 @@ exports[`AST Fixtures legacy-fixtures basics import-type-star-as-ns AST Alignmen
type: 'ImportNamespaceSpecifier',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [90, 93],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot
index e209625b60b3..fa59b2d01631 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/1-TSESTree-AST.shot
@@ -11,7 +11,9 @@ Program {
type: "ImportAttribute",
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "type",
+ optional: false,
range: [104, 108],
loc: {
@@ -55,7 +57,9 @@ Program {
type: "ImportDefaultSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [80, 83],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot
index 5c25cc16fb8f..d14ea9b30584 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-with-import-assertions/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,97 @@
exports[`AST Fixtures legacy-fixtures basics import-with-import-assertions AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [
+ ImportAttribute {
+ type: 'ImportAttribute',
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'type',
+- optional: false,
+
+ range: [104, 108],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 35, line: 3 },
+ },
+ },
+ value: Literal {
+ type: 'Literal',
+ raw: '\\'json\\'',
+ value: 'json',
+
+ range: [110, 116],
+ loc: {
+ start: { column: 37, line: 3 },
+ end: { column: 43, line: 3 },
+ },
+ },
+
+ range: [104, 116],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 43, line: 3 },
+ },
+ },
+ ],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [89, 94],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ specifiers: Array [
+ ImportDefaultSpecifier {
+ type: 'ImportDefaultSpecifier',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [80, 83],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+
+ range: [80, 83],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 119],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 46, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [73, 120],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/1-TSESTree-AST.shot
index 882f1eedc2a1..b861b28c6b1d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/1-TSESTree-AST.shot
@@ -16,12 +16,15 @@ Program {
end: { column: 33, line: 3 },
},
},
+ declare: false,
extends: [
TSInterfaceHeritage {
type: "TSInterfaceHeritage",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [95, 98],
loc: {
@@ -40,7 +43,9 @@ Program {
type: "TSInterfaceHeritage",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Baz",
+ optional: false,
range: [100, 103],
loc: {
@@ -58,7 +63,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/5-AST-Alignment-AST.shot
index 6826fae73fb1..2b7e65472a42 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends-multiple/snapshots/5-AST-Alignment-AST.shot
@@ -20,6 +20,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-extends-multiple AST Alig
end: { column: 33, line: 3 },
},
},
+- declare: false,
extends: Array [
- TSInterfaceHeritage {
- type: 'TSInterfaceHeritage',
@@ -27,7 +28,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-extends-multiple AST Alig
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [95, 98],
loc: {
@@ -48,7 +51,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-extends-multiple AST Alig
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Baz',
+- optional: false,
range: [100, 103],
loc: {
@@ -66,7 +71,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-extends-multiple AST Alig
],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/1-TSESTree-AST.shot
index 681e29188f4c..3370dec4082f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/1-TSESTree-AST.shot
@@ -16,12 +16,15 @@ Program {
end: { column: 28, line: 3 },
},
},
+ declare: false,
extends: [
TSInterfaceHeritage {
type: "TSInterfaceHeritage",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [95, 98],
loc: {
@@ -39,7 +42,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/5-AST-Alignment-AST.shot
index 5d2ae168cc4f..a1f3cec60787 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-extends/snapshots/5-AST-Alignment-AST.shot
@@ -20,6 +20,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-extends AST Alignment - A
end: { column: 28, line: 3 },
},
},
+- declare: false,
extends: Array [
- TSInterfaceHeritage {
- type: 'TSInterfaceHeritage',
@@ -27,7 +28,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-extends AST Alignment - A
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [95, 98],
loc: {
@@ -45,7 +48,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-extends AST Alignment - A
],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot
index 63dc3c4c7b24..9e5f0b8ea1df 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 19, line: 3 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [83, 86],
loc: {
@@ -35,7 +39,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [87, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot
index d4403d29158a..62517a850707 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-type-parameters/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures legacy-fixtures basics interface-type-parameters AST Align
end: { column: 19, line: 3 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [83, 86],
loc: {
@@ -39,7 +43,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-type-parameters AST Align
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [87, 88],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot
index 541d9420d027..c78ebfa17e46 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baa",
+ optional: false,
range: [91, 94],
loc: {
@@ -22,6 +24,9 @@ Program {
end: { column: 5, line: 4 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -52,7 +57,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [106, 109],
loc: {
@@ -61,6 +68,8 @@ Program {
},
},
optional: true,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -91,7 +100,9 @@ Program {
computed: true,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bax",
+ optional: false,
range: [123, 126],
loc: {
@@ -99,6 +110,9 @@ Program {
end: { column: 6, line: 6 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -129,7 +143,9 @@ Program {
computed: true,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [140, 143],
loc: {
@@ -138,6 +154,8 @@ Program {
},
},
optional: true,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -168,7 +186,9 @@ Program {
parameters: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "eee",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -195,6 +215,8 @@ Program {
},
},
],
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -225,7 +247,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "doo",
+ optional: false,
range: [182, 185],
loc: {
@@ -234,7 +258,9 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSVoidKeyword {
@@ -253,6 +279,7 @@ Program {
end: { column: 13, line: 9 },
},
},
+ static: false,
range: [182, 194],
loc: {
@@ -265,7 +292,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "coo",
+ optional: false,
range: [197, 200],
loc: {
@@ -278,7 +307,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [202, 203],
loc: {
@@ -288,7 +319,9 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [205, 206],
loc: {
@@ -298,7 +331,9 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [208, 209],
loc: {
@@ -307,6 +342,7 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSVoidKeyword {
@@ -325,6 +361,7 @@ Program {
end: { column: 21, line: 10 },
},
},
+ static: false,
range: [197, 217],
loc: {
@@ -337,7 +374,9 @@ Program {
computed: true,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "loo",
+ optional: false,
range: [221, 224],
loc: {
@@ -350,7 +389,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [227, 228],
loc: {
@@ -360,7 +401,9 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [230, 231],
loc: {
@@ -370,7 +413,9 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [233, 234],
loc: {
@@ -379,6 +424,7 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSVoidKeyword {
@@ -397,6 +443,7 @@ Program {
end: { column: 23, line: 11 },
},
},
+ static: false,
range: [220, 242],
loc: {
@@ -409,7 +456,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "boo",
+ optional: false,
range: [245, 248],
loc: {
@@ -418,10 +467,13 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [252, 253],
loc: {
@@ -431,7 +483,9 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [255, 256],
loc: {
@@ -441,7 +495,9 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [258, 259],
loc: {
@@ -450,6 +506,7 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSVoidKeyword {
@@ -468,6 +525,7 @@ Program {
end: { column: 23, line: 12 },
},
},
+ static: false,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
params: [
@@ -477,7 +535,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "J",
+ optional: false,
range: [249, 250],
loc: {
@@ -513,7 +573,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [275, 276],
loc: {
@@ -523,6 +585,7 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
optional: true,
@@ -563,7 +626,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [301, 302],
loc: {
@@ -573,6 +638,7 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
optional: true,
@@ -610,7 +676,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "F",
+ optional: false,
range: [298, 299],
loc: {
@@ -649,9 +717,13 @@ Program {
end: { column: 1, line: 15 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot
index 11ec84abe7fb..1a53a43b60f4 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-all-property-types/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baa',
+- optional: false,
range: [91, 94],
loc: {
@@ -26,6 +28,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
end: { column: 5, line: 4 },
},
},
+- optional: false,
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -56,7 +61,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [106, 109],
loc: {
@@ -65,6 +72,8 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
},
optional: true,
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -95,7 +104,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
computed: true,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bax',
+- optional: false,
range: [123, 126],
loc: {
@@ -103,6 +114,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
end: { column: 6, line: 6 },
},
},
+- optional: false,
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -133,7 +147,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
computed: true,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [140, 143],
loc: {
@@ -142,6 +158,8 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
},
optional: true,
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -172,7 +190,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'eee',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -199,6 +219,8 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
},
],
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -229,7 +251,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'doo',
+- optional: false,
range: [182, 185],
loc: {
@@ -238,7 +262,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
},
kind: 'method',
+- optional: false,
- params: Array [],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ parameters: Array [],
+ typeAnnotation: TSTypeAnnotation {
@@ -259,6 +285,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
end: { column: 13, line: 9 },
},
},
+- static: false,
range: [182, 194],
loc: {
@@ -271,7 +298,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'coo',
+- optional: false,
range: [197, 200],
loc: {
@@ -285,7 +314,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [202, 203],
loc: {
@@ -295,7 +326,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [205, 206],
loc: {
@@ -305,7 +338,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'c',
+- optional: false,
range: [208, 209],
loc: {
@@ -314,6 +349,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -333,6 +369,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
end: { column: 21, line: 10 },
},
},
+- static: false,
range: [197, 217],
loc: {
@@ -345,7 +382,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
computed: true,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'loo',
+- optional: false,
range: [221, 224],
loc: {
@@ -359,7 +398,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [227, 228],
loc: {
@@ -369,7 +410,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [230, 231],
loc: {
@@ -379,7 +422,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'c',
+- optional: false,
range: [233, 234],
loc: {
@@ -388,6 +433,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -407,6 +453,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
end: { column: 23, line: 11 },
},
},
+- static: false,
range: [220, 242],
loc: {
@@ -419,7 +466,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'boo',
+- optional: false,
range: [245, 248],
loc: {
@@ -428,11 +477,14 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
},
kind: 'method',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [252, 253],
loc: {
@@ -442,7 +494,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [255, 256],
loc: {
@@ -452,7 +506,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'c',
+- optional: false,
range: [258, 259],
loc: {
@@ -461,6 +517,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -480,6 +537,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
end: { column: 23, line: 12 },
},
},
+- static: false,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
params: Array [
@@ -489,7 +547,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'J',
+- optional: false,
-
- range: [249, 250],
- loc: {
@@ -527,7 +587,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [275, 276],
loc: {
@@ -537,6 +599,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
optional: true,
@@ -579,7 +642,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [301, 302],
loc: {
@@ -589,6 +654,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
optional: true,
@@ -627,7 +693,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'F',
+- optional: false,
-
- range: [298, 299],
- loc: {
@@ -667,9 +735,13 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-all-property-types A
end: { column: 1, line: 15 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/1-TSESTree-AST.shot
index 73d72215073b..7d18cbbf9f11 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/1-TSESTree-AST.shot
@@ -16,6 +16,7 @@ Program {
end: { column: 32, line: 3 },
},
},
+ declare: false,
extends: [
TSInterfaceHeritage {
type: "TSInterfaceHeritage",
@@ -24,7 +25,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [95, 98],
loc: {
@@ -35,7 +38,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [99, 102],
loc: {
@@ -60,7 +65,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/5-AST-Alignment-AST.shot
index 815cf476af77..cfc7b70c381c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-member-expression/snapshots/5-AST-Alignment-AST.shot
@@ -20,6 +20,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-member-expre
end: { column: 32, line: 3 },
},
},
+- declare: false,
extends: Array [
- TSInterfaceHeritage {
- type: 'TSInterfaceHeritage',
@@ -33,7 +34,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-member-expre
+ type: 'TSQualifiedName',
+ left: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [95, 98],
loc: {
@@ -45,7 +48,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-member-expre
- property: Identifier {
+ right: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [99, 102],
loc: {
@@ -70,7 +75,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-member-expre
],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot
index 4b171d07041f..effb1a6217b2 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/1-TSESTree-AST.shot
@@ -16,12 +16,15 @@ Program {
end: { column: 34, line: 3 },
},
},
+ declare: false,
extends: [
TSInterfaceHeritage {
type: "TSInterfaceHeritage",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [98, 101],
loc: {
@@ -29,14 +32,16 @@ Program {
end: { column: 28, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "J",
+ optional: false,
range: [102, 103],
loc: {
@@ -69,7 +74,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [83, 86],
loc: {
@@ -86,7 +93,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [87, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot
index c4fc663d9e21..e4ba39d31cbd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot
@@ -20,6 +20,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-paramet
end: { column: 34, line: 3 },
},
},
+- declare: false,
extends: Array [
- TSInterfaceHeritage {
- type: 'TSInterfaceHeritage',
@@ -27,7 +28,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-paramet
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Bar',
+- optional: false,
range: [98, 101],
loc: {
@@ -35,14 +38,17 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-paramet
end: { column: 28, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'J',
+- optional: false,
range: [102, 103],
loc: {
@@ -75,7 +81,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-paramet
],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [83, 86],
loc: {
@@ -92,7 +100,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-extends-type-paramet
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [87, 88],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot
index b0254dcb6cb7..7ee2ab6c7e75 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 20, line: 3 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Test",
+ optional: false,
range: [83, 87],
loc: {
@@ -35,7 +39,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [88, 89],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot
index 79507cbad056..ca5d1f2bff22 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-generic/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-generic AST Alignmen
end: { column: 20, line: 3 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Test',
+- optional: false,
range: [83, 87],
loc: {
@@ -39,7 +43,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-generic AST Alignmen
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [88, 89],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/1-TSESTree-AST.shot
index a876b40872a5..3058a8d94339 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [138, 141],
loc: {
@@ -23,10 +25,13 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [142, 145],
loc: {
@@ -35,6 +40,8 @@ Program {
},
},
],
+ readonly: false,
+ static: false,
range: [138, 147],
loc: {
@@ -50,9 +57,13 @@ Program {
end: { column: 1, line: 9 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Test",
+ optional: false,
range: [83, 87],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/5-AST-Alignment-AST.shot
index cbdfb2688e0c..fffa02b876da 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-jsdoc/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-jsdoc AST Alignment
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [138, 141],
loc: {
@@ -27,11 +29,14 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-jsdoc AST Alignment
},
},
kind: 'method',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [142, 145],
loc: {
@@ -40,6 +45,8 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-jsdoc AST Alignment
},
},
],
+- readonly: false,
+- static: false,
range: [138, 147],
loc: {
@@ -55,9 +62,13 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-jsdoc AST Alignment
end: { column: 1, line: 9 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Test',
+- optional: false,
range: [83, 87],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot
index 5688a7f27a72..9ca0ecc79064 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "h",
+ optional: false,
range: [92, 93],
loc: {
@@ -23,10 +25,13 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -53,6 +58,7 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSVoidKeyword {
@@ -71,6 +77,7 @@ Program {
end: { column: 22, line: 4 },
},
},
+ static: false,
range: [92, 113],
loc: {
@@ -83,7 +90,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "g",
+ optional: false,
range: [116, 117],
loc: {
@@ -92,17 +101,22 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [126, 127],
loc: {
@@ -132,13 +146,16 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [130, 131],
loc: {
@@ -160,6 +177,7 @@ Program {
end: { column: 17, line: 5 },
},
},
+ static: false,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
params: [
@@ -169,7 +187,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [118, 119],
loc: {
@@ -208,9 +228,13 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "test",
+ optional: false,
range: [83, 87],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot
index e6b93ecb73b6..1a5fae1fabdd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-method/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'h',
+- optional: false,
range: [92, 93],
loc: {
@@ -27,11 +29,14 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
},
},
kind: 'method',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -58,6 +63,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -77,6 +83,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
end: { column: 22, line: 4 },
},
},
+- static: false,
range: [92, 113],
loc: {
@@ -89,7 +96,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'g',
+- optional: false,
range: [116, 117],
loc: {
@@ -98,18 +107,23 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
},
},
kind: 'method',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [126, 127],
loc: {
@@ -139,6 +153,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -146,7 +161,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [130, 131],
loc: {
@@ -168,6 +185,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
end: { column: 17, line: 5 },
},
},
+- static: false,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
params: Array [
@@ -177,7 +195,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [118, 119],
- loc: {
@@ -217,9 +237,13 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-method AST Alignment
end: { column: 1, line: 6 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'test',
+- optional: false,
range: [83, 87],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/1-TSESTree-AST.shot
index 06c9ff9b72db..c0b2042f612e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [92, 95],
loc: {
@@ -23,6 +25,8 @@ Program {
},
},
optional: true,
+ readonly: false,
+ static: false,
range: [92, 97],
loc: {
@@ -35,7 +39,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [100, 103],
loc: {
@@ -44,6 +50,8 @@ Program {
},
},
optional: true,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -74,7 +82,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [116, 119],
loc: {
@@ -87,7 +97,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [121, 124],
loc: {
@@ -97,6 +109,7 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
optional: true,
typeAnnotation: TSTypeAnnotation {
@@ -126,6 +139,7 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
optional: true,
@@ -136,6 +150,8 @@ Program {
},
},
],
+ readonly: false,
+ static: false,
range: [116, 146],
loc: {
@@ -151,9 +167,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "test",
+ optional: false,
range: [83, 87],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/5-AST-Alignment-AST.shot
index 0f17f468b7bb..af590c0b0ab2 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-with-optional-properties/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [92, 95],
loc: {
@@ -27,6 +29,8 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties
},
},
optional: true,
+- readonly: false,
+- static: false,
range: [92, 97],
loc: {
@@ -39,7 +43,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [100, 103],
loc: {
@@ -48,6 +54,8 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties
},
},
optional: true,
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -78,7 +86,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [116, 119],
loc: {
@@ -92,7 +102,9 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [121, 124],
loc: {
@@ -102,6 +114,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
optional: true,
typeAnnotation: TSTypeAnnotation {
@@ -131,6 +144,7 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
optional: true,
@@ -141,6 +155,8 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties
},
},
],
+- readonly: false,
+- static: false,
range: [116, 146],
loc: {
@@ -156,9 +172,13 @@ exports[`AST Fixtures legacy-fixtures basics interface-with-optional-properties
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'test',
+- optional: false,
range: [83, 87],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/1-TSESTree-AST.shot
index 7208bb0dc06f..68edcc2ebde5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [92, 95],
loc: {
@@ -22,6 +24,9 @@ Program {
end: { column: 5, line: 4 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
range: [92, 96],
loc: {
@@ -37,9 +42,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "test",
+ optional: false,
range: [83, 87],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/5-AST-Alignment-AST.shot
index 3f71028931f7..39414f7c3b6e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/interface-without-type-annotation/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,78 @@
exports[`AST Fixtures legacy-fixtures basics interface-without-type-annotation AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSInterfaceDeclaration {
+ type: 'TSInterfaceDeclaration',
+ body: TSInterfaceBody {
+ type: 'TSInterfaceBody',
+ body: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [92, 95],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+
+ range: [92, 96],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 6, line: 4 },
+ },
+ },
+ ],
+
+ range: [88, 98],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+- declare: false,
+- extends: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'test',
+- optional: false,
+
+ range: [83, 87],
+ loc: {
+ start: { column: 10, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [73, 98],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 99],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot
index f9954e47008a..21d50eb4fa99 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Uppercase",
+ optional: false,
range: [78, 87],
loc: {
@@ -43,7 +46,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "S",
+ optional: false,
range: [88, 89],
loc: {
@@ -76,9 +81,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Lowercase",
+ optional: false,
range: [124, 133],
loc: {
@@ -113,7 +121,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "S",
+ optional: false,
range: [134, 135],
loc: {
@@ -146,9 +156,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Capitalize",
+ optional: false,
range: [170, 180],
loc: {
@@ -183,7 +196,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "S",
+ optional: false,
range: [181, 182],
loc: {
@@ -216,9 +231,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Uncapitalize",
+ optional: false,
range: [217, 229],
loc: {
@@ -253,7 +271,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "S",
+ optional: false,
range: [230, 231],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot
index 89bf1373ea09..c7e54a64f06b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/intrinsic-keyword/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Uppercase',
+- optional: false,
range: [78, 87],
loc: {
@@ -47,7 +50,9 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'S',
+- optional: false,
-
- range: [88, 89],
- loc: {
@@ -81,9 +86,12 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Lowercase',
+- optional: false,
range: [124, 133],
loc: {
@@ -118,7 +126,9 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'S',
+- optional: false,
-
- range: [134, 135],
- loc: {
@@ -152,9 +162,12 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Capitalize',
+- optional: false,
range: [170, 180],
loc: {
@@ -189,7 +202,9 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'S',
+- optional: false,
-
- range: [181, 182],
- loc: {
@@ -223,9 +238,12 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Uncapitalize',
+- optional: false,
range: [217, 229],
loc: {
@@ -260,7 +278,9 @@ exports[`AST Fixtures legacy-fixtures basics intrinsic-keyword AST Alignment - A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'S',
+- optional: false,
-
- range: [230, 231],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/1-TSESTree-AST.shot
index da13147b30fa..744740c1ac37 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [78, 79],
loc: {
@@ -23,7 +26,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [88, 91],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/5-AST-Alignment-AST.shot
index 066f52e976fa..31b817f0994c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyof-operator/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,72 @@
exports[`AST Fixtures legacy-fixtures basics keyof-operator AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [78, 79],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 6, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeOperator {
+ type: 'TSTypeOperator',
+ operator: 'keyof',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [82, 91],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 93],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot
index d350372e5ef3..807baaad82cb 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/1-TSESTree-AST.shot
@@ -12,9 +12,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "abstract",
+ optional: false,
range: [83, 91],
loc: {
@@ -41,6 +44,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [77, 96],
@@ -54,9 +58,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "as",
+ optional: false,
range: [105, 107],
loc: {
@@ -83,6 +90,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [99, 112],
@@ -96,9 +104,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "asserts",
+ optional: false,
range: [121, 128],
loc: {
@@ -125,6 +136,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [115, 133],
@@ -138,9 +150,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "any",
+ optional: false,
range: [142, 145],
loc: {
@@ -167,6 +182,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [136, 150],
@@ -180,9 +196,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "async",
+ optional: false,
range: [159, 164],
loc: {
@@ -209,6 +228,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [153, 169],
@@ -222,9 +242,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "await",
+ optional: false,
range: [178, 183],
loc: {
@@ -251,6 +274,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [172, 188],
@@ -264,9 +288,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "boolean",
+ optional: false,
range: [197, 204],
loc: {
@@ -293,6 +320,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [191, 209],
@@ -306,9 +334,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [218, 229],
loc: {
@@ -335,6 +366,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [212, 234],
@@ -348,9 +380,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "declare",
+ optional: false,
range: [243, 250],
loc: {
@@ -377,6 +412,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [237, 255],
@@ -390,9 +426,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "get",
+ optional: false,
range: [264, 267],
loc: {
@@ -419,6 +458,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [258, 272],
@@ -432,9 +472,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "infer",
+ optional: false,
range: [281, 286],
loc: {
@@ -461,6 +504,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [275, 291],
@@ -474,9 +518,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "is",
+ optional: false,
range: [300, 302],
loc: {
@@ -503,6 +550,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [294, 307],
@@ -516,9 +564,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "keyof",
+ optional: false,
range: [316, 321],
loc: {
@@ -545,6 +596,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [310, 326],
@@ -558,9 +610,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "module",
+ optional: false,
range: [335, 341],
loc: {
@@ -587,6 +642,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [329, 346],
@@ -600,9 +656,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "namespace",
+ optional: false,
range: [355, 364],
loc: {
@@ -629,6 +688,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [349, 369],
@@ -642,9 +702,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "never",
+ optional: false,
range: [378, 383],
loc: {
@@ -671,6 +734,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [372, 388],
@@ -684,9 +748,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "readonly",
+ optional: false,
range: [397, 405],
loc: {
@@ -713,6 +780,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [391, 410],
@@ -726,9 +794,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "require",
+ optional: false,
range: [419, 426],
loc: {
@@ -755,6 +826,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [413, 431],
@@ -768,9 +840,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "number",
+ optional: false,
range: [440, 446],
loc: {
@@ -797,6 +872,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [434, 451],
@@ -810,9 +886,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "object",
+ optional: false,
range: [460, 466],
loc: {
@@ -839,6 +918,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [454, 471],
@@ -852,9 +932,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "set",
+ optional: false,
range: [480, 483],
loc: {
@@ -881,6 +964,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [474, 488],
@@ -894,9 +978,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "string",
+ optional: false,
range: [497, 503],
loc: {
@@ -923,6 +1010,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [491, 508],
@@ -936,9 +1024,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "symbol",
+ optional: false,
range: [517, 523],
loc: {
@@ -965,6 +1056,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [511, 528],
@@ -978,9 +1070,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "type",
+ optional: false,
range: [537, 541],
loc: {
@@ -1007,6 +1102,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [531, 546],
@@ -1020,9 +1116,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "undefined",
+ optional: false,
range: [555, 564],
loc: {
@@ -1049,6 +1148,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [549, 569],
@@ -1062,9 +1162,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "unique",
+ optional: false,
range: [578, 584],
loc: {
@@ -1091,6 +1194,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [572, 589],
@@ -1104,9 +1208,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "unknown",
+ optional: false,
range: [598, 605],
loc: {
@@ -1133,6 +1240,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [592, 610],
@@ -1146,9 +1254,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "from",
+ optional: false,
range: [619, 623],
loc: {
@@ -1175,6 +1286,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [613, 628],
@@ -1188,9 +1300,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "global",
+ optional: false,
range: [637, 643],
loc: {
@@ -1217,6 +1332,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [631, 648],
@@ -1230,9 +1346,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "bigint",
+ optional: false,
range: [657, 663],
loc: {
@@ -1259,6 +1378,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [651, 668],
@@ -1272,9 +1392,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "of",
+ optional: false,
range: [677, 679],
loc: {
@@ -1301,6 +1424,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [671, 684],
@@ -1337,7 +1461,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "abstract",
+ optional: false,
range: [699, 707],
loc: {
@@ -1348,7 +1474,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "abstract",
+ optional: false,
range: [699, 707],
loc: {
@@ -1367,7 +1495,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "as",
+ optional: false,
range: [711, 713],
loc: {
@@ -1378,7 +1508,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "as",
+ optional: false,
range: [711, 713],
loc: {
@@ -1397,7 +1529,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "asserts",
+ optional: false,
range: [717, 724],
loc: {
@@ -1408,7 +1542,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "asserts",
+ optional: false,
range: [717, 724],
loc: {
@@ -1427,7 +1563,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "any",
+ optional: false,
range: [728, 731],
loc: {
@@ -1438,7 +1576,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "any",
+ optional: false,
range: [728, 731],
loc: {
@@ -1457,7 +1597,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "async",
+ optional: false,
range: [735, 740],
loc: {
@@ -1468,7 +1610,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "async",
+ optional: false,
range: [735, 740],
loc: {
@@ -1487,7 +1631,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "await",
+ optional: false,
range: [744, 749],
loc: {
@@ -1498,7 +1644,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "await",
+ optional: false,
range: [744, 749],
loc: {
@@ -1517,7 +1665,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "boolean",
+ optional: false,
range: [753, 760],
loc: {
@@ -1528,7 +1678,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "boolean",
+ optional: false,
range: [753, 760],
loc: {
@@ -1547,7 +1699,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [764, 775],
loc: {
@@ -1558,7 +1712,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [764, 775],
loc: {
@@ -1577,7 +1733,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "declare",
+ optional: false,
range: [779, 786],
loc: {
@@ -1588,7 +1746,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "declare",
+ optional: false,
range: [779, 786],
loc: {
@@ -1607,7 +1767,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "get",
+ optional: false,
range: [790, 793],
loc: {
@@ -1618,7 +1780,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "get",
+ optional: false,
range: [790, 793],
loc: {
@@ -1637,7 +1801,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "infer",
+ optional: false,
range: [797, 802],
loc: {
@@ -1648,7 +1814,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "infer",
+ optional: false,
range: [797, 802],
loc: {
@@ -1667,7 +1835,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "is",
+ optional: false,
range: [806, 808],
loc: {
@@ -1678,7 +1848,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "is",
+ optional: false,
range: [806, 808],
loc: {
@@ -1697,7 +1869,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "keyof",
+ optional: false,
range: [812, 817],
loc: {
@@ -1708,7 +1882,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "keyof",
+ optional: false,
range: [812, 817],
loc: {
@@ -1727,7 +1903,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "module",
+ optional: false,
range: [821, 827],
loc: {
@@ -1738,7 +1916,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "module",
+ optional: false,
range: [821, 827],
loc: {
@@ -1757,7 +1937,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "namespace",
+ optional: false,
range: [831, 840],
loc: {
@@ -1768,7 +1950,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "namespace",
+ optional: false,
range: [831, 840],
loc: {
@@ -1787,7 +1971,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "never",
+ optional: false,
range: [844, 849],
loc: {
@@ -1798,7 +1984,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "never",
+ optional: false,
range: [844, 849],
loc: {
@@ -1817,7 +2005,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "readonly",
+ optional: false,
range: [853, 861],
loc: {
@@ -1828,7 +2018,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "readonly",
+ optional: false,
range: [853, 861],
loc: {
@@ -1847,7 +2039,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "require",
+ optional: false,
range: [865, 872],
loc: {
@@ -1858,7 +2052,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "require",
+ optional: false,
range: [865, 872],
loc: {
@@ -1877,7 +2073,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "number",
+ optional: false,
range: [876, 882],
loc: {
@@ -1888,7 +2086,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "number",
+ optional: false,
range: [876, 882],
loc: {
@@ -1907,7 +2107,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "object",
+ optional: false,
range: [886, 892],
loc: {
@@ -1918,7 +2120,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "object",
+ optional: false,
range: [886, 892],
loc: {
@@ -1937,7 +2141,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "set",
+ optional: false,
range: [896, 899],
loc: {
@@ -1948,7 +2154,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "set",
+ optional: false,
range: [896, 899],
loc: {
@@ -1967,7 +2175,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "string",
+ optional: false,
range: [903, 909],
loc: {
@@ -1978,7 +2188,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "string",
+ optional: false,
range: [903, 909],
loc: {
@@ -1997,7 +2209,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "symbol",
+ optional: false,
range: [913, 919],
loc: {
@@ -2008,7 +2222,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "symbol",
+ optional: false,
range: [913, 919],
loc: {
@@ -2027,7 +2243,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "type",
+ optional: false,
range: [923, 927],
loc: {
@@ -2038,7 +2256,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "type",
+ optional: false,
range: [923, 927],
loc: {
@@ -2057,7 +2277,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "undefined",
+ optional: false,
range: [931, 940],
loc: {
@@ -2068,7 +2290,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "undefined",
+ optional: false,
range: [931, 940],
loc: {
@@ -2087,7 +2311,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "unique",
+ optional: false,
range: [944, 950],
loc: {
@@ -2098,7 +2324,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "unique",
+ optional: false,
range: [944, 950],
loc: {
@@ -2117,7 +2345,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "unknown",
+ optional: false,
range: [954, 961],
loc: {
@@ -2128,7 +2358,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "unknown",
+ optional: false,
range: [954, 961],
loc: {
@@ -2147,7 +2379,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "from",
+ optional: false,
range: [965, 969],
loc: {
@@ -2158,7 +2392,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "from",
+ optional: false,
range: [965, 969],
loc: {
@@ -2177,7 +2413,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "global",
+ optional: false,
range: [973, 979],
loc: {
@@ -2188,7 +2426,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "global",
+ optional: false,
range: [973, 979],
loc: {
@@ -2207,7 +2447,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "bigint",
+ optional: false,
range: [983, 989],
loc: {
@@ -2218,7 +2460,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "bigint",
+ optional: false,
range: [983, 989],
loc: {
@@ -2237,7 +2481,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "of",
+ optional: false,
range: [993, 995],
loc: {
@@ -2248,7 +2494,9 @@ Program {
importKind: "value",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "of",
+ optional: false,
range: [993, 995],
loc: {
@@ -2283,9 +2531,13 @@ Program {
end: { column: 14, line: 71 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [1030, 1031],
loc: {
@@ -2302,15 +2554,19 @@ Program {
},
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [1067, 1068],
loc: {
@@ -2319,6 +2575,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: true,
value: FunctionExpression {
@@ -2334,6 +2591,7 @@ Program {
end: { column: 15, line: 73 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -2356,9 +2614,12 @@ Program {
type: "MethodDefinition",
accessibility: "private",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [1084, 1085],
loc: {
@@ -2367,6 +2628,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -2382,6 +2644,7 @@ Program {
end: { column: 16, line: 74 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -2404,9 +2667,12 @@ Program {
type: "MethodDefinition",
accessibility: "public",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [1100, 1101],
loc: {
@@ -2415,6 +2681,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -2430,6 +2697,7 @@ Program {
end: { column: 15, line: 75 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -2452,9 +2720,12 @@ Program {
type: "MethodDefinition",
accessibility: "protected",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "d",
+ optional: false,
range: [1120, 1121],
loc: {
@@ -2463,6 +2734,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -2476,9 +2748,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [1134, 1135],
loc: {
@@ -2505,6 +2780,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [1130, 1144],
@@ -2521,6 +2797,7 @@ Program {
end: { column: 3, line: 78 },
},
},
+ declare: false,
expression: false,
generator: true,
id: null,
@@ -2547,9 +2824,13 @@ Program {
end: { column: 1, line: 79 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [1041, 1042],
loc: {
@@ -2562,7 +2843,9 @@ Program {
type: "TSClassImplements",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [1054, 1055],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot
index b5725bf6f750..49b73e6d19bb 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/5-AST-Alignment-AST.shot
@@ -16,9 +16,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'abstract',
+- optional: false,
range: [83, 91],
loc: {
@@ -45,6 +48,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [77, 96],
@@ -58,9 +62,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'as',
+- optional: false,
range: [105, 107],
loc: {
@@ -87,6 +94,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [99, 112],
@@ -100,9 +108,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'asserts',
+- optional: false,
range: [121, 128],
loc: {
@@ -129,6 +140,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [115, 133],
@@ -142,9 +154,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'any',
+- optional: false,
range: [142, 145],
loc: {
@@ -171,6 +186,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [136, 150],
@@ -184,9 +200,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'async',
+- optional: false,
range: [159, 164],
loc: {
@@ -213,6 +232,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [153, 169],
@@ -226,9 +246,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'await',
+- optional: false,
range: [178, 183],
loc: {
@@ -255,6 +278,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [172, 188],
@@ -268,9 +292,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'boolean',
+- optional: false,
range: [197, 204],
loc: {
@@ -297,6 +324,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [191, 209],
@@ -310,9 +338,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [218, 229],
loc: {
@@ -339,6 +370,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [212, 234],
@@ -352,9 +384,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'declare',
+- optional: false,
range: [243, 250],
loc: {
@@ -381,6 +416,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [237, 255],
@@ -394,9 +430,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'get',
+- optional: false,
range: [264, 267],
loc: {
@@ -423,6 +462,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [258, 272],
@@ -436,9 +476,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'infer',
+- optional: false,
range: [281, 286],
loc: {
@@ -465,6 +508,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [275, 291],
@@ -478,9 +522,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'is',
+- optional: false,
range: [300, 302],
loc: {
@@ -507,6 +554,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [294, 307],
@@ -520,9 +568,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'keyof',
+- optional: false,
range: [316, 321],
loc: {
@@ -549,6 +600,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [310, 326],
@@ -562,9 +614,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'module',
+- optional: false,
range: [335, 341],
loc: {
@@ -591,6 +646,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [329, 346],
@@ -604,9 +660,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'namespace',
+- optional: false,
range: [355, 364],
loc: {
@@ -633,6 +692,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [349, 369],
@@ -646,9 +706,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'never',
+- optional: false,
range: [378, 383],
loc: {
@@ -675,6 +738,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [372, 388],
@@ -688,9 +752,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'readonly',
+- optional: false,
range: [397, 405],
loc: {
@@ -717,6 +784,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [391, 410],
@@ -730,9 +798,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'require',
+- optional: false,
range: [419, 426],
loc: {
@@ -759,6 +830,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [413, 431],
@@ -772,9 +844,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'number',
+- optional: false,
range: [440, 446],
loc: {
@@ -801,6 +876,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [434, 451],
@@ -814,9 +890,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'object',
+- optional: false,
range: [460, 466],
loc: {
@@ -843,6 +922,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [454, 471],
@@ -856,9 +936,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'set',
+- optional: false,
range: [480, 483],
loc: {
@@ -885,6 +968,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [474, 488],
@@ -898,9 +982,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'string',
+- optional: false,
range: [497, 503],
loc: {
@@ -927,6 +1014,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [491, 508],
@@ -940,9 +1028,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'symbol',
+- optional: false,
range: [517, 523],
loc: {
@@ -969,6 +1060,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [511, 528],
@@ -982,9 +1074,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'type',
+- optional: false,
range: [537, 541],
loc: {
@@ -1011,6 +1106,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [531, 546],
@@ -1024,9 +1120,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'undefined',
+- optional: false,
range: [555, 564],
loc: {
@@ -1053,6 +1152,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [549, 569],
@@ -1066,9 +1166,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'unique',
+- optional: false,
range: [578, 584],
loc: {
@@ -1095,6 +1198,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [572, 589],
@@ -1108,9 +1212,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'unknown',
+- optional: false,
range: [598, 605],
loc: {
@@ -1137,6 +1244,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [592, 610],
@@ -1150,9 +1258,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'from',
+- optional: false,
range: [619, 623],
loc: {
@@ -1179,6 +1290,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [613, 628],
@@ -1192,9 +1304,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'global',
+- optional: false,
range: [637, 643],
loc: {
@@ -1221,6 +1336,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [631, 648],
@@ -1234,9 +1350,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bigint',
+- optional: false,
range: [657, 663],
loc: {
@@ -1263,6 +1382,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [651, 668],
@@ -1276,9 +1396,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'of',
+- optional: false,
range: [677, 679],
loc: {
@@ -1305,6 +1428,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'const',
range: [671, 684],
@@ -1341,7 +1465,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'abstract',
+- optional: false,
range: [699, 707],
loc: {
@@ -1352,7 +1478,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'abstract',
+- optional: false,
range: [699, 707],
loc: {
@@ -1371,7 +1499,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'as',
+- optional: false,
range: [711, 713],
loc: {
@@ -1382,7 +1512,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'as',
+- optional: false,
range: [711, 713],
loc: {
@@ -1401,7 +1533,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'asserts',
+- optional: false,
range: [717, 724],
loc: {
@@ -1412,7 +1546,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'asserts',
+- optional: false,
range: [717, 724],
loc: {
@@ -1431,7 +1567,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'any',
+- optional: false,
range: [728, 731],
loc: {
@@ -1442,7 +1580,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'any',
+- optional: false,
range: [728, 731],
loc: {
@@ -1461,7 +1601,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'async',
+- optional: false,
range: [735, 740],
loc: {
@@ -1472,7 +1614,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'async',
+- optional: false,
range: [735, 740],
loc: {
@@ -1491,7 +1635,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'await',
+- optional: false,
range: [744, 749],
loc: {
@@ -1502,7 +1648,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'await',
+- optional: false,
range: [744, 749],
loc: {
@@ -1521,7 +1669,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'boolean',
+- optional: false,
range: [753, 760],
loc: {
@@ -1532,7 +1682,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'boolean',
+- optional: false,
range: [753, 760],
loc: {
@@ -1551,7 +1703,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [764, 775],
loc: {
@@ -1562,7 +1716,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [764, 775],
loc: {
@@ -1581,7 +1737,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'declare',
+- optional: false,
range: [779, 786],
loc: {
@@ -1592,7 +1750,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'declare',
+- optional: false,
range: [779, 786],
loc: {
@@ -1611,7 +1771,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'get',
+- optional: false,
range: [790, 793],
loc: {
@@ -1622,7 +1784,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'get',
+- optional: false,
range: [790, 793],
loc: {
@@ -1641,7 +1805,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'infer',
+- optional: false,
range: [797, 802],
loc: {
@@ -1652,7 +1818,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'infer',
+- optional: false,
range: [797, 802],
loc: {
@@ -1671,7 +1839,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'is',
+- optional: false,
range: [806, 808],
loc: {
@@ -1682,7 +1852,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'is',
+- optional: false,
range: [806, 808],
loc: {
@@ -1701,7 +1873,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'keyof',
+- optional: false,
range: [812, 817],
loc: {
@@ -1712,7 +1886,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'keyof',
+- optional: false,
range: [812, 817],
loc: {
@@ -1731,7 +1907,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'module',
+- optional: false,
range: [821, 827],
loc: {
@@ -1742,7 +1920,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'module',
+- optional: false,
range: [821, 827],
loc: {
@@ -1761,7 +1941,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'namespace',
+- optional: false,
range: [831, 840],
loc: {
@@ -1772,7 +1954,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'namespace',
+- optional: false,
range: [831, 840],
loc: {
@@ -1791,7 +1975,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'never',
+- optional: false,
range: [844, 849],
loc: {
@@ -1802,7 +1988,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'never',
+- optional: false,
range: [844, 849],
loc: {
@@ -1821,7 +2009,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'readonly',
+- optional: false,
range: [853, 861],
loc: {
@@ -1832,7 +2022,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'readonly',
+- optional: false,
range: [853, 861],
loc: {
@@ -1851,7 +2043,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'require',
+- optional: false,
range: [865, 872],
loc: {
@@ -1862,7 +2056,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'require',
+- optional: false,
range: [865, 872],
loc: {
@@ -1881,7 +2077,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'number',
+- optional: false,
range: [876, 882],
loc: {
@@ -1892,7 +2090,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'number',
+- optional: false,
range: [876, 882],
loc: {
@@ -1911,7 +2111,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'object',
+- optional: false,
range: [886, 892],
loc: {
@@ -1922,7 +2124,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'object',
+- optional: false,
range: [886, 892],
loc: {
@@ -1941,7 +2145,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'set',
+- optional: false,
range: [896, 899],
loc: {
@@ -1952,7 +2158,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'set',
+- optional: false,
range: [896, 899],
loc: {
@@ -1971,7 +2179,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'string',
+- optional: false,
range: [903, 909],
loc: {
@@ -1982,7 +2192,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'string',
+- optional: false,
range: [903, 909],
loc: {
@@ -2001,7 +2213,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'symbol',
+- optional: false,
range: [913, 919],
loc: {
@@ -2012,7 +2226,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'symbol',
+- optional: false,
range: [913, 919],
loc: {
@@ -2031,7 +2247,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'type',
+- optional: false,
range: [923, 927],
loc: {
@@ -2042,7 +2260,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'type',
+- optional: false,
range: [923, 927],
loc: {
@@ -2061,7 +2281,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'undefined',
+- optional: false,
range: [931, 940],
loc: {
@@ -2072,7 +2294,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'undefined',
+- optional: false,
range: [931, 940],
loc: {
@@ -2091,7 +2315,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'unique',
+- optional: false,
range: [944, 950],
loc: {
@@ -2102,7 +2328,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'unique',
+- optional: false,
range: [944, 950],
loc: {
@@ -2121,7 +2349,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'unknown',
+- optional: false,
range: [954, 961],
loc: {
@@ -2132,7 +2362,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'unknown',
+- optional: false,
range: [954, 961],
loc: {
@@ -2151,7 +2383,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'from',
+- optional: false,
range: [965, 969],
loc: {
@@ -2162,7 +2396,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'from',
+- optional: false,
range: [965, 969],
loc: {
@@ -2181,7 +2417,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'global',
+- optional: false,
range: [973, 979],
loc: {
@@ -2192,7 +2430,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'global',
+- optional: false,
range: [973, 979],
loc: {
@@ -2211,7 +2451,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bigint',
+- optional: false,
range: [983, 989],
loc: {
@@ -2222,7 +2464,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bigint',
+- optional: false,
range: [983, 989],
loc: {
@@ -2241,7 +2485,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'ImportSpecifier',
imported: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'of',
+- optional: false,
range: [993, 995],
loc: {
@@ -2252,7 +2498,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
importKind: 'value',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'of',
+- optional: false,
range: [993, 995],
loc: {
@@ -2287,9 +2535,13 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
end: { column: 14, line: 71 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [1030, 1031],
loc: {
@@ -2306,15 +2558,19 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [1067, 1068],
loc: {
@@ -2323,6 +2579,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: true,
value: FunctionExpression {
@@ -2338,6 +2595,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
end: { column: 15, line: 73 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -2360,9 +2618,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'MethodDefinition',
accessibility: 'private',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [1084, 1085],
loc: {
@@ -2371,6 +2632,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -2386,6 +2648,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
end: { column: 16, line: 74 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -2408,9 +2671,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'MethodDefinition',
accessibility: 'public',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'c',
+- optional: false,
range: [1100, 1101],
loc: {
@@ -2419,6 +2685,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -2434,6 +2701,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
end: { column: 15, line: 75 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -2456,9 +2724,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
type: 'MethodDefinition',
accessibility: 'protected',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'd',
+- optional: false,
range: [1120, 1121],
loc: {
@@ -2467,6 +2738,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -2480,9 +2752,12 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
range: [1134, 1135],
loc: {
@@ -2509,6 +2784,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
},
},
],
+- declare: false,
kind: 'let',
range: [1130, 1144],
@@ -2525,6 +2801,7 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
end: { column: 3, line: 78 },
},
},
+- declare: false,
expression: false,
generator: true,
id: null,
@@ -2551,9 +2828,13 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
end: { column: 1, line: 79 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [1041, 1042],
loc: {
@@ -2568,7 +2849,9 @@ exports[`AST Fixtures legacy-fixtures basics keyword-variables AST Alignment - A
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [1054, 1055],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot
index 8f452e81b3ee..3529f9cd5de1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/1-TSESTree-AST.shot
@@ -9,54 +9,27 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "nestedArray",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Array",
-
- range: [90, 95],
- loc: {
- start: { column: 17, line: 3 },
- end: { column: 22, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Array",
-
- range: [96, 101],
- loc: {
- start: { column: 23, line: 3 },
- end: { column: 28, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Array",
-
- range: [102, 107],
- loc: {
- start: { column: 29, line: 3 },
- end: { column: 34, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSStringKeyword {
@@ -76,6 +49,18 @@ Program {
end: { column: 42, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Array",
+ optional: false,
+
+ range: [102, 107],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
range: [102, 115],
loc: {
@@ -91,6 +76,18 @@ Program {
end: { column: 43, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Array",
+ optional: false,
+
+ range: [96, 101],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
range: [96, 116],
loc: {
@@ -106,6 +103,18 @@ Program {
end: { column: 44, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Array",
+ optional: false,
+
+ range: [90, 95],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
range: [90, 117],
loc: {
@@ -136,6 +145,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [73, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot
index fff61afeb9b4..fae5238938d6 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nested-type-arguments/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,202 @@
exports[`AST Fixtures legacy-fixtures basics nested-type-arguments AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'nestedArray',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Array',
++
++ range: [90, 95],
++ loc: {
++ start: { column: 17, line: 3 },
++ end: { column: 22, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSTypeReference {
+ type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Array',
++
++ range: [96, 101],
++ loc: {
++ start: { column: 23, line: 3 },
++ end: { column: 28, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSTypeReference {
+ type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Array',
++
++ range: [102, 107],
++ loc: {
++ start: { column: 29, line: 3 },
++ end: { column: 34, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [108, 114],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+ ],
+
+ range: [107, 115],
+ loc: {
+ start: { column: 34, line: 3 },
+ end: { column: 42, line: 3 },
+ },
+ },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Array',
+- optional: false,
+-
+- range: [102, 107],
+- loc: {
+- start: { column: 29, line: 3 },
+- end: { column: 34, line: 3 },
+- },
+- },
+
+ range: [102, 115],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 42, line: 3 },
+ },
+ },
+ ],
+
+ range: [101, 116],
+ loc: {
+ start: { column: 28, line: 3 },
+ end: { column: 43, line: 3 },
+ },
+ },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Array',
+- optional: false,
+
+- range: [96, 101],
+- loc: {
+- start: { column: 23, line: 3 },
+- end: { column: 28, line: 3 },
+- },
+- },
+-
+ range: [96, 116],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 43, line: 3 },
+ },
+ },
+ ],
+
+ range: [95, 117],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 44, line: 3 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Array',
+- optional: false,
+-
+- range: [90, 95],
+- loc: {
+- start: { column: 17, line: 3 },
+- end: { column: 22, line: 3 },
+ },
+ },
+
+ range: [90, 117],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+
+ range: [88, 117],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+
+ range: [77, 117],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 117],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [73, 118],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 45, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 119],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot
index 7e62ff3de6ab..310758701274 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/1-TSESTree-AST.shot
@@ -9,24 +9,17 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "X",
-
- range: [80, 81],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 8, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSNeverKeyword {
@@ -46,6 +39,18 @@ Program {
end: { column: 15, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "X",
+ optional: false,
+
+ range: [80, 81],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
range: [80, 88],
loc: {
@@ -76,6 +81,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [73, 89],
@@ -94,7 +100,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "Observable",
+ optional: false,
range: [90, 100],
loc: {
@@ -105,7 +113,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "empty",
+ optional: false,
range: [101, 106],
loc: {
@@ -121,7 +131,7 @@ Program {
},
},
optional: false,
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSNeverKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot
index 3405c7b4b919..17bbe4be48f8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/never-type-param/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,192 @@
exports[`AST Fixtures legacy-fixtures basics never-type-param AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'X',
++
++ range: [80, 81],
++ loc: {
++ start: { column: 7, line: 3 },
++ end: { column: 8, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSNeverKeyword {
+ type: 'TSNeverKeyword',
+
+ range: [82, 87],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+
+ range: [81, 88],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 15, line: 3 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'X',
+- optional: false,
+-
+- range: [80, 81],
+- loc: {
+- start: { column: 7, line: 3 },
+- end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [80, 88],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+
+ range: [78, 88],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+
+ range: [77, 88],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 88],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [73, 89],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Observable',
+- optional: false,
+
+ range: [90, 100],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'empty',
+- optional: false,
+
+ range: [101, 106],
+ loc: {
+ start: { column: 11, line: 4 },
+ end: { column: 16, line: 4 },
+ },
+ },
+
+ range: [90, 106],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 16, line: 4 },
+ },
+ },
+ optional: false,
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSNeverKeyword {
+ type: 'TSNeverKeyword',
+
+ range: [107, 112],
+ loc: {
+ start: { column: 17, line: 4 },
+ end: { column: 22, line: 4 },
+ },
+ },
+ ],
+
+ range: [106, 113],
+ loc: {
+ start: { column: 16, line: 4 },
+ end: { column: 23, line: 4 },
+ },
+ },
+
+ range: [90, 115],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 25, line: 4 },
+ },
+ },
+
+ range: [90, 116],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 117],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/1-TSESTree-AST.shot
index a8b94faa45d3..60a3da780ff9 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/1-TSESTree-AST.shot
@@ -17,7 +17,9 @@ Program {
arguments: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "e",
+ optional: false,
range: [127, 128],
loc: {
@@ -28,7 +30,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "validateEntity",
+ optional: false,
range: [112, 126],
loc: {
@@ -56,9 +60,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "s",
+ optional: false,
range: [137, 138],
loc: {
@@ -73,7 +80,9 @@ Program {
type: "TSNonNullExpression",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "e",
+ optional: false,
range: [141, 142],
loc: {
@@ -91,7 +100,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "name",
+ optional: false,
range: [144, 148],
loc: {
@@ -114,6 +125,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [133, 149],
@@ -130,11 +142,14 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processEntity",
+ optional: false,
range: [82, 95],
loc: {
@@ -145,6 +160,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "e",
optional: true,
typeAnnotation: TSTypeAnnotation {
@@ -153,7 +169,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Entity",
+ optional: false,
range: [100, 106],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/5-AST-Alignment-AST.shot
index d8601d442844..552644a251bb 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,223 @@
exports[`AST Fixtures legacy-fixtures basics non-null-assertion-operator AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'e',
+- optional: false,
+
+ range: [127, 128],
+ loc: {
+ start: { column: 17, line: 4 },
+ end: { column: 18, line: 4 },
+ },
+ },
+ ],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'validateEntity',
+- optional: false,
+
+ range: [112, 126],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 16, line: 4 },
+ },
+ },
+ optional: false,
+
+ range: [112, 129],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 19, line: 4 },
+ },
+ },
+
+ range: [112, 130],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 20, line: 4 },
+ },
+ },
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 's',
+- optional: false,
+
+ range: [137, 138],
+ loc: {
+ start: { column: 6, line: 5 },
+ end: { column: 7, line: 5 },
+ },
+ },
+ init: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'e',
+- optional: false,
+
+ range: [141, 142],
+ loc: {
+ start: { column: 10, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+
+ range: [141, 143],
+ loc: {
+ start: { column: 10, line: 5 },
+ end: { column: 12, line: 5 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'name',
+- optional: false,
+
+ range: [144, 148],
+ loc: {
+ start: { column: 13, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [141, 148],
+ loc: {
+ start: { column: 10, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [137, 148],
+ loc: {
+ start: { column: 6, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [133, 149],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ ],
+
+ range: [108, 151],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processEntity',
+- optional: false,
+
+ range: [82, 95],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'e',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Entity',
+- optional: false,
+
+ range: [100, 106],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
+
+ range: [100, 106],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
+
+ range: [98, 106],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
+
+ range: [96, 106],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 151],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 152],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 7 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/1-TSESTree-AST.shot
index d5f4e7261627..4ef189f802e4 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNullKeyword {
@@ -46,6 +49,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 85],
@@ -59,9 +63,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "y",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUndefinedKeyword {
@@ -96,6 +103,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [86, 103],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/5-AST-Alignment-AST.shot
index 24b8986179c8..80f91407215d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,127 @@
exports[`AST Fixtures legacy-fixtures basics null-and-undefined-type-annotations AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSNullKeyword {
+ type: 'TSNullKeyword',
+
+ range: [80, 84],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+
+ range: [78, 84],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+
+ range: [77, 84],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 84],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 85],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'y',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSUndefinedKeyword {
+ type: 'TSUndefinedKeyword',
+
+ range: [93, 102],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 16, line: 4 },
+ },
+ },
+
+ range: [91, 102],
+ loc: {
+ start: { column: 5, line: 4 },
+ end: { column: 16, line: 4 },
+ },
+ },
+
+ range: [90, 102],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 16, line: 4 },
+ },
+ },
+ init: null,
+
+ range: [90, 102],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 16, line: 4 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [86, 103],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 104],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/1-TSESTree-AST.shot
index 0b331137fc3b..0dce16b41185 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/1-TSESTree-AST.shot
@@ -15,9 +15,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "len",
+ optional: false,
range: [125, 128],
loc: {
@@ -29,7 +32,9 @@ Program {
type: "LogicalExpression",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "s",
+ optional: false,
range: [131, 132],
loc: {
@@ -64,6 +69,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [121, 139],
@@ -80,11 +86,14 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processNullishCoalesce",
+ optional: false,
range: [82, 104],
loc: {
@@ -95,6 +104,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "s",
optional: true,
typeAnnotation: TSTypeAnnotation {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/5-AST-Alignment-AST.shot
index e44cc1eb21fc..59661fcd10c1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,155 @@
exports[`AST Fixtures legacy-fixtures basics nullish-coalescing AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'len',
+- optional: false,
+
+ range: [125, 128],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ init: LogicalExpression {
+ type: 'LogicalExpression',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 's',
+- optional: false,
+
+ range: [131, 132],
+ loc: {
+ start: { column: 12, line: 4 },
+ end: { column: 13, line: 4 },
+ },
+ },
+ operator: '??',
+ right: Literal {
+ type: 'Literal',
+ raw: '\\'\\'',
+ value: '',
+
+ range: [136, 138],
+ loc: {
+ start: { column: 17, line: 4 },
+ end: { column: 19, line: 4 },
+ },
+ },
+
+ range: [131, 138],
+ loc: {
+ start: { column: 12, line: 4 },
+ end: { column: 19, line: 4 },
+ },
+ },
+
+ range: [125, 138],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 19, line: 4 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [121, 139],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 20, line: 4 },
+ },
+ },
+ ],
+
+ range: [117, 141],
+ loc: {
+ start: { column: 44, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processNullishCoalesce',
+- optional: false,
+
+ range: [82, 104],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 's',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [109, 115],
+ loc: {
+ start: { column: 36, line: 3 },
+ end: { column: 42, line: 3 },
+ },
+ },
+
+ range: [107, 115],
+ loc: {
+ start: { column: 34, line: 3 },
+ end: { column: 42, line: 3 },
+ },
+ },
+
+ range: [105, 115],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 42, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 141],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 142],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/1-TSESTree-AST.shot
index e5af4497aaaa..d19e138b046c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "__",
+ optional: false,
range: [76, 78],
loc: {
@@ -24,6 +26,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: Literal {
type: "Literal",
@@ -68,7 +71,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "__",
+ optional: false,
range: [93, 95],
loc: {
@@ -78,6 +83,7 @@ Program {
},
kind: "init",
method: true,
+ optional: false,
shorthand: false,
value: FunctionExpression {
type: "FunctionExpression",
@@ -92,6 +98,7 @@ Program {
end: { column: 10, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -146,6 +153,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: Literal {
type: "Literal",
@@ -182,6 +190,7 @@ Program {
},
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -189,6 +198,8 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Literal {
type: "Literal",
raw: "'__'",
@@ -200,7 +211,9 @@ Program {
end: { column: 6, line: 10 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: Literal {
type: "Literal",
@@ -228,9 +241,13 @@ Program {
end: { column: 1, line: 11 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [133, 134],
loc: {
@@ -238,6 +255,7 @@ Program {
end: { column: 7, line: 9 },
},
},
+ implements: [],
superClass: null,
range: [127, 153],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/5-AST-Alignment-AST.shot
index f9949f44171f..ee88a37d89d3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: '__',
+- optional: false,
range: [76, 78],
loc: {
@@ -28,6 +30,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
},
kind: 'init',
method: false,
+- optional: false,
shorthand: false,
value: Literal {
type: 'Literal',
@@ -72,7 +75,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: '__',
+- optional: false,
range: [93, 95],
loc: {
@@ -82,6 +87,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
},
kind: 'init',
method: true,
+- optional: false,
shorthand: false,
value: FunctionExpression {
type: 'FunctionExpression',
@@ -96,6 +102,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
end: { column: 10, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -150,6 +157,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
},
kind: 'init',
method: false,
+- optional: false,
shorthand: false,
value: Literal {
type: 'Literal',
@@ -186,6 +194,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
},
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -193,6 +202,8 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Literal {
type: 'Literal',
raw: '\\'__\\'',
@@ -204,7 +215,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
end: { column: 6, line: 10 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: Literal {
type: 'Literal',
@@ -232,9 +245,13 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
end: { column: 1, line: 11 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [133, 134],
loc: {
@@ -242,6 +259,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-escaped-properties AST
end: { column: 7, line: 9 },
},
},
+- implements: Array [],
superClass: null,
range: [127, 153],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot
index ba49f7d863cf..51752082e5b2 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -27,7 +30,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [89, 100],
loc: {
@@ -37,6 +42,7 @@ Program {
},
kind: "init",
method: true,
+ optional: false,
shorthand: false,
value: FunctionExpression {
type: "FunctionExpression",
@@ -72,6 +78,7 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -103,7 +110,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [101, 102],
loc: {
@@ -146,7 +155,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [137, 140],
loc: {
@@ -156,6 +167,7 @@ Program {
},
kind: "init",
method: true,
+ optional: false,
shorthand: false,
value: FunctionExpression {
type: "FunctionExpression",
@@ -191,6 +203,7 @@ Program {
end: { column: 3, line: 9 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -222,7 +235,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [141, 142],
loc: {
@@ -265,7 +280,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [181, 182],
loc: {
@@ -275,6 +292,7 @@ Program {
},
kind: "get",
method: false,
+ optional: false,
shorthand: false,
value: FunctionExpression {
type: "FunctionExpression",
@@ -310,6 +328,7 @@ Program {
end: { column: 3, line: 12 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -351,7 +370,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [220, 221],
loc: {
@@ -361,6 +382,7 @@ Program {
},
kind: "set",
method: false,
+ optional: false,
shorthand: false,
value: FunctionExpression {
type: "FunctionExpression",
@@ -375,13 +397,16 @@ Program {
end: { column: 29, line: 13 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -456,6 +481,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [73, 247],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot
index 134b63d05f42..2caadf4e3045 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-typed-methods/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -31,7 +34,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [89, 100],
loc: {
@@ -41,6 +46,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
},
kind: 'init',
method: true,
+- optional: false,
shorthand: false,
+ typeParameters: TSTypeParameterDeclaration {
+ type: 'TSTypeParameterDeclaration',
@@ -97,6 +103,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
end: { column: 3, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -117,8 +124,8 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
loc: {
start: { column: 18, line: 4 },
end: { column: 26, line: 4 },
-- },
-- },
+ },
+ },
- typeParameters: TSTypeParameterDeclaration {
- type: 'TSTypeParameterDeclaration',
- params: Array [
@@ -128,8 +135,10 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
--
+- optional: false,
+
- range: [101, 102],
- loc: {
- start: { column: 14, line: 4 },
@@ -150,9 +159,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
- loc: {
- start: { column: 13, line: 4 },
- end: { column: 16, line: 4 },
- },
- },
-
+- },
+- },
+-
- range: [100, 133],
+ range: [103, 133],
loc: {
@@ -173,7 +182,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [137, 140],
loc: {
@@ -183,6 +194,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
},
kind: 'init',
method: true,
+- optional: false,
shorthand: false,
+ typeParameters: TSTypeParameterDeclaration {
+ type: 'TSTypeParameterDeclaration',
@@ -239,6 +251,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
end: { column: 3, line: 9 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -270,7 +283,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
- range: [141, 142],
- loc: {
@@ -315,7 +330,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [181, 182],
loc: {
@@ -325,6 +342,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
},
kind: 'get',
method: false,
+- optional: false,
shorthand: false,
value: FunctionExpression {
type: 'FunctionExpression',
@@ -360,6 +378,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
end: { column: 3, line: 12 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -401,7 +420,9 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [220, 221],
loc: {
@@ -411,6 +432,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
},
kind: 'set',
method: false,
+- optional: false,
shorthand: false,
value: FunctionExpression {
type: 'FunctionExpression',
@@ -425,13 +447,16 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
end: { column: 29, line: 13 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -506,6 +531,7 @@ exports[`AST Fixtures legacy-fixtures basics object-with-typed-methods AST Align
},
},
],
+- declare: false,
kind: 'const',
range: [73, 247],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/1-TSESTree-AST.shot
index 8ae89d775881..899ea359295c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [113, 116],
loc: {
@@ -35,7 +37,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [118, 121],
loc: {
@@ -96,7 +100,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [128, 131],
loc: {
@@ -107,7 +113,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [133, 136],
loc: {
@@ -132,7 +140,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [138, 143],
loc: {
@@ -183,7 +193,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [149, 152],
loc: {
@@ -194,7 +206,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [154, 157],
loc: {
@@ -255,7 +269,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [164, 167],
loc: {
@@ -266,7 +282,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [169, 172],
loc: {
@@ -291,7 +309,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [174, 179],
loc: {
@@ -342,7 +362,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [185, 188],
loc: {
@@ -353,7 +375,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [190, 193],
loc: {
@@ -414,7 +438,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [200, 203],
loc: {
@@ -425,7 +451,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [205, 208],
loc: {
@@ -450,7 +478,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [210, 215],
loc: {
@@ -495,11 +525,14 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processOptional",
+ optional: false,
range: [82, 97],
loc: {
@@ -510,6 +543,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
optional: true,
typeAnnotation: TSTypeAnnotation {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot
index 6356986bf831..57486acf58ba 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,594 @@
exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-non-null-assertion AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [113, 116],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [118, 121],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [113, 121],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [113, 122],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+ optional: false,
+
+ range: [113, 124],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 13, line: 4 },
+ },
+ },
+
+ range: [113, 124],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 13, line: 4 },
+ },
+ },
+
+ range: [113, 125],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [128, 131],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [133, 136],
+ loc: {
+ start: { column: 7, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+
+ range: [128, 136],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+
+ range: [128, 137],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [138, 143],
+ loc: {
+ start: { column: 12, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [128, 143],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ optional: false,
+
+ range: [128, 145],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 19, line: 5 },
+ },
+ },
+
+ range: [128, 145],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 19, line: 5 },
+ },
+ },
+
+ range: [128, 146],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 20, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [149, 152],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 5, line: 6 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [154, 157],
+ loc: {
+ start: { column: 7, line: 6 },
+ end: { column: 10, line: 6 },
+ },
+ },
+
+ range: [149, 157],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 10, line: 6 },
+ },
+ },
+
+ range: [149, 158],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 11, line: 6 },
+ },
+ },
+ optional: false,
+
+ range: [149, 160],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+
+ range: [149, 160],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+
+ range: [149, 161],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 14, line: 6 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [164, 167],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 5, line: 7 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [169, 172],
+ loc: {
+ start: { column: 7, line: 7 },
+ end: { column: 10, line: 7 },
+ },
+ },
+
+ range: [164, 172],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 10, line: 7 },
+ },
+ },
+
+ range: [164, 173],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 11, line: 7 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [174, 179],
+ loc: {
+ start: { column: 12, line: 7 },
+ end: { column: 17, line: 7 },
+ },
+ },
+
+ range: [164, 179],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 17, line: 7 },
+ },
+ },
+ optional: false,
+
+ range: [164, 181],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 19, line: 7 },
+ },
+ },
+
+ range: [164, 181],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 19, line: 7 },
+ },
+ },
+
+ range: [164, 182],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 20, line: 7 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [185, 188],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 5, line: 8 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [190, 193],
+ loc: {
+ start: { column: 7, line: 8 },
+ end: { column: 10, line: 8 },
+ },
+ },
+
+ range: [185, 193],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 10, line: 8 },
+ },
+ },
+
+ range: [185, 194],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 11, line: 8 },
+ },
+ },
+ optional: false,
+
+ range: [185, 196],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 13, line: 8 },
+ },
+ },
+
+ range: [185, 196],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 13, line: 8 },
+ },
+ },
+
+ range: [185, 197],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 14, line: 8 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [200, 203],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 5, line: 9 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [205, 208],
+ loc: {
+ start: { column: 7, line: 9 },
+ end: { column: 10, line: 9 },
+ },
+ },
+
+ range: [200, 208],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 10, line: 9 },
+ },
+ },
+
+ range: [200, 209],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 11, line: 9 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [210, 215],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+
+ range: [200, 215],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+ optional: false,
+
+ range: [200, 217],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 19, line: 9 },
+ },
+ },
+
+ range: [200, 217],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 19, line: 9 },
+ },
+ },
+
+ range: [200, 218],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 20, line: 9 },
+ },
+ },
+ ],
+
+ range: [109, 220],
+ loc: {
+ start: { column: 36, line: 3 },
+ end: { column: 1, line: 10 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processOptional',
+- optional: false,
+
+ range: [82, 97],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [104, 107],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [102, 107],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [98, 107],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 220],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 221],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 11 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/1-TSESTree-AST.shot
index 31586978c94d..606a89854009 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/1-TSESTree-AST.shot
@@ -22,7 +22,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [123, 126],
loc: {
@@ -33,7 +35,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [128, 130],
loc: {
@@ -85,7 +89,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [137, 140],
loc: {
@@ -96,7 +102,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [142, 145],
loc: {
@@ -121,7 +129,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [147, 149],
loc: {
@@ -166,7 +176,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [155, 158],
loc: {
@@ -177,7 +189,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [159, 162],
loc: {
@@ -195,7 +209,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [164, 166],
loc: {
@@ -250,7 +266,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [173, 176],
loc: {
@@ -261,7 +279,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [177, 180],
loc: {
@@ -279,7 +299,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [182, 187],
loc: {
@@ -304,7 +326,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [189, 191],
loc: {
@@ -352,7 +376,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [197, 200],
loc: {
@@ -363,7 +389,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [201, 204],
loc: {
@@ -381,7 +409,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [206, 211],
loc: {
@@ -399,7 +429,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [213, 215],
loc: {
@@ -445,7 +477,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [222, 225],
loc: {
@@ -487,7 +521,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [234, 237],
loc: {
@@ -537,7 +573,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [248, 251],
loc: {
@@ -587,7 +625,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [265, 268],
loc: {
@@ -613,7 +653,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [274, 277],
loc: {
@@ -643,11 +685,14 @@ Program {
end: { column: 1, line: 15 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processOptionalCallParens",
+ optional: false,
range: [82, 107],
loc: {
@@ -658,6 +703,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
optional: true,
typeAnnotation: TSTypeAnnotation {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/5-AST-Alignment-AST.shot
index 0227f0b9ac02..484e493aab84 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,754 @@
exports[`AST Fixtures legacy-fixtures basics optional-chain-call-with-parens AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [123, 126],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fn',
+- optional: false,
+
+ range: [128, 130],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+
+ range: [123, 130],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ optional: false,
+
+ range: [123, 132],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+
+ range: [123, 132],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+
+ range: [123, 133],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 12, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [137, 140],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 6, line: 5 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [142, 145],
+ loc: {
+ start: { column: 8, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+
+ range: [137, 145],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+
+ range: [137, 145],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fn',
+- optional: false,
+
+ range: [147, 149],
+ loc: {
+ start: { column: 13, line: 5 },
+ end: { column: 15, line: 5 },
+ },
+ },
+
+ range: [136, 149],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 15, line: 5 },
+ },
+ },
+ optional: false,
+
+ range: [136, 151],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+
+ range: [136, 152],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [155, 158],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 5, line: 6 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [159, 162],
+ loc: {
+ start: { column: 6, line: 6 },
+ end: { column: 9, line: 6 },
+ },
+ },
+
+ range: [155, 162],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 9, line: 6 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fn',
+- optional: false,
+
+ range: [164, 166],
+ loc: {
+ start: { column: 11, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+
+ range: [155, 166],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+ optional: false,
+
+ range: [155, 168],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 15, line: 6 },
+ },
+ },
+
+ range: [155, 168],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 15, line: 6 },
+ },
+ },
+
+ range: [155, 169],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 16, line: 6 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [173, 176],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 6, line: 7 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [177, 180],
+ loc: {
+ start: { column: 7, line: 7 },
+ end: { column: 10, line: 7 },
+ },
+ },
+
+ range: [173, 180],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 10, line: 7 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [182, 187],
+ loc: {
+ start: { column: 12, line: 7 },
+ end: { column: 17, line: 7 },
+ },
+ },
+
+ range: [173, 187],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 17, line: 7 },
+ },
+ },
+
+ range: [173, 187],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 17, line: 7 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fn',
+- optional: false,
+
+ range: [189, 191],
+ loc: {
+ start: { column: 19, line: 7 },
+ end: { column: 21, line: 7 },
+ },
+ },
+
+ range: [172, 191],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 21, line: 7 },
+ },
+ },
+ optional: false,
+
+ range: [172, 193],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 23, line: 7 },
+ },
+ },
+
+ range: [172, 194],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 24, line: 7 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [197, 200],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 5, line: 8 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [201, 204],
+ loc: {
+ start: { column: 6, line: 8 },
+ end: { column: 9, line: 8 },
+ },
+ },
+
+ range: [197, 204],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 9, line: 8 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [206, 211],
+ loc: {
+ start: { column: 11, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
+
+ range: [197, 211],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fn',
+- optional: false,
+
+ range: [213, 215],
+ loc: {
+ start: { column: 18, line: 8 },
+ end: { column: 20, line: 8 },
+ },
+ },
+
+ range: [197, 215],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 20, line: 8 },
+ },
+ },
+ optional: false,
+
+ range: [197, 217],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [197, 217],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [197, 218],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 23, line: 8 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [222, 225],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 5, line: 10 },
+ },
+ },
+ optional: true,
+
+ range: [222, 229],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 9, line: 10 },
+ },
+ },
+
+ range: [222, 229],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 9, line: 10 },
+ },
+ },
+
+ range: [222, 230],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 10, line: 10 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [234, 237],
+ loc: {
+ start: { column: 3, line: 11 },
+ end: { column: 6, line: 11 },
+ },
+ },
+ optional: true,
+
+ range: [234, 241],
+ loc: {
+ start: { column: 3, line: 11 },
+ end: { column: 10, line: 11 },
+ },
+ },
+
+ range: [234, 241],
+ loc: {
+ start: { column: 3, line: 11 },
+ end: { column: 10, line: 11 },
+ },
+ },
+ optional: false,
+
+ range: [233, 244],
+ loc: {
+ start: { column: 2, line: 11 },
+ end: { column: 13, line: 11 },
+ },
+ },
+
+ range: [233, 245],
+ loc: {
+ start: { column: 2, line: 11 },
+ end: { column: 14, line: 11 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [248, 251],
+ loc: {
+ start: { column: 2, line: 12 },
+ end: { column: 5, line: 12 },
+ },
+ },
+ optional: true,
+
+ range: [248, 255],
+ loc: {
+ start: { column: 2, line: 12 },
+ end: { column: 9, line: 12 },
+ },
+ },
+ optional: true,
+
+ range: [248, 259],
+ loc: {
+ start: { column: 2, line: 12 },
+ end: { column: 13, line: 12 },
+ },
+ },
+
+ range: [248, 259],
+ loc: {
+ start: { column: 2, line: 12 },
+ end: { column: 13, line: 12 },
+ },
+ },
+
+ range: [248, 260],
+ loc: {
+ start: { column: 2, line: 12 },
+ end: { column: 14, line: 12 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [265, 268],
+ loc: {
+ start: { column: 3, line: 14 },
+ end: { column: 6, line: 14 },
+ },
+ },
+ optional: true,
+
+ range: [265, 272],
+ loc: {
+ start: { column: 3, line: 14 },
+ end: { column: 10, line: 14 },
+ },
+ },
+
+ range: [265, 272],
+ loc: {
+ start: { column: 3, line: 14 },
+ end: { column: 10, line: 14 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [274, 277],
+ loc: {
+ start: { column: 12, line: 14 },
+ end: { column: 15, line: 14 },
+ },
+ },
+
+ range: [264, 277],
+ loc: {
+ start: { column: 2, line: 14 },
+ end: { column: 15, line: 14 },
+ },
+ },
+
+ range: [264, 278],
+ loc: {
+ start: { column: 2, line: 14 },
+ end: { column: 16, line: 14 },
+ },
+ },
+ ],
+
+ range: [119, 280],
+ loc: {
+ start: { column: 46, line: 3 },
+ end: { column: 1, line: 15 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processOptionalCallParens',
+- optional: false,
+
+ range: [82, 107],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [114, 117],
+ loc: {
+ start: { column: 41, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+
+ range: [112, 117],
+ loc: {
+ start: { column: 39, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+
+ range: [108, 117],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 280],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 15 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 281],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 16 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/1-TSESTree-AST.shot
index 0099612e53ab..f25cb3a8adc1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/1-TSESTree-AST.shot
@@ -22,7 +22,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [117, 120],
loc: {
@@ -33,7 +35,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [122, 124],
loc: {
@@ -85,7 +89,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [130, 133],
loc: {
@@ -96,7 +102,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [135, 138],
loc: {
@@ -114,7 +122,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [139, 141],
loc: {
@@ -166,7 +176,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [147, 150],
loc: {
@@ -177,7 +189,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [151, 154],
loc: {
@@ -195,7 +209,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [156, 158],
loc: {
@@ -250,7 +266,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [164, 167],
loc: {
@@ -261,7 +279,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [168, 171],
loc: {
@@ -279,7 +299,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [173, 178],
loc: {
@@ -297,7 +319,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [179, 181],
loc: {
@@ -352,7 +376,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [187, 190],
loc: {
@@ -363,7 +389,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [191, 194],
loc: {
@@ -381,7 +409,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [196, 201],
loc: {
@@ -399,7 +429,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [203, 205],
loc: {
@@ -445,7 +477,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [212, 215],
loc: {
@@ -487,7 +521,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [223, 226],
loc: {
@@ -537,7 +573,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [236, 239],
loc: {
@@ -587,7 +625,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [252, 255],
loc: {
@@ -606,7 +646,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [260, 263],
loc: {
@@ -643,11 +685,14 @@ Program {
end: { column: 1, line: 15 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processOptionalCall",
+ optional: false,
range: [82, 101],
loc: {
@@ -658,6 +703,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
optional: true,
typeAnnotation: TSTypeAnnotation {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/5-AST-Alignment-AST.shot
index 46ac1db8b246..ca3abed04637 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-call/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,754 @@
exports[`AST Fixtures legacy-fixtures basics optional-chain-call AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [117, 120],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fn',
+- optional: false,
+
+ range: [122, 124],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+
+ range: [117, 124],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ optional: false,
+
+ range: [117, 126],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+
+ range: [117, 126],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+
+ range: [117, 127],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 12, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [130, 133],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [135, 138],
+ loc: {
+ start: { column: 7, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+
+ range: [130, 138],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fn',
+- optional: false,
+
+ range: [139, 141],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 13, line: 5 },
+ },
+ },
+
+ range: [130, 141],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 13, line: 5 },
+ },
+ },
+ optional: false,
+
+ range: [130, 143],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 15, line: 5 },
+ },
+ },
+
+ range: [130, 143],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 15, line: 5 },
+ },
+ },
+
+ range: [130, 144],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 16, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [147, 150],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 5, line: 6 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [151, 154],
+ loc: {
+ start: { column: 6, line: 6 },
+ end: { column: 9, line: 6 },
+ },
+ },
+
+ range: [147, 154],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 9, line: 6 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fn',
+- optional: false,
+
+ range: [156, 158],
+ loc: {
+ start: { column: 11, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+
+ range: [147, 158],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+ optional: false,
+
+ range: [147, 160],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 15, line: 6 },
+ },
+ },
+
+ range: [147, 160],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 15, line: 6 },
+ },
+ },
+
+ range: [147, 161],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 16, line: 6 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [164, 167],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 5, line: 7 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [168, 171],
+ loc: {
+ start: { column: 6, line: 7 },
+ end: { column: 9, line: 7 },
+ },
+ },
+
+ range: [164, 171],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 9, line: 7 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [173, 178],
+ loc: {
+ start: { column: 11, line: 7 },
+ end: { column: 16, line: 7 },
+ },
+ },
+
+ range: [164, 178],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 16, line: 7 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fn',
+- optional: false,
+
+ range: [179, 181],
+ loc: {
+ start: { column: 17, line: 7 },
+ end: { column: 19, line: 7 },
+ },
+ },
+
+ range: [164, 181],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 19, line: 7 },
+ },
+ },
+ optional: false,
+
+ range: [164, 183],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 21, line: 7 },
+ },
+ },
+
+ range: [164, 183],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 21, line: 7 },
+ },
+ },
+
+ range: [164, 184],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 22, line: 7 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [187, 190],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 5, line: 8 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [191, 194],
+ loc: {
+ start: { column: 6, line: 8 },
+ end: { column: 9, line: 8 },
+ },
+ },
+
+ range: [187, 194],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 9, line: 8 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [196, 201],
+ loc: {
+ start: { column: 11, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
+
+ range: [187, 201],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'fn',
+- optional: false,
+
+ range: [203, 205],
+ loc: {
+ start: { column: 18, line: 8 },
+ end: { column: 20, line: 8 },
+ },
+ },
+
+ range: [187, 205],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 20, line: 8 },
+ },
+ },
+ optional: false,
+
+ range: [187, 207],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [187, 207],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [187, 208],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 23, line: 8 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [212, 215],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 5, line: 10 },
+ },
+ },
+ optional: true,
+
+ range: [212, 219],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 9, line: 10 },
+ },
+ },
+
+ range: [212, 219],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 9, line: 10 },
+ },
+ },
+
+ range: [212, 220],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 10, line: 10 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [223, 226],
+ loc: {
+ start: { column: 2, line: 11 },
+ end: { column: 5, line: 11 },
+ },
+ },
+ optional: true,
+
+ range: [223, 230],
+ loc: {
+ start: { column: 2, line: 11 },
+ end: { column: 9, line: 11 },
+ },
+ },
+ optional: false,
+
+ range: [223, 232],
+ loc: {
+ start: { column: 2, line: 11 },
+ end: { column: 11, line: 11 },
+ },
+ },
+
+ range: [223, 232],
+ loc: {
+ start: { column: 2, line: 11 },
+ end: { column: 11, line: 11 },
+ },
+ },
+
+ range: [223, 233],
+ loc: {
+ start: { column: 2, line: 11 },
+ end: { column: 12, line: 11 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [236, 239],
+ loc: {
+ start: { column: 2, line: 12 },
+ end: { column: 5, line: 12 },
+ },
+ },
+ optional: true,
+
+ range: [236, 243],
+ loc: {
+ start: { column: 2, line: 12 },
+ end: { column: 9, line: 12 },
+ },
+ },
+ optional: true,
+
+ range: [236, 247],
+ loc: {
+ start: { column: 2, line: 12 },
+ end: { column: 13, line: 12 },
+ },
+ },
+
+ range: [236, 247],
+ loc: {
+ start: { column: 2, line: 12 },
+ end: { column: 13, line: 12 },
+ },
+ },
+
+ range: [236, 248],
+ loc: {
+ start: { column: 2, line: 12 },
+ end: { column: 14, line: 12 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [252, 255],
+ loc: {
+ start: { column: 2, line: 14 },
+ end: { column: 5, line: 14 },
+ },
+ },
+ optional: true,
+
+ range: [252, 259],
+ loc: {
+ start: { column: 2, line: 14 },
+ end: { column: 9, line: 14 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [260, 263],
+ loc: {
+ start: { column: 10, line: 14 },
+ end: { column: 13, line: 14 },
+ },
+ },
+
+ range: [252, 263],
+ loc: {
+ start: { column: 2, line: 14 },
+ end: { column: 13, line: 14 },
+ },
+ },
+
+ range: [252, 263],
+ loc: {
+ start: { column: 2, line: 14 },
+ end: { column: 13, line: 14 },
+ },
+ },
+
+ range: [252, 264],
+ loc: {
+ start: { column: 2, line: 14 },
+ end: { column: 14, line: 14 },
+ },
+ },
+ ],
+
+ range: [113, 266],
+ loc: {
+ start: { column: 40, line: 3 },
+ end: { column: 1, line: 15 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processOptionalCall',
+- optional: false,
+
+ range: [82, 101],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [108, 111],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [106, 111],
+ loc: {
+ start: { column: 33, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [102, 111],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 266],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 15 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 267],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 16 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/1-TSESTree-AST.shot
index c65995495de7..928f012e2280 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [113, 116],
loc: {
@@ -61,7 +63,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [127, 132],
loc: {
@@ -104,7 +108,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [137, 140],
loc: {
@@ -148,7 +154,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [152, 157],
loc: {
@@ -184,7 +192,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [162, 165],
loc: {
@@ -228,7 +238,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [177, 182],
loc: {
@@ -264,7 +276,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [186, 189],
loc: {
@@ -275,7 +289,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [191, 194],
loc: {
@@ -344,7 +360,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [209, 212],
loc: {
@@ -355,7 +373,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [214, 217],
loc: {
@@ -424,7 +444,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [233, 236],
loc: {
@@ -435,7 +457,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [238, 241],
loc: {
@@ -498,11 +522,14 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processOptional",
+ optional: false,
range: [82, 97],
loc: {
@@ -513,6 +540,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
optional: true,
typeAnnotation: TSTypeAnnotation {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot
index dd256689be6a..ab4bcf6e1ff1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,591 @@
exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-non-null-assertion AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [113, 116],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '\\'two\\'',
+ value: 'two',
+
+ range: [119, 124],
+ loc: {
+ start: { column: 8, line: 4 },
+ end: { column: 13, line: 4 },
+ },
+ },
+
+ range: [113, 125],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+
+ range: [113, 126],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [127, 132],
+ loc: {
+ start: { column: 16, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+
+ range: [113, 132],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+
+ range: [113, 132],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+
+ range: [113, 133],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 22, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [137, 140],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 6, line: 5 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '\\'two\\'',
+ value: 'two',
+
+ range: [143, 148],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 14, line: 5 },
+ },
+ },
+
+ range: [137, 149],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 15, line: 5 },
+ },
+ },
+
+ range: [137, 149],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 15, line: 5 },
+ },
+ },
+
+ range: [136, 151],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [152, 157],
+ loc: {
+ start: { column: 18, line: 5 },
+ end: { column: 23, line: 5 },
+ },
+ },
+
+ range: [136, 157],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 23, line: 5 },
+ },
+ },
+
+ range: [136, 158],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 24, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [162, 165],
+ loc: {
+ start: { column: 3, line: 6 },
+ end: { column: 6, line: 6 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '\\'two\\'',
+ value: 'two',
+
+ range: [168, 173],
+ loc: {
+ start: { column: 9, line: 6 },
+ end: { column: 14, line: 6 },
+ },
+ },
+
+ range: [162, 174],
+ loc: {
+ start: { column: 3, line: 6 },
+ end: { column: 15, line: 6 },
+ },
+ },
+
+ range: [162, 174],
+ loc: {
+ start: { column: 3, line: 6 },
+ end: { column: 15, line: 6 },
+ },
+ },
+
+ range: [161, 176],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 17, line: 6 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [177, 182],
+ loc: {
+ start: { column: 18, line: 6 },
+ end: { column: 23, line: 6 },
+ },
+ },
+
+ range: [161, 182],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 23, line: 6 },
+ },
+ },
+
+ range: [161, 183],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 24, line: 6 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [186, 189],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 5, line: 7 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [191, 194],
+ loc: {
+ start: { column: 7, line: 7 },
+ end: { column: 10, line: 7 },
+ },
+ },
+
+ range: [186, 194],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 10, line: 7 },
+ },
+ },
+
+ range: [186, 195],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 11, line: 7 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '\\'three\\'',
+ value: 'three',
+
+ range: [196, 203],
+ loc: {
+ start: { column: 12, line: 7 },
+ end: { column: 19, line: 7 },
+ },
+ },
+
+ range: [186, 204],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 20, line: 7 },
+ },
+ },
+
+ range: [186, 204],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 20, line: 7 },
+ },
+ },
+
+ range: [186, 205],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 21, line: 7 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [209, 212],
+ loc: {
+ start: { column: 3, line: 8 },
+ end: { column: 6, line: 8 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [214, 217],
+ loc: {
+ start: { column: 8, line: 8 },
+ end: { column: 11, line: 8 },
+ },
+ },
+
+ range: [209, 217],
+ loc: {
+ start: { column: 3, line: 8 },
+ end: { column: 11, line: 8 },
+ },
+ },
+
+ range: [209, 217],
+ loc: {
+ start: { column: 3, line: 8 },
+ end: { column: 11, line: 8 },
+ },
+ },
+
+ range: [208, 219],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 13, line: 8 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '\\'three\\'',
+ value: 'three',
+
+ range: [220, 227],
+ loc: {
+ start: { column: 14, line: 8 },
+ end: { column: 21, line: 8 },
+ },
+ },
+
+ range: [208, 228],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [208, 229],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 23, line: 8 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [233, 236],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 6, line: 9 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [238, 241],
+ loc: {
+ start: { column: 8, line: 9 },
+ end: { column: 11, line: 9 },
+ },
+ },
+
+ range: [233, 241],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 11, line: 9 },
+ },
+ },
+
+ range: [233, 241],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 11, line: 9 },
+ },
+ },
+
+ range: [232, 243],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 13, line: 9 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '\\'three\\'',
+ value: 'three',
+
+ range: [244, 251],
+ loc: {
+ start: { column: 14, line: 9 },
+ end: { column: 21, line: 9 },
+ },
+ },
+
+ range: [232, 252],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+
+ range: [232, 253],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+ ],
+
+ range: [109, 255],
+ loc: {
+ start: { column: 36, line: 3 },
+ end: { column: 1, line: 10 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processOptional',
+- optional: false,
+
+ range: [82, 97],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [104, 107],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [102, 107],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [98, 107],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 255],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 256],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 11 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/1-TSESTree-AST.shot
index cadafd1e9277..88ec420d638c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/1-TSESTree-AST.shot
@@ -19,7 +19,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [126, 129],
loc: {
@@ -72,7 +74,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [139, 142],
loc: {
@@ -144,7 +148,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [155, 158],
loc: {
@@ -219,7 +225,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [171, 174],
loc: {
@@ -313,7 +321,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [190, 193],
loc: {
@@ -410,7 +420,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [211, 214],
loc: {
@@ -516,11 +528,14 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processOptionalElementParens",
+ optional: false,
range: [82, 110],
loc: {
@@ -531,6 +546,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
optional: true,
typeAnnotation: TSTypeAnnotation {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/5-AST-Alignment-AST.shot
index 1e8a8d850749..55220826fb11 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,597 @@
exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access-with-parens AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [126, 129],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [132, 133],
+ loc: {
+ start: { column: 8, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+
+ range: [126, 134],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [126, 134],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [126, 135],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [139, 142],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 6, line: 5 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [145, 146],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+
+ range: [139, 147],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+
+ range: [139, 147],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [149, 150],
+ loc: {
+ start: { column: 13, line: 5 },
+ end: { column: 14, line: 5 },
+ },
+ },
+
+ range: [138, 151],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 15, line: 5 },
+ },
+ },
+
+ range: [138, 152],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 16, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [155, 158],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 5, line: 6 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [159, 160],
+ loc: {
+ start: { column: 6, line: 6 },
+ end: { column: 7, line: 6 },
+ },
+ },
+
+ range: [155, 161],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 8, line: 6 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [164, 165],
+ loc: {
+ start: { column: 11, line: 6 },
+ end: { column: 12, line: 6 },
+ },
+ },
+
+ range: [155, 166],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+
+ range: [155, 166],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+
+ range: [155, 167],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 14, line: 6 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [171, 174],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 6, line: 7 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [175, 176],
+ loc: {
+ start: { column: 7, line: 7 },
+ end: { column: 8, line: 7 },
+ },
+ },
+
+ range: [171, 177],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 9, line: 7 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [180, 181],
+ loc: {
+ start: { column: 12, line: 7 },
+ end: { column: 13, line: 7 },
+ },
+ },
+
+ range: [171, 182],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 14, line: 7 },
+ },
+ },
+
+ range: [171, 182],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 14, line: 7 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '4',
+ value: 4,
+
+ range: [184, 185],
+ loc: {
+ start: { column: 16, line: 7 },
+ end: { column: 17, line: 7 },
+ },
+ },
+
+ range: [170, 186],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 18, line: 7 },
+ },
+ },
+
+ range: [170, 187],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 19, line: 7 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [190, 193],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 5, line: 8 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [194, 195],
+ loc: {
+ start: { column: 6, line: 8 },
+ end: { column: 7, line: 8 },
+ },
+ },
+
+ range: [190, 196],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 8, line: 8 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [199, 200],
+ loc: {
+ start: { column: 11, line: 8 },
+ end: { column: 12, line: 8 },
+ },
+ },
+
+ range: [190, 201],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 13, line: 8 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '4',
+ value: 4,
+
+ range: [204, 205],
+ loc: {
+ start: { column: 16, line: 8 },
+ end: { column: 17, line: 8 },
+ },
+ },
+
+ range: [190, 206],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 18, line: 8 },
+ },
+ },
+
+ range: [190, 206],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 18, line: 8 },
+ },
+ },
+
+ range: [190, 207],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 19, line: 8 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [211, 214],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 6, line: 9 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [215, 216],
+ loc: {
+ start: { column: 7, line: 9 },
+ end: { column: 8, line: 9 },
+ },
+ },
+
+ range: [211, 217],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 9, line: 9 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [220, 221],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 13, line: 9 },
+ },
+ },
+
+ range: [211, 222],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 14, line: 9 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '4',
+ value: 4,
+
+ range: [225, 226],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 18, line: 9 },
+ },
+ },
+
+ range: [211, 227],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 19, line: 9 },
+ },
+ },
+
+ range: [211, 227],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 19, line: 9 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '5',
+ value: 5,
+
+ range: [229, 230],
+ loc: {
+ start: { column: 21, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+
+ range: [210, 231],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+
+ range: [210, 232],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 24, line: 9 },
+ },
+ },
+ ],
+
+ range: [122, 234],
+ loc: {
+ start: { column: 49, line: 3 },
+ end: { column: 1, line: 10 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processOptionalElementParens',
+- optional: false,
+
+ range: [82, 110],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 37, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [117, 120],
+ loc: {
+ start: { column: 44, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+
+ range: [115, 120],
+ loc: {
+ start: { column: 42, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+
+ range: [111, 120],
+ loc: {
+ start: { column: 38, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 234],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 235],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 11 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/1-TSESTree-AST.shot
index 8b5125a55021..c56f2b5eb81d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/1-TSESTree-AST.shot
@@ -19,7 +19,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [120, 123],
loc: {
@@ -72,7 +74,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [132, 135],
loc: {
@@ -144,7 +148,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [147, 150],
loc: {
@@ -216,7 +222,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [162, 165],
loc: {
@@ -291,7 +299,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [177, 180],
loc: {
@@ -385,7 +395,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [195, 198],
loc: {
@@ -472,11 +484,14 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processOptionalElement",
+ optional: false,
range: [82, 104],
loc: {
@@ -487,6 +502,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
optional: true,
typeAnnotation: TSTypeAnnotation {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/5-AST-Alignment-AST.shot
index dc5647c5cbe5..41e81dfd1024 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-element-access/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,553 @@
exports[`AST Fixtures legacy-fixtures basics optional-chain-element-access AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [120, 123],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [126, 127],
+ loc: {
+ start: { column: 8, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+
+ range: [120, 128],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [120, 128],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [120, 129],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [132, 135],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [138, 139],
+ loc: {
+ start: { column: 8, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+
+ range: [132, 140],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [141, 142],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 12, line: 5 },
+ },
+ },
+
+ range: [132, 143],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 13, line: 5 },
+ },
+ },
+
+ range: [132, 143],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 13, line: 5 },
+ },
+ },
+
+ range: [132, 144],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 14, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [147, 150],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 5, line: 6 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [151, 152],
+ loc: {
+ start: { column: 6, line: 6 },
+ end: { column: 7, line: 6 },
+ },
+ },
+
+ range: [147, 153],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 8, line: 6 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [156, 157],
+ loc: {
+ start: { column: 11, line: 6 },
+ end: { column: 12, line: 6 },
+ },
+ },
+
+ range: [147, 158],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+
+ range: [147, 158],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+
+ range: [147, 159],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 14, line: 6 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [162, 165],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 5, line: 7 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [166, 167],
+ loc: {
+ start: { column: 6, line: 7 },
+ end: { column: 7, line: 7 },
+ },
+ },
+
+ range: [162, 168],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 8, line: 7 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [171, 172],
+ loc: {
+ start: { column: 11, line: 7 },
+ end: { column: 12, line: 7 },
+ },
+ },
+
+ range: [162, 173],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 13, line: 7 },
+ },
+ },
+
+ range: [162, 173],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 13, line: 7 },
+ },
+ },
+
+ range: [162, 174],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 14, line: 7 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [177, 180],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 5, line: 8 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [181, 182],
+ loc: {
+ start: { column: 6, line: 8 },
+ end: { column: 7, line: 8 },
+ },
+ },
+
+ range: [177, 183],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 8, line: 8 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [186, 187],
+ loc: {
+ start: { column: 11, line: 8 },
+ end: { column: 12, line: 8 },
+ },
+ },
+
+ range: [177, 188],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 13, line: 8 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '4',
+ value: 4,
+
+ range: [189, 190],
+ loc: {
+ start: { column: 14, line: 8 },
+ end: { column: 15, line: 8 },
+ },
+ },
+
+ range: [177, 191],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
+
+ range: [177, 191],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
+
+ range: [177, 192],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 17, line: 8 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [195, 198],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 5, line: 9 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '2',
+ value: 2,
+
+ range: [199, 200],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 7, line: 9 },
+ },
+ },
+
+ range: [195, 201],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 8, line: 9 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '3',
+ value: 3,
+
+ range: [204, 205],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 12, line: 9 },
+ },
+ },
+
+ range: [195, 206],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 13, line: 9 },
+ },
+ },
+ optional: true,
+ property: Literal {
+ type: 'Literal',
+ raw: '4',
+ value: 4,
+
+ range: [209, 210],
+ loc: {
+ start: { column: 16, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+
+ range: [195, 211],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 18, line: 9 },
+ },
+ },
+
+ range: [195, 211],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 18, line: 9 },
+ },
+ },
+
+ range: [195, 212],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 19, line: 9 },
+ },
+ },
+ ],
+
+ range: [116, 214],
+ loc: {
+ start: { column: 43, line: 3 },
+ end: { column: 1, line: 10 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processOptionalElement',
+- optional: false,
+
+ range: [82, 104],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [111, 114],
+ loc: {
+ start: { column: 38, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+
+ range: [109, 114],
+ loc: {
+ start: { column: 36, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+
+ range: [105, 114],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 214],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 215],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 11 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/1-TSESTree-AST.shot
index 43dc0c615f91..3b2dc4240ebf 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [113, 116],
loc: {
@@ -35,7 +37,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [118, 121],
loc: {
@@ -60,7 +64,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [123, 128],
loc: {
@@ -103,7 +109,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [133, 136],
loc: {
@@ -114,7 +122,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [138, 141],
loc: {
@@ -146,7 +156,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [144, 149],
loc: {
@@ -182,7 +194,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [154, 157],
loc: {
@@ -193,7 +207,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [159, 162],
loc: {
@@ -225,7 +241,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [165, 170],
loc: {
@@ -255,11 +273,14 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processOptional",
+ optional: false,
range: [82, 97],
loc: {
@@ -270,6 +291,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
optional: true,
typeAnnotation: TSTypeAnnotation {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot
index 633b2b7bf601..f8f7fba79fd2 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,342 @@
exports[`AST Fixtures legacy-fixtures basics optional-chain-with-non-null-assertion AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [113, 116],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [118, 121],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [113, 121],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [113, 122],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [123, 128],
+ loc: {
+ start: { column: 12, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+
+ range: [113, 128],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+
+ range: [113, 128],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+
+ range: [113, 129],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 18, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [133, 136],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 6, line: 5 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [138, 141],
+ loc: {
+ start: { column: 8, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+
+ range: [133, 141],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+
+ range: [133, 141],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+
+ range: [132, 143],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 13, line: 5 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [144, 149],
+ loc: {
+ start: { column: 14, line: 5 },
+ end: { column: 19, line: 5 },
+ },
+ },
+
+ range: [132, 149],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 19, line: 5 },
+ },
+ },
+
+ range: [132, 150],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 20, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: TSNonNullExpression {
+ type: 'TSNonNullExpression',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [154, 157],
+ loc: {
+ start: { column: 3, line: 6 },
+ end: { column: 6, line: 6 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [159, 162],
+ loc: {
+ start: { column: 8, line: 6 },
+ end: { column: 11, line: 6 },
+ },
+ },
+
+ range: [154, 162],
+ loc: {
+ start: { column: 3, line: 6 },
+ end: { column: 11, line: 6 },
+ },
+ },
+
+ range: [154, 162],
+ loc: {
+ start: { column: 3, line: 6 },
+ end: { column: 11, line: 6 },
+ },
+ },
+
+ range: [153, 164],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 13, line: 6 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [165, 170],
+ loc: {
+ start: { column: 14, line: 6 },
+ end: { column: 19, line: 6 },
+ },
+ },
+
+ range: [153, 170],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 19, line: 6 },
+ },
+ },
+
+ range: [153, 171],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 20, line: 6 },
+ },
+ },
+ ],
+
+ range: [109, 173],
+ loc: {
+ start: { column: 36, line: 3 },
+ end: { column: 1, line: 7 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processOptional',
+- optional: false,
+
+ range: [82, 97],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [104, 107],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [102, 107],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [98, 107],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 173],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 7 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 174],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 8 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/1-TSESTree-AST.shot
index c664c59e267c..5f4d6fcc648e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/1-TSESTree-AST.shot
@@ -19,7 +19,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [119, 122],
loc: {
@@ -30,7 +32,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [124, 127],
loc: {
@@ -71,7 +75,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [132, 135],
loc: {
@@ -82,7 +88,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [137, 140],
loc: {
@@ -107,7 +115,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [142, 147],
loc: {
@@ -141,7 +151,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [151, 154],
loc: {
@@ -152,7 +164,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [155, 158],
loc: {
@@ -170,7 +184,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [160, 165],
loc: {
@@ -214,7 +230,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [170, 173],
loc: {
@@ -225,7 +243,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [174, 177],
loc: {
@@ -243,7 +263,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [179, 184],
loc: {
@@ -268,7 +290,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "four",
+ optional: false,
range: [186, 190],
loc: {
@@ -305,7 +329,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [194, 197],
loc: {
@@ -316,7 +342,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [198, 201],
loc: {
@@ -334,7 +362,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [203, 208],
loc: {
@@ -352,7 +382,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "four",
+ optional: false,
range: [210, 214],
loc: {
@@ -399,7 +431,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [219, 222],
loc: {
@@ -410,7 +444,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [223, 226],
loc: {
@@ -428,7 +464,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [228, 233],
loc: {
@@ -446,7 +484,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "four",
+ optional: false,
range: [235, 239],
loc: {
@@ -471,7 +511,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "five",
+ optional: false,
range: [241, 245],
loc: {
@@ -501,11 +543,14 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processOptionalParens",
+ optional: false,
range: [82, 103],
loc: {
@@ -516,6 +561,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
optional: true,
typeAnnotation: TSTypeAnnotation {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/5-AST-Alignment-AST.shot
index 1b2f2b793759..9641828c0eb7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain-with-parens/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,612 @@
exports[`AST Fixtures legacy-fixtures basics optional-chain-with-parens AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [119, 122],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [124, 127],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [119, 127],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [119, 127],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [119, 128],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [132, 135],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 6, line: 5 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [137, 140],
+ loc: {
+ start: { column: 8, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+
+ range: [132, 140],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+
+ range: [132, 140],
+ loc: {
+ start: { column: 3, line: 5 },
+ end: { column: 11, line: 5 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [142, 147],
+ loc: {
+ start: { column: 13, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+
+ range: [131, 147],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+
+ range: [131, 148],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 19, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [151, 154],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 5, line: 6 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [155, 158],
+ loc: {
+ start: { column: 6, line: 6 },
+ end: { column: 9, line: 6 },
+ },
+ },
+
+ range: [151, 158],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 9, line: 6 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [160, 165],
+ loc: {
+ start: { column: 11, line: 6 },
+ end: { column: 16, line: 6 },
+ },
+ },
+
+ range: [151, 165],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 16, line: 6 },
+ },
+ },
+
+ range: [151, 165],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 16, line: 6 },
+ },
+ },
+
+ range: [151, 166],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 17, line: 6 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [170, 173],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 6, line: 7 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [174, 177],
+ loc: {
+ start: { column: 7, line: 7 },
+ end: { column: 10, line: 7 },
+ },
+ },
+
+ range: [170, 177],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 10, line: 7 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [179, 184],
+ loc: {
+ start: { column: 12, line: 7 },
+ end: { column: 17, line: 7 },
+ },
+ },
+
+ range: [170, 184],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 17, line: 7 },
+ },
+ },
+
+ range: [170, 184],
+ loc: {
+ start: { column: 3, line: 7 },
+ end: { column: 17, line: 7 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'four',
+- optional: false,
+
+ range: [186, 190],
+ loc: {
+ start: { column: 19, line: 7 },
+ end: { column: 23, line: 7 },
+ },
+ },
+
+ range: [169, 190],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 23, line: 7 },
+ },
+ },
+
+ range: [169, 191],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 24, line: 7 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [194, 197],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 5, line: 8 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [198, 201],
+ loc: {
+ start: { column: 6, line: 8 },
+ end: { column: 9, line: 8 },
+ },
+ },
+
+ range: [194, 201],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 9, line: 8 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [203, 208],
+ loc: {
+ start: { column: 11, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
+
+ range: [194, 208],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'four',
+- optional: false,
+
+ range: [210, 214],
+ loc: {
+ start: { column: 18, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [194, 214],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [194, 214],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [194, 215],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 23, line: 8 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [219, 222],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 6, line: 9 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [223, 226],
+ loc: {
+ start: { column: 7, line: 9 },
+ end: { column: 10, line: 9 },
+ },
+ },
+
+ range: [219, 226],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 10, line: 9 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [228, 233],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+
+ range: [219, 233],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'four',
+- optional: false,
+
+ range: [235, 239],
+ loc: {
+ start: { column: 19, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+
+ range: [219, 239],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+
+ range: [219, 239],
+ loc: {
+ start: { column: 3, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'five',
+- optional: false,
+
+ range: [241, 245],
+ loc: {
+ start: { column: 25, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+
+ range: [218, 245],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+
+ range: [218, 246],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ ],
+
+ range: [115, 248],
+ loc: {
+ start: { column: 42, line: 3 },
+ end: { column: 1, line: 10 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processOptionalParens',
+- optional: false,
+
+ range: [82, 103],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 30, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [110, 113],
+ loc: {
+ start: { column: 37, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+
+ range: [108, 113],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+
+ range: [104, 113],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 248],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 249],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 11 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/1-TSESTree-AST.shot
index f45a86301ab5..eb382a40c48b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/1-TSESTree-AST.shot
@@ -19,7 +19,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [113, 116],
loc: {
@@ -30,7 +32,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [118, 121],
loc: {
@@ -71,7 +75,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [125, 128],
loc: {
@@ -82,7 +88,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [130, 133],
loc: {
@@ -100,7 +108,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [134, 139],
loc: {
@@ -141,7 +151,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [143, 146],
loc: {
@@ -152,7 +164,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [147, 150],
loc: {
@@ -170,7 +184,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [152, 157],
loc: {
@@ -214,7 +230,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [161, 164],
loc: {
@@ -225,7 +243,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [165, 168],
loc: {
@@ -243,7 +263,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [170, 175],
loc: {
@@ -261,7 +283,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "four",
+ optional: false,
range: [176, 180],
loc: {
@@ -305,7 +329,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
+ optional: false,
range: [184, 187],
loc: {
@@ -316,7 +342,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "two",
+ optional: false,
range: [188, 191],
loc: {
@@ -334,7 +362,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "three",
+ optional: false,
range: [193, 198],
loc: {
@@ -352,7 +382,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "four",
+ optional: false,
range: [200, 204],
loc: {
@@ -389,11 +421,14 @@ Program {
end: { column: 1, line: 9 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "processOptional",
+ optional: false,
range: [82, 97],
loc: {
@@ -404,6 +439,7 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "one",
optional: true,
typeAnnotation: TSTypeAnnotation {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/5-AST-Alignment-AST.shot
index 92619481bec0..591495e977f0 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/optional-chain/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,490 @@
exports[`AST Fixtures legacy-fixtures basics optional-chain AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [113, 116],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [118, 121],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [113, 121],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [113, 121],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+
+ range: [113, 122],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [125, 128],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [130, 133],
+ loc: {
+ start: { column: 7, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+
+ range: [125, 133],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [134, 139],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 16, line: 5 },
+ },
+ },
+
+ range: [125, 139],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 16, line: 5 },
+ },
+ },
+
+ range: [125, 139],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 16, line: 5 },
+ },
+ },
+
+ range: [125, 140],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [143, 146],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 5, line: 6 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [147, 150],
+ loc: {
+ start: { column: 6, line: 6 },
+ end: { column: 9, line: 6 },
+ },
+ },
+
+ range: [143, 150],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 9, line: 6 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [152, 157],
+ loc: {
+ start: { column: 11, line: 6 },
+ end: { column: 16, line: 6 },
+ },
+ },
+
+ range: [143, 157],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 16, line: 6 },
+ },
+ },
+
+ range: [143, 157],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 16, line: 6 },
+ },
+ },
+
+ range: [143, 158],
+ loc: {
+ start: { column: 2, line: 6 },
+ end: { column: 17, line: 6 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [161, 164],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 5, line: 7 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [165, 168],
+ loc: {
+ start: { column: 6, line: 7 },
+ end: { column: 9, line: 7 },
+ },
+ },
+
+ range: [161, 168],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 9, line: 7 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [170, 175],
+ loc: {
+ start: { column: 11, line: 7 },
+ end: { column: 16, line: 7 },
+ },
+ },
+
+ range: [161, 175],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 16, line: 7 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'four',
+- optional: false,
+
+ range: [176, 180],
+ loc: {
+ start: { column: 17, line: 7 },
+ end: { column: 21, line: 7 },
+ },
+ },
+
+ range: [161, 180],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 21, line: 7 },
+ },
+ },
+
+ range: [161, 180],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 21, line: 7 },
+ },
+ },
+
+ range: [161, 181],
+ loc: {
+ start: { column: 2, line: 7 },
+ end: { column: 22, line: 7 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+- optional: false,
+
+ range: [184, 187],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 5, line: 8 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'two',
+- optional: false,
+
+ range: [188, 191],
+ loc: {
+ start: { column: 6, line: 8 },
+ end: { column: 9, line: 8 },
+ },
+ },
+
+ range: [184, 191],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 9, line: 8 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'three',
+- optional: false,
+
+ range: [193, 198],
+ loc: {
+ start: { column: 11, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
+
+ range: [184, 198],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'four',
+- optional: false,
+
+ range: [200, 204],
+ loc: {
+ start: { column: 18, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [184, 204],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [184, 204],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 22, line: 8 },
+ },
+ },
+
+ range: [184, 205],
+ loc: {
+ start: { column: 2, line: 8 },
+ end: { column: 23, line: 8 },
+ },
+ },
+ ],
+
+ range: [109, 207],
+ loc: {
+ start: { column: 36, line: 3 },
+ end: { column: 1, line: 9 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'processOptional',
+- optional: false,
+
+ range: [82, 97],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'one',
+ optional: true,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [104, 107],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [102, 107],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [98, 107],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 207],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 9 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 208],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 10 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/1-TSESTree-AST.shot
index 6b02a892b82d..a48d2ed4cb38 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,6 +14,8 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: PrivateIdentifier {
type: "PrivateIdentifier",
name: "prop1",
@@ -23,7 +26,9 @@ Program {
end: { column: 8, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -36,9 +41,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "method",
+ optional: false,
range: [97, 103],
loc: {
@@ -47,6 +55,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -72,7 +81,9 @@ Program {
operator: "in",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "arg",
+ optional: false,
range: [132, 135],
loc: {
@@ -102,13 +113,16 @@ Program {
end: { column: 3, line: 7 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "arg",
+ optional: false,
range: [104, 107],
loc: {
@@ -139,9 +153,13 @@ Program {
end: { column: 1, line: 8 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -149,6 +167,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 142],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/5-AST-Alignment-AST.shot
index 5d3082bbb161..95abc2ac1223 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/private-fields-in-in/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,6 +18,8 @@ exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: PrivateIdentifier {
type: 'PrivateIdentifier',
name: 'prop1',
@@ -27,7 +30,9 @@ exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment
end: { column: 8, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -40,9 +45,12 @@ exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'method',
+- optional: false,
range: [97, 103],
loc: {
@@ -51,6 +59,7 @@ exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -76,7 +85,9 @@ exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment
operator: 'in',
right: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'arg',
+- optional: false,
range: [132, 135],
loc: {
@@ -106,13 +117,16 @@ exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment
end: { column: 3, line: 7 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'arg',
+- optional: false,
range: [104, 107],
loc: {
@@ -143,9 +157,13 @@ exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment
end: { column: 1, line: 8 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -153,6 +171,7 @@ exports[`AST Fixtures legacy-fixtures basics private-fields-in-in AST Alignment
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 142],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot
index c124f4f8825e..ede389b531ee 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/1-TSESTree-AST.shot
@@ -20,7 +20,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "arr",
+ optional: false,
range: [118, 121],
loc: {
@@ -31,7 +33,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "slice",
+ optional: false,
range: [122, 127],
loc: {
@@ -83,7 +87,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "arr",
+ optional: false,
range: [141, 144],
loc: {
@@ -94,7 +100,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "push",
+ optional: false,
range: [145, 149],
loc: {
@@ -132,11 +140,14 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [82, 85],
loc: {
@@ -147,22 +158,14 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "arr",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "ReadonlyArray",
-
- range: [91, 104],
- loc: {
- start: { column: 18, line: 3 },
- end: { column: 31, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSStringKeyword {
@@ -182,6 +185,18 @@ Program {
end: { column: 39, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "ReadonlyArray",
+ optional: false,
+
+ range: [91, 104],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
range: [91, 112],
loc: {
@@ -227,7 +242,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "arr",
+ optional: false,
range: [215, 218],
loc: {
@@ -238,7 +255,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "slice",
+ optional: false,
range: [219, 224],
loc: {
@@ -290,7 +309,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "arr",
+ optional: false,
range: [238, 241],
loc: {
@@ -301,7 +322,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "push",
+ optional: false,
range: [242, 246],
loc: {
@@ -339,11 +362,14 @@ Program {
end: { column: 1, line: 11 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [183, 186],
loc: {
@@ -354,7 +380,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "arr",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeOperator {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot
index 8dceef593436..37073223f853 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-arrays/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,461 @@
exports[`AST Fixtures legacy-fixtures basics readonly-arrays AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'arr',
+- optional: false,
+
+ range: [118, 121],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'slice',
+- optional: false,
+
+ range: [122, 127],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+
+ range: [118, 127],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+ optional: false,
+
+ range: [118, 129],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 13, line: 4 },
+ },
+ },
+
+ range: [118, 130],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [
+ Literal {
+ type: 'Literal',
+ raw: '\\'hello!\\'',
+ value: 'hello!',
+
+ range: [150, 158],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 19, line: 5 },
+ },
+ },
+ ],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'arr',
+- optional: false,
+
+ range: [141, 144],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'push',
+- optional: false,
+
+ range: [145, 149],
+ loc: {
+ start: { column: 6, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+
+ range: [141, 149],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+ optional: false,
+
+ range: [141, 159],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 20, line: 5 },
+ },
+ },
+
+ range: [141, 160],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 21, line: 5 },
+ },
+ },
+ ],
+
+ range: [114, 172],
+ loc: {
+ start: { column: 41, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [82, 85],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'arr',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'ReadonlyArray',
++
++ range: [91, 104],
++ loc: {
++ start: { column: 18, line: 3 },
++ end: { column: 31, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [105, 111],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+ ],
+
+ range: [104, 112],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 39, line: 3 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'ReadonlyArray',
+- optional: false,
+-
+- range: [91, 104],
+- loc: {
+- start: { column: 18, line: 3 },
+- end: { column: 31, line: 3 },
+ },
+ },
+
+ range: [91, 112],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 39, line: 3 },
+ },
+ },
+
+ range: [89, 112],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 39, line: 3 },
+ },
+ },
+
+ range: [86, 112],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 39, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 172],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'arr',
+- optional: false,
+
+ range: [215, 218],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 5, line: 9 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'slice',
+- optional: false,
+
+ range: [219, 224],
+ loc: {
+ start: { column: 6, line: 9 },
+ end: { column: 11, line: 9 },
+ },
+ },
+
+ range: [215, 224],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 11, line: 9 },
+ },
+ },
+ optional: false,
+
+ range: [215, 226],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 13, line: 9 },
+ },
+ },
+
+ range: [215, 227],
+ loc: {
+ start: { column: 2, line: 9 },
+ end: { column: 14, line: 9 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [
+ Literal {
+ type: 'Literal',
+ raw: '\\'hello!\\'',
+ value: 'hello!',
+
+ range: [247, 255],
+ loc: {
+ start: { column: 11, line: 10 },
+ end: { column: 19, line: 10 },
+ },
+ },
+ ],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'arr',
+- optional: false,
+
+ range: [238, 241],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 5, line: 10 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'push',
+- optional: false,
+
+ range: [242, 246],
+ loc: {
+ start: { column: 6, line: 10 },
+ end: { column: 10, line: 10 },
+ },
+ },
+
+ range: [238, 246],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 10, line: 10 },
+ },
+ },
+ optional: false,
+
+ range: [238, 256],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 20, line: 10 },
+ },
+ },
+
+ range: [238, 257],
+ loc: {
+ start: { column: 2, line: 10 },
+ end: { column: 21, line: 10 },
+ },
+ },
+ ],
+
+ range: [211, 269],
+ loc: {
+ start: { column: 37, line: 8 },
+ end: { column: 1, line: 11 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [183, 186],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 12, line: 8 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'arr',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeOperator {
+ type: 'TSTypeOperator',
+ operator: 'readonly',
+ typeAnnotation: TSArrayType {
+ type: 'TSArrayType',
+ elementType: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [201, 207],
+ loc: {
+ start: { column: 27, line: 8 },
+ end: { column: 33, line: 8 },
+ },
+ },
+
+ range: [201, 209],
+ loc: {
+ start: { column: 27, line: 8 },
+ end: { column: 35, line: 8 },
+ },
+ },
+
+ range: [192, 209],
+ loc: {
+ start: { column: 18, line: 8 },
+ end: { column: 35, line: 8 },
+ },
+ },
+
+ range: [190, 209],
+ loc: {
+ start: { column: 16, line: 8 },
+ end: { column: 35, line: 8 },
+ },
+ },
+
+ range: [187, 209],
+ loc: {
+ start: { column: 13, line: 8 },
+ end: { column: 35, line: 8 },
+ },
+ },
+ ],
+
+ range: [174, 269],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 1, line: 11 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 270],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 12 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/1-TSESTree-AST.shot
index 48119b57c755..e732d7e72252 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/1-TSESTree-AST.shot
@@ -20,7 +20,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "pair",
+ optional: false,
range: [135, 139],
loc: {
@@ -53,7 +55,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "console",
+ optional: false,
range: [123, 130],
loc: {
@@ -64,7 +68,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "log",
+ optional: false,
range: [131, 134],
loc: {
@@ -103,7 +109,9 @@ Program {
computed: true,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "pair",
+ optional: false,
range: [155, 159],
loc: {
@@ -164,11 +172,14 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [82, 85],
loc: {
@@ -179,7 +190,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "pair",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeOperator {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/5-AST-Alignment-AST.shot
index 19033edfa0d6..7a8ca30ac4fb 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/readonly-tuples/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,271 @@
exports[`AST Fixtures legacy-fixtures basics readonly-tuples AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [
+ MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'pair',
+- optional: false,
+
+ range: [135, 139],
+ loc: {
+ start: { column: 14, line: 4 },
+ end: { column: 18, line: 4 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '0',
+ value: 0,
+
+ range: [140, 141],
+ loc: {
+ start: { column: 19, line: 4 },
+ end: { column: 20, line: 4 },
+ },
+ },
+
+ range: [135, 142],
+ loc: {
+ start: { column: 14, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+ ],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'console',
+- optional: false,
+
+ range: [123, 130],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ optional: false,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'log',
+- optional: false,
+
+ range: [131, 134],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 13, line: 4 },
+ },
+ },
+
+ range: [123, 134],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 13, line: 4 },
+ },
+ },
+ optional: false,
+
+ range: [123, 143],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 22, line: 4 },
+ },
+ },
+
+ range: [123, 144],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 23, line: 4 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AssignmentExpression {
+ type: 'AssignmentExpression',
+ left: MemberExpression {
+ type: 'MemberExpression',
+ computed: true,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'pair',
+- optional: false,
+
+ range: [155, 159],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 6, line: 5 },
+ },
+ },
+ optional: false,
+ property: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [160, 161],
+ loc: {
+ start: { column: 7, line: 5 },
+ end: { column: 8, line: 5 },
+ },
+ },
+
+ range: [155, 162],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ operator: '=',
+ right: Literal {
+ type: 'Literal',
+ raw: '\\'hello!\\'',
+ value: 'hello!',
+
+ range: [165, 173],
+ loc: {
+ start: { column: 12, line: 5 },
+ end: { column: 20, line: 5 },
+ },
+ },
+
+ range: [155, 173],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 20, line: 5 },
+ },
+ },
+
+ range: [155, 174],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 21, line: 5 },
+ },
+ },
+ ],
+
+ range: [119, 185],
+ loc: {
+ start: { column: 46, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [82, 85],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'pair',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeOperator {
+ type: 'TSTypeOperator',
+ operator: 'readonly',
+ typeAnnotation: TSTupleType {
+ type: 'TSTupleType',
+ elementTypes: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [102, 108],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 35, line: 3 },
+ },
+ },
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [110, 116],
+ loc: {
+ start: { column: 37, line: 3 },
+ end: { column: 43, line: 3 },
+ },
+ },
+ ],
+
+ range: [101, 117],
+ loc: {
+ start: { column: 28, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+
+ range: [92, 117],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+
+ range: [90, 117],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+
+ range: [86, 117],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 44, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 185],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 186],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 7 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/1-TSESTree-AST.shot
index c48fbc7c676c..f4dec558585d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/1-TSESTree-AST.shot
@@ -10,7 +10,9 @@ Program {
type: "AssignmentExpression",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [73, 74],
loc: {
@@ -21,7 +23,9 @@ Program {
operator: "||=",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [79, 80],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/5-AST-Alignment-AST.shot
index 75095e768945..99a21d3bb106 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,62 @@
exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-and-and AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AssignmentExpression {
+ type: 'AssignmentExpression',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [73, 74],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ operator: '||=',
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [79, 80],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+
+ range: [73, 80],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+
+ range: [73, 81],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 82],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/1-TSESTree-AST.shot
index 070ffd82aed6..98d155ef7a65 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/1-TSESTree-AST.shot
@@ -10,7 +10,9 @@ Program {
type: "AssignmentExpression",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [73, 74],
loc: {
@@ -21,7 +23,9 @@ Program {
operator: "&&=",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [79, 80],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/5-AST-Alignment-AST.shot
index 99034f0c6828..29af92758037 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,62 @@
exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-or-or AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AssignmentExpression {
+ type: 'AssignmentExpression',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [73, 74],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ operator: '&&=',
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [79, 80],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+
+ range: [73, 80],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+
+ range: [73, 81],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 82],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/1-TSESTree-AST.shot
index 23a4dbc9f5dc..eb7bd2162c67 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/1-TSESTree-AST.shot
@@ -10,7 +10,9 @@ Program {
type: "AssignmentExpression",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [73, 74],
loc: {
@@ -21,7 +23,9 @@ Program {
operator: "??=",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [79, 80],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/5-AST-Alignment-AST.shot
index 225b4642d6d4..d54020e37f4e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,62 @@
exports[`AST Fixtures legacy-fixtures basics short-circuiting-assignment-question-question AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: AssignmentExpression {
+ type: 'AssignmentExpression',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [73, 74],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ operator: '??=',
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [79, 80],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+
+ range: [73, 80],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+
+ range: [73, 81],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 82],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot
index 1e534994de5d..8214d0f3e51f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 42, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "test",
+ optional: false,
range: [82, 86],
loc: {
@@ -32,22 +35,14 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "abc",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Map",
-
- range: [92, 95],
- loc: {
- start: { column: 19, line: 3 },
- end: { column: 22, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSSymbolKeyword {
@@ -76,6 +71,18 @@ Program {
end: { column: 38, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Map",
+ optional: false,
+
+ range: [92, 95],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
range: [92, 111],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot
index e99b60c13e31..b6d43bac4df8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/symbol-type-param/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,138 @@
exports[`AST Fixtures legacy-fixtures basics symbol-type-param AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [],
+
+ range: [113, 115],
+ loc: {
+ start: { column: 40, line: 3 },
+ end: { column: 42, line: 3 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'test',
+- optional: false,
+
+ range: [82, 86],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'abc',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Map',
++
++ range: [92, 95],
++ loc: {
++ start: { column: 19, line: 3 },
++ end: { column: 22, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSSymbolKeyword {
+ type: 'TSSymbolKeyword',
+
+ range: [96, 102],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [104, 110],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 37, line: 3 },
+ },
+ },
+ ],
+
+ range: [95, 111],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 38, line: 3 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Map',
+- optional: false,
+-
+- range: [92, 95],
+- loc: {
+- start: { column: 19, line: 3 },
+- end: { column: 22, line: 3 },
+ },
+ },
+
+ range: [92, 111],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [90, 111],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [87, 111],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 115],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 42, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 116],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot
index 3b59325ddb61..a08cd544ed36 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
assertions: [],
declaration: TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "TestCallback",
+ optional: false,
range: [85, 97],
loc: {
@@ -24,7 +27,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot
index 80b2ec22efdf..616277e27e35 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-funct
assertions: Array [],
declaration: TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'TestCallback',
+- optional: false,
range: [85, 97],
loc: {
@@ -29,7 +32,9 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-funct
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot
index f58fd04a8c55..de0e8827cce7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
assertions: [],
declaration: TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "TestClassProps",
+ optional: false,
range: [85, 99],
loc: {
@@ -27,7 +30,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "count",
+ optional: false,
range: [106, 111],
loc: {
@@ -35,6 +40,9 @@ Program {
end: { column: 7, line: 4 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot
index c5fc765d0c2f..9f9b094633b9 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-objec
assertions: Array [],
declaration: TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'TestClassProps',
+- optional: false,
range: [85, 99],
loc: {
@@ -31,7 +34,9 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-objec
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'count',
+- optional: false,
range: [106, 111],
loc: {
@@ -39,6 +44,9 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export-objec
end: { column: 7, line: 4 },
},
},
+- optional: false,
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot
index 861f3c6fc676..ffe2ae38c04d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
assertions: [],
declaration: TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "TestAlias",
+ optional: false,
range: [85, 94],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot
index c9403c51801f..a36c1ee31daa 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-export/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-export AST A
assertions: Array [],
declaration: TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'TestAlias',
+- optional: false,
range: [85, 94],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot
index c9e307bfb339..1dcb35459788 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Result",
+ optional: false,
range: [78, 84],
loc: {
@@ -21,24 +24,16 @@ Program {
types: [
TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Success",
-
- range: [101, 108],
- loc: {
- start: { column: 28, line: 3 },
- end: { column: 35, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [109, 110],
loc: {
@@ -61,6 +56,18 @@ Program {
end: { column: 38, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Success",
+ optional: false,
+
+ range: [101, 108],
+ loc: {
+ start: { column: 28, line: 3 },
+ end: { column: 35, line: 3 },
+ },
+ },
range: [101, 111],
loc: {
@@ -72,7 +79,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Failure",
+ optional: false,
range: [114, 121],
loc: {
@@ -114,7 +123,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [85, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot
index e451c313454b..0ebd18b65e0a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Result',
+- optional: false,
range: [78, 84],
loc: {
@@ -25,24 +28,27 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra
types: Array [
TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'Success',
-
- range: [101, 108],
- loc: {
- start: { column: 28, line: 3 },
- end: { column: 35, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Success',
++
++ range: [101, 108],
++ loc: {
++ start: { column: 28, line: 3 },
++ end: { column: 35, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [109, 110],
loc: {
@@ -65,7 +71,19 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra
end: { column: 38, line: 3 },
},
},
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Success',
+- optional: false,
+- range: [101, 108],
+- loc: {
+- start: { column: 28, line: 3 },
+- end: { column: 35, line: 3 },
+- },
+- },
+-
range: [101, 111],
loc: {
start: { column: 28, line: 3 },
@@ -76,7 +94,9 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Failure',
+- optional: false,
range: [114, 121],
loc: {
@@ -118,7 +138,9 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration-with-constra
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [85, 86],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot
index 8175a87d5b0a..7b87092ccd2c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Result",
+ optional: false,
range: [78, 84],
loc: {
@@ -21,24 +24,16 @@ Program {
types: [
TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Success",
-
- range: [90, 97],
- loc: {
- start: { column: 17, line: 3 },
- end: { column: 24, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [98, 99],
loc: {
@@ -61,6 +56,18 @@ Program {
end: { column: 27, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Success",
+ optional: false,
+
+ range: [90, 97],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
range: [90, 100],
loc: {
@@ -72,7 +79,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Failure",
+ optional: false,
range: [103, 110],
loc: {
@@ -104,7 +113,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [85, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot
index 95d18c2f62ca..d4dec2c54de2 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-declaration/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Result',
+- optional: false,
range: [78, 84],
loc: {
@@ -25,24 +28,27 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen
types: Array [
TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'Success',
-
- range: [90, 97],
- loc: {
- start: { column: 17, line: 3 },
- end: { column: 24, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Success',
++
++ range: [90, 97],
++ loc: {
++ start: { column: 17, line: 3 },
++ end: { column: 24, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [98, 99],
loc: {
@@ -65,7 +71,19 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen
end: { column: 27, line: 3 },
},
},
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Success',
+- optional: false,
+- range: [90, 97],
+- loc: {
+- start: { column: 17, line: 3 },
+- end: { column: 24, line: 3 },
+- },
+- },
+-
range: [90, 100],
loc: {
start: { column: 17, line: 3 },
@@ -76,7 +94,9 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Failure',
+- optional: false,
range: [103, 110],
loc: {
@@ -108,7 +128,9 @@ exports[`AST Fixtures legacy-fixtures basics type-alias-declaration AST Alignmen
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [85, 86],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/1-TSESTree-AST.shot
index 8daa9d702f4d..b1b63f207b7e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -24,7 +27,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [86, 89],
loc: {
@@ -32,6 +37,9 @@ Program {
end: { column: 16, line: 3 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -62,7 +70,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [99, 102],
loc: {
@@ -70,6 +80,9 @@ Program {
end: { column: 29, line: 3 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
range: [99, 102],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/5-AST-Alignment-AST.shot
index f7ab811dca3e..21231297b435 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,120 @@
exports[`AST Fixtures legacy-fixtures basics type-alias-object-without-annotation AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeLiteral {
+ type: 'TSTypeLiteral',
+ members: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [86, 89],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [91, 97],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+
+ range: [89, 97],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+
+ range: [86, 98],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 25, line: 3 },
+ },
+ },
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'baz',
+- optional: false,
+
+ range: [99, 102],
+ loc: {
+ start: { column: 26, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+
+ range: [99, 102],
+ loc: {
+ start: { column: 26, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ ],
+
+ range: [84, 104],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+
+ range: [73, 105],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 106],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/1-TSESTree-AST.shot
index eaa25a49229b..53498ed9f950 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "assertString",
+ optional: false,
range: [79, 91],
loc: {
@@ -49,7 +52,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
@@ -83,7 +88,9 @@ Program {
asserts: true,
parameterName: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [112, 113],
loc: {
@@ -121,6 +128,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [73, 131],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/5-AST-Alignment-AST.shot
index db812258aefc..960bd95fdf52 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,152 @@
exports[`AST Fixtures legacy-fixtures basics type-assertion-in-arrow-function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'assertString',
+- optional: false,
+
+ range: [79, 91],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ init: ArrowFunctionExpression {
+ type: 'ArrowFunctionExpression',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: null,
+
+ range: [121, 128],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ ],
+
+ range: [117, 130],
+ loc: {
+ start: { column: 44, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ expression: false,
+ generator: false,
+ id: null,
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [98, 101],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+
+ range: [96, 101],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+
+ range: [95, 101],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypePredicate {
+ type: 'TSTypePredicate',
+ asserts: true,
+ parameterName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [112, 113],
+ loc: {
+ start: { column: 39, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+ typeAnnotation: null,
+
+ range: [104, 113],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+
+ range: [102, 113],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+
+ range: [94, 130],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+
+ range: [79, 130],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [73, 131],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 2, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 132],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/1-TSESTree-AST.shot
index 6831aafee65d..4db97e141193 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/1-TSESTree-AST.shot
@@ -28,11 +28,14 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "assertsString",
+ optional: false,
range: [82, 95],
loc: {
@@ -43,7 +46,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
@@ -77,7 +82,9 @@ Program {
asserts: true,
parameterName: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [113, 114],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/5-AST-Alignment-AST.shot
index ba5f295254cf..d3f432622b66 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-function/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,129 @@
exports[`AST Fixtures legacy-fixtures basics type-assertion-in-function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: null,
+
+ range: [119, 126],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ ],
+
+ range: [115, 128],
+ loc: {
+ start: { column: 42, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'assertsString',
+- optional: false,
+
+ range: [82, 95],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [99, 102],
+ loc: {
+ start: { column: 26, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+
+ range: [97, 102],
+ loc: {
+ start: { column: 24, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+
+ range: [96, 102],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypePredicate {
+ type: 'TSTypePredicate',
+ asserts: true,
+ parameterName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [113, 114],
+ loc: {
+ start: { column: 40, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+ typeAnnotation: null,
+
+ range: [105, 114],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+
+ range: [103, 114],
+ loc: {
+ start: { column: 30, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+
+ range: [73, 128],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 129],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/1-TSESTree-AST.shot
index 98a32fbd3473..e71b995c2407 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "isString",
+ optional: false,
range: [97, 105],
loc: {
@@ -23,10 +25,13 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "node",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
@@ -53,6 +58,7 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypePredicate {
@@ -60,7 +66,9 @@ Program {
asserts: true,
parameterName: Identifier {
type: "Identifier",
+ decorators: [],
name: "node",
+ optional: false,
range: [126, 130],
loc: {
@@ -83,6 +91,7 @@ Program {
end: { column: 35, line: 4 },
},
},
+ static: false,
range: [97, 131],
loc: {
@@ -98,9 +107,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "AssertFoo",
+ optional: false,
range: [83, 92],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/5-AST-Alignment-AST.shot
index 3b65ab51b591..867fc42b1d11 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-interface/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface AST Ali
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'isString',
+- optional: false,
range: [97, 105],
loc: {
@@ -27,11 +29,14 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface AST Ali
},
},
kind: 'method',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'node',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSAnyKeyword {
@@ -58,6 +63,7 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface AST Ali
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -66,7 +72,9 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface AST Ali
asserts: true,
parameterName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'node',
+- optional: false,
range: [126, 130],
loc: {
@@ -89,6 +97,7 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface AST Ali
end: { column: 35, line: 4 },
},
},
+- static: false,
range: [97, 131],
loc: {
@@ -104,9 +113,13 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-interface AST Ali
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'AssertFoo',
+- optional: false,
range: [83, 92],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/1-TSESTree-AST.shot
index 767424fd8632..210e38644ee0 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "isBar",
+ optional: false,
range: [94, 99],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -49,6 +54,7 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -100,9 +106,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "isBaz",
+ optional: false,
range: [136, 141],
loc: {
@@ -110,7 +120,9 @@ Program {
end: { column: 7, line: 7 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: ArrowFunctionExpression {
type: "ArrowFunctionExpression",
@@ -191,9 +203,13 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "AssertsFoo",
+ optional: false,
range: [79, 89],
loc: {
@@ -201,6 +217,7 @@ Program {
end: { column: 16, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 184],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/5-AST-Alignment-AST.shot
index 198bf8d2a0ae..b416df4adadc 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-in-method/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method AST Alignm
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'isBar',
+- optional: false,
range: [94, 99],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method AST Alignm
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -53,6 +58,7 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method AST Alignm
end: { column: 3, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -104,9 +110,13 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method AST Alignm
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'isBaz',
+- optional: false,
range: [136, 141],
loc: {
@@ -114,7 +124,9 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method AST Alignm
end: { column: 7, line: 7 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: ArrowFunctionExpression {
type: 'ArrowFunctionExpression',
@@ -195,9 +207,13 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method AST Alignm
end: { column: 1, line: 10 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'AssertsFoo',
+- optional: false,
range: [79, 89],
loc: {
@@ -205,6 +221,7 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-in-method AST Alignm
end: { column: 16, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 184],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot
index 807e672b1f11..028e05648aa9 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "assertString",
+ optional: false,
range: [79, 91],
loc: {
@@ -49,7 +52,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
@@ -83,7 +88,9 @@ Program {
asserts: true,
parameterName: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [112, 113],
loc: {
@@ -138,6 +145,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [73, 141],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot
index c32f552cc736..09c0093329fd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,169 @@
exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-arrow-function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'assertString',
+- optional: false,
+
+ range: [79, 91],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ init: ArrowFunctionExpression {
+ type: 'ArrowFunctionExpression',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: null,
+
+ range: [131, 138],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ ],
+
+ range: [127, 140],
+ loc: {
+ start: { column: 54, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ expression: false,
+ generator: false,
+ id: null,
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [98, 101],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+
+ range: [96, 101],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+
+ range: [95, 101],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypePredicate {
+ type: 'TSTypePredicate',
+ asserts: true,
+ parameterName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [112, 113],
+ loc: {
+ start: { column: 39, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [117, 123],
+ loc: {
+ start: { column: 44, line: 3 },
+ end: { column: 50, line: 3 },
+ },
+ },
+
+ range: [117, 123],
+ loc: {
+ start: { column: 44, line: 3 },
+ end: { column: 50, line: 3 },
+ },
+ },
+
+ range: [104, 123],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 50, line: 3 },
+ },
+ },
+
+ range: [102, 123],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 50, line: 3 },
+ },
+ },
+
+ range: [94, 140],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+
+ range: [79, 140],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [73, 141],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 2, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 142],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/1-TSESTree-AST.shot
index b1e44ff5204f..d00951881160 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/1-TSESTree-AST.shot
@@ -28,11 +28,14 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "assertsStringGuard",
+ optional: false,
range: [82, 100],
loc: {
@@ -43,7 +46,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
@@ -77,7 +82,9 @@ Program {
asserts: true,
parameterName: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [118, 119],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/5-AST-Alignment-AST.shot
index f26ffee877f4..1604dae2c4b8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,146 @@
exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: null,
+
+ range: [134, 141],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ ],
+
+ range: [130, 143],
+ loc: {
+ start: { column: 57, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'assertsStringGuard',
+- optional: false,
+
+ range: [82, 100],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [104, 107],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [102, 107],
+ loc: {
+ start: { column: 29, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [101, 107],
+ loc: {
+ start: { column: 28, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypePredicate {
+ type: 'TSTypePredicate',
+ asserts: true,
+ parameterName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [118, 119],
+ loc: {
+ start: { column: 45, line: 3 },
+ end: { column: 46, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [123, 129],
+ loc: {
+ start: { column: 50, line: 3 },
+ end: { column: 56, line: 3 },
+ },
+ },
+
+ range: [123, 129],
+ loc: {
+ start: { column: 50, line: 3 },
+ end: { column: 56, line: 3 },
+ },
+ },
+
+ range: [110, 129],
+ loc: {
+ start: { column: 37, line: 3 },
+ end: { column: 56, line: 3 },
+ },
+ },
+
+ range: [108, 129],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 56, line: 3 },
+ },
+ },
+
+ range: [73, 143],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 144],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/1-TSESTree-AST.shot
index af78d362c211..762b8a17f8d9 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "isString",
+ optional: false,
range: [97, 105],
loc: {
@@ -23,10 +25,13 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "node",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
@@ -53,6 +58,7 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypePredicate {
@@ -60,7 +66,9 @@ Program {
asserts: true,
parameterName: Identifier {
type: "Identifier",
+ decorators: [],
name: "node",
+ optional: false,
range: [126, 130],
loc: {
@@ -100,6 +108,7 @@ Program {
end: { column: 45, line: 4 },
},
},
+ static: false,
range: [97, 141],
loc: {
@@ -115,9 +124,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "AssertFoo",
+ optional: false,
range: [83, 92],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/5-AST-Alignment-AST.shot
index c5d8b48f1753..196173c257bf 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interf
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'isString',
+- optional: false,
range: [97, 105],
loc: {
@@ -27,11 +29,14 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interf
},
},
kind: 'method',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'node',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSAnyKeyword {
@@ -58,6 +63,7 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interf
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -66,7 +72,9 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interf
asserts: true,
parameterName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'node',
+- optional: false,
range: [126, 130],
loc: {
@@ -106,6 +114,7 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interf
end: { column: 45, line: 4 },
},
},
+- static: false,
range: [97, 141],
loc: {
@@ -121,9 +130,13 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-interf
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'AssertFoo',
+- optional: false,
range: [83, 92],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/1-TSESTree-AST.shot
index dcbca050ea5c..0259325758f3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "isBar",
+ optional: false,
range: [94, 99],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -49,6 +54,7 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -117,9 +123,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "isBaz",
+ optional: false,
range: [146, 151],
loc: {
@@ -127,7 +137,9 @@ Program {
end: { column: 7, line: 7 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: ArrowFunctionExpression {
type: "ArrowFunctionExpression",
@@ -225,9 +237,13 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "AssertsFoo",
+ optional: false,
range: [79, 89],
loc: {
@@ -235,6 +251,7 @@ Program {
end: { column: 16, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 204],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/5-AST-Alignment-AST.shot
index 0477b699d6bf..38645b843ab8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'isBar',
+- optional: false,
range: [94, 99],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -53,6 +58,7 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method
end: { column: 3, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -121,9 +127,13 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'isBaz',
+- optional: false,
range: [146, 151],
loc: {
@@ -131,7 +141,9 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method
end: { column: 7, line: 7 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: ArrowFunctionExpression {
type: 'ArrowFunctionExpression',
@@ -229,9 +241,13 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method
end: { column: 1, line: 10 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'AssertsFoo',
+- optional: false,
range: [79, 89],
loc: {
@@ -239,6 +255,7 @@ exports[`AST Fixtures legacy-fixtures basics type-assertion-with-guard-in-method
end: { column: 16, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 204],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot
index 6450b0a1c009..d6489dbe4530 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "isString",
+ optional: false,
range: [79, 87],
loc: {
@@ -33,7 +36,9 @@ Program {
type: "UnaryExpression",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [133, 134],
loc: {
@@ -90,7 +95,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
@@ -124,7 +131,9 @@ Program {
asserts: false,
parameterName: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [100, 101],
loc: {
@@ -179,6 +188,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [73, 151],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot
index d53c65828a29..5dc8057cb71e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,212 @@
exports[`AST Fixtures legacy-fixtures basics type-guard-in-arrow-function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'isString',
+- optional: false,
+
+ range: [79, 87],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ init: ArrowFunctionExpression {
+ type: 'ArrowFunctionExpression',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: BinaryExpression {
+ type: 'BinaryExpression',
+ left: UnaryExpression {
+ type: 'UnaryExpression',
+ argument: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [133, 134],
+ loc: {
+ start: { column: 16, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+ operator: 'typeof',
+ prefix: true,
+
+ range: [126, 134],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+ operator: '===',
+ right: Literal {
+ type: 'Literal',
+ raw: '\\'string\\'',
+ value: 'string',
+
+ range: [139, 147],
+ loc: {
+ start: { column: 22, line: 4 },
+ end: { column: 30, line: 4 },
+ },
+ },
+
+ range: [126, 147],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 30, line: 4 },
+ },
+ },
+
+ range: [119, 148],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 31, line: 4 },
+ },
+ },
+ ],
+
+ range: [115, 150],
+ loc: {
+ start: { column: 42, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ expression: false,
+ generator: false,
+ id: null,
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [94, 97],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+
+ range: [92, 97],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+
+ range: [91, 97],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypePredicate {
+ type: 'TSTypePredicate',
+ asserts: false,
+ parameterName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [100, 101],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [105, 111],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [105, 111],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [100, 111],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [98, 111],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [90, 150],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+
+ range: [79, 150],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [73, 151],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 2, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 152],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/1-TSESTree-AST.shot
index ddf991e4e459..35284cc804c6 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/1-TSESTree-AST.shot
@@ -18,7 +18,9 @@ Program {
type: "UnaryExpression",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [130, 131],
loc: {
@@ -69,11 +71,14 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "isString",
+ optional: false,
range: [82, 90],
loc: {
@@ -84,7 +89,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
@@ -118,7 +125,9 @@ Program {
asserts: false,
parameterName: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [100, 101],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/5-AST-Alignment-AST.shot
index a14b4cb26df9..f3fb0657c32c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-function/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,189 @@
exports[`AST Fixtures legacy-fixtures basics type-guard-in-function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ FunctionDeclaration {
+ type: 'FunctionDeclaration',
+ async: false,
+ body: BlockStatement {
+ type: 'BlockStatement',
+ body: Array [
+ ReturnStatement {
+ type: 'ReturnStatement',
+ argument: BinaryExpression {
+ type: 'BinaryExpression',
+ left: UnaryExpression {
+ type: 'UnaryExpression',
+ argument: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [130, 131],
+ loc: {
+ start: { column: 16, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+ operator: 'typeof',
+ prefix: true,
+
+ range: [123, 131],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+ operator: '===',
+ right: Literal {
+ type: 'Literal',
+ raw: '\\'string\\'',
+ value: 'string',
+
+ range: [136, 144],
+ loc: {
+ start: { column: 22, line: 4 },
+ end: { column: 30, line: 4 },
+ },
+ },
+
+ range: [123, 144],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 30, line: 4 },
+ },
+ },
+
+ range: [116, 145],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 31, line: 4 },
+ },
+ },
+ ],
+
+ range: [112, 147],
+ loc: {
+ start: { column: 39, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+- declare: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'isString',
+- optional: false,
+
+ range: [82, 90],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [94, 97],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+
+ range: [92, 97],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+
+ range: [91, 97],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypePredicate {
+ type: 'TSTypePredicate',
+ asserts: false,
+ parameterName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [100, 101],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [105, 111],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [105, 111],
+ loc: {
+ start: { column: 32, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [100, 111],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [98, 111],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [73, 147],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 148],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/1-TSESTree-AST.shot
index 46fd37dbe377..2889ed0582a3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "isString",
+ optional: false,
range: [91, 99],
loc: {
@@ -23,10 +25,13 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "node",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
@@ -53,6 +58,7 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypePredicate {
@@ -60,7 +66,9 @@ Program {
asserts: false,
parameterName: Identifier {
type: "Identifier",
+ decorators: [],
name: "node",
+ optional: false,
range: [112, 116],
loc: {
@@ -100,6 +108,7 @@ Program {
end: { column: 37, line: 4 },
},
},
+ static: false,
range: [91, 127],
loc: {
@@ -115,9 +124,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/5-AST-Alignment-AST.shot
index da5fc1fa0acb..86b50d0ea33c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-interface/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface AST Alignme
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'isString',
+- optional: false,
range: [91, 99],
loc: {
@@ -27,11 +29,14 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface AST Alignme
},
},
kind: 'method',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'node',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSAnyKeyword {
@@ -58,6 +63,7 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface AST Alignme
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -66,7 +72,9 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface AST Alignme
asserts: false,
parameterName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'node',
+- optional: false,
range: [112, 116],
loc: {
@@ -106,6 +114,7 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface AST Alignme
end: { column: 37, line: 4 },
},
},
+- static: false,
range: [91, 127],
loc: {
@@ -121,9 +130,13 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-interface AST Alignme
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [83, 86],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/1-TSESTree-AST.shot
index b4bf6d1f888b..091f3d4a2b43 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "isBar",
+ optional: false,
range: [87, 92],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -47,7 +52,9 @@ Program {
operator: "instanceof",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [140, 143],
loc: {
@@ -77,6 +84,7 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -145,9 +153,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "isBaz",
+ optional: false,
range: [151, 156],
loc: {
@@ -155,7 +167,9 @@ Program {
end: { column: 7, line: 7 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: ArrowFunctionExpression {
type: "ArrowFunctionExpression",
@@ -179,7 +193,9 @@ Program {
operator: "instanceof",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [210, 213],
loc: {
@@ -281,9 +297,13 @@ Program {
end: { column: 1, line: 10 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -291,6 +311,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 221],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/5-AST-Alignment-AST.shot
index d4b80cfc1c0b..6694942a9c15 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-guard-in-method/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'isBar',
+- optional: false,
range: [87, 92],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -51,7 +56,9 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment
operator: 'instanceof',
right: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [140, 143],
loc: {
@@ -81,6 +88,7 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment
end: { column: 3, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -149,9 +157,13 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'isBaz',
+- optional: false,
range: [151, 156],
loc: {
@@ -159,7 +171,9 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment
end: { column: 7, line: 7 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: ArrowFunctionExpression {
type: 'ArrowFunctionExpression',
@@ -183,7 +197,9 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment
operator: 'instanceof',
right: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [210, 213],
loc: {
@@ -285,9 +301,13 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment
end: { column: 1, line: 10 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -295,6 +315,7 @@ exports[`AST Fixtures legacy-fixtures basics type-guard-in-method AST Alignment
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 221],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot
index 3ff06704e031..eafcb69bdf0c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [78, 79],
loc: {
@@ -18,23 +21,12 @@ Program {
},
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "A",
-
- range: [82, 83],
- loc: {
- start: { column: 9, line: 3 },
- end: { column: 10, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSImportType {
type: "TSImportType",
- isTypeOf: false,
- parameter: TSLiteralType {
+ argument: TSLiteralType {
type: "TSLiteralType",
literal: Literal {
type: "Literal",
@@ -56,7 +48,9 @@ Program {
},
qualifier: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [95, 96],
loc: {
@@ -64,7 +58,7 @@ Program {
end: { column: 23, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSAnyKeyword {
@@ -99,6 +93,18 @@ Program {
end: { column: 29, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "A",
+ optional: false,
+
+ range: [82, 83],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
range: [82, 102],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot
index b3d492c1c090..7a44f8974008 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [78, 79],
loc: {
@@ -22,40 +25,40 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete
},
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'A',
-
- range: [82, 83],
- loc: {
- start: { column: 9, line: 3 },
- end: { column: 10, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'A',
++
++ range: [82, 83],
++ loc: {
++ start: { column: 9, line: 3 },
++ end: { column: 10, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSImportType {
type: 'TSImportType',
-- isTypeOf: false,
-- parameter: TSLiteralType {
+- argument: TSLiteralType {
- type: 'TSLiteralType',
- literal: Literal {
- type: 'Literal',
- raw: '\\'\\'',
- value: '',
--
++ argument: Literal {
++ type: 'Literal',
++ raw: '\\'\\'',
++ value: '',
+
- range: [91, 93],
- loc: {
- start: { column: 18, line: 3 },
- end: { column: 20, line: 3 },
- },
- },
-+ argument: Literal {
-+ type: 'Literal',
-+ raw: '\\'\\'',
-+ value: '',
-
+-
range: [91, 93],
loc: {
start: { column: 18, line: 3 },
@@ -64,7 +67,9 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete
},
qualifier: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [95, 96],
loc: {
@@ -72,7 +77,8 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete
end: { column: 23, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSAnyKeyword {
@@ -105,6 +111,18 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type-with-type-paramete
loc: {
start: { column: 10, line: 3 },
end: { column: 29, line: 3 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'A',
+- optional: false,
+-
+- range: [82, 83],
+- loc: {
+- start: { column: 9, line: 3 },
+- end: { column: 10, line: 3 },
},
},
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot
index 46ca24b80299..a0dca73c853b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [78, 79],
loc: {
@@ -16,15 +19,23 @@ Program {
end: { column: 6, line: 3 },
},
},
- typeAnnotation: TSImportType {
- type: "TSImportType",
- isTypeOf: true,
- parameter: TSLiteralType {
- type: "TSLiteralType",
- literal: Literal {
- type: "Literal",
- raw: "'A'",
- value: "A",
+ typeAnnotation: TSTypeQuery {
+ type: "TSTypeQuery",
+ exprName: TSImportType {
+ type: "TSImportType",
+ argument: TSLiteralType {
+ type: "TSLiteralType",
+ literal: Literal {
+ type: "Literal",
+ raw: "'A'",
+ value: "A",
+
+ range: [96, 99],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
range: [96, 99],
loc: {
@@ -32,15 +43,15 @@ Program {
end: { column: 26, line: 3 },
},
},
+ qualifier: null,
+ typeArguments: null,
- range: [96, 99],
+ range: [89, 100],
loc: {
- start: { column: 23, line: 3 },
- end: { column: 26, line: 3 },
+ start: { column: 16, line: 3 },
+ end: { column: 27, line: 3 },
},
},
- qualifier: null,
- typeParameters: null,
range: [82, 100],
loc: {
@@ -57,9 +68,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [107, 108],
loc: {
@@ -69,8 +83,7 @@ Program {
},
typeAnnotation: TSImportType {
type: "TSImportType",
- isTypeOf: false,
- parameter: TSLiteralType {
+ argument: TSLiteralType {
type: "TSLiteralType",
literal: Literal {
type: "Literal",
@@ -92,7 +105,9 @@ Program {
},
qualifier: Identifier {
type: "Identifier",
+ decorators: [],
name: "X",
+ optional: false,
range: [123, 124],
loc: {
@@ -100,14 +115,16 @@ Program {
end: { column: 22, line: 4 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Y",
+ optional: false,
range: [125, 126],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot
index bc1a96cae671..62d99f330fd3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-import-type/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [78, 79],
loc: {
@@ -20,39 +23,43 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS
end: { column: 6, line: 3 },
},
},
-- typeAnnotation: TSImportType {
-- type: 'TSImportType',
-- isTypeOf: true,
-- parameter: TSLiteralType {
-- type: 'TSLiteralType',
-- literal: Literal {
-+ typeAnnotation: TSTypeQuery {
-+ type: 'TSTypeQuery',
-+ exprName: TSImportType {
-+ type: 'TSImportType',
+ typeAnnotation: TSTypeQuery {
+ type: 'TSTypeQuery',
+ exprName: TSImportType {
+ type: 'TSImportType',
+- argument: TSLiteralType {
+- type: 'TSLiteralType',
+- literal: Literal {
+- type: 'Literal',
+- raw: '\\'A\\'',
+- value: 'A',
+ argument: Literal {
- type: 'Literal',
- raw: '\\'A\\'',
- value: 'A',
-
++ type: 'Literal',
++ raw: '\\'A\\'',
++ value: 'A',
+
+- range: [96, 99],
+- loc: {
+- start: { column: 23, line: 3 },
+- end: { column: 26, line: 3 },
+- },
+- },
+-
range: [96, 99],
loc: {
start: { column: 23, line: 3 },
end: { column: 26, line: 3 },
},
},
+- qualifier: null,
+- typeArguments: null,
-- range: [96, 99],
-+ range: [89, 100],
+ range: [89, 100],
loc: {
-- start: { column: 23, line: 3 },
-- end: { column: 26, line: 3 },
-+ start: { column: 16, line: 3 },
-+ end: { column: 27, line: 3 },
+ start: { column: 16, line: 3 },
+ end: { column: 27, line: 3 },
},
},
-- qualifier: null,
-- typeParameters: null,
range: [82, 100],
loc: {
@@ -69,9 +76,12 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [107, 108],
loc: {
@@ -81,8 +91,7 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS
},
typeAnnotation: TSImportType {
type: 'TSImportType',
-- isTypeOf: false,
-- parameter: TSLiteralType {
+- argument: TSLiteralType {
- type: 'TSLiteralType',
- literal: Literal {
- type: 'Literal',
@@ -108,7 +117,9 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS
},
qualifier: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X',
+- optional: false,
range: [123, 124],
loc: {
@@ -116,14 +127,17 @@ exports[`AST Fixtures legacy-fixtures basics type-import-type AST Alignment - AS
end: { column: 22, line: 4 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Y',
+- optional: false,
range: [125, 126],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot
index f5d04acee7b8..256b304a02d0 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot
@@ -25,7 +25,9 @@ Program {
type: "ExportSpecifier",
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [87, 88],
loc: {
@@ -36,7 +38,9 @@ Program {
exportKind: "type",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [87, 88],
loc: {
@@ -55,7 +59,9 @@ Program {
type: "ExportSpecifier",
exported: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [95, 96],
loc: {
@@ -66,7 +72,9 @@ Program {
exportKind: "type",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [95, 96],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot
index b269b793948e..0371377d04ca 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,112 @@
exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExportNamedDeclaration {
+ type: 'ExportNamedDeclaration',
+ assertions: Array [],
+ declaration: null,
+ exportKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [104, 109],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 36, line: 3 },
+ },
+ },
+ specifiers: Array [
+ ExportSpecifier {
+ type: 'ExportSpecifier',
+ exported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [87, 88],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ exportKind: 'type',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [87, 88],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+
+ range: [82, 88],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ ExportSpecifier {
+ type: 'ExportSpecifier',
+ exported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'B',
+- optional: false,
+
+ range: [95, 96],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ exportKind: 'type',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'B',
+- optional: false,
+
+ range: [95, 96],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+
+ range: [90, 96],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 110],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 37, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [73, 111],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot
index 9b82dc5f9f2e..6c6b075e4345 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot
@@ -24,7 +24,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [87, 88],
loc: {
@@ -35,7 +37,9 @@ Program {
importKind: "type",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [87, 88],
loc: {
@@ -54,7 +58,9 @@ Program {
type: "ImportSpecifier",
imported: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [95, 96],
loc: {
@@ -65,7 +71,9 @@ Program {
importKind: "type",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [95, 96],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot
index c473f9f118ee..313e18bc7f90 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,111 @@
exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ImportDeclaration {
+ type: 'ImportDeclaration',
+ assertions: Array [],
+ importKind: 'value',
+ source: Literal {
+ type: 'Literal',
+ raw: '\\'mod\\'',
+ value: 'mod',
+
+ range: [104, 109],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 36, line: 3 },
+ },
+ },
+ specifiers: Array [
+ ImportSpecifier {
+ type: 'ImportSpecifier',
+ imported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [87, 88],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ importKind: 'type',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [87, 88],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+
+ range: [82, 88],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ ImportSpecifier {
+ type: 'ImportSpecifier',
+ imported: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'B',
+- optional: false,
+
+ range: [95, 96],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ importKind: 'type',
+ local: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'B',
+- optional: false,
+
+ range: [95, 96],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+
+ range: [90, 96],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ ],
+
+ range: [73, 110],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 37, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'module',
+
+ range: [73, 111],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot
index a516cc87f4ed..31bc883b677a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 70, line: 3 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -26,9 +31,12 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [114, 117],
loc: {
@@ -36,14 +44,16 @@ Program {
end: { column: 44, line: 3 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+ superTypeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [128, 129],
loc: {
@@ -75,7 +85,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [93, 94],
loc: {
@@ -108,6 +120,7 @@ Program {
},
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -118,9 +131,13 @@ Program {
end: { column: 39, line: 6 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo2",
+ optional: false,
range: [150, 154],
loc: {
@@ -128,9 +145,12 @@ Program {
end: { column: 10, line: 4 },
},
},
+ implements: [],
superClass: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [205, 208],
loc: {
@@ -138,14 +158,16 @@ Program {
end: { column: 13, line: 6 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+ superTypeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [219, 220],
loc: {
@@ -197,7 +219,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [168, 169],
loc: {
@@ -240,12 +264,15 @@ Program {
end: { column: 75, line: 7 },
},
},
+ declare: false,
extends: [
TSInterfaceHeritage {
type: "TSInterfaceHeritage",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar2",
+ optional: false,
range: [280, 284],
loc: {
@@ -253,14 +280,16 @@ Program {
end: { column: 49, line: 7 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [295, 296],
loc: {
@@ -293,7 +322,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [245, 248],
loc: {
@@ -310,7 +341,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [259, 260],
loc: {
@@ -353,12 +386,15 @@ Program {
end: { column: 39, line: 9 },
},
},
+ declare: false,
extends: [
TSInterfaceHeritage {
type: "TSInterfaceHeritage",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [373, 376],
loc: {
@@ -366,14 +402,16 @@ Program {
end: { column: 13, line: 9 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [387, 388],
loc: {
@@ -406,7 +444,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar2",
+ optional: false,
range: [321, 325],
loc: {
@@ -443,7 +483,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [336, 337],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot
index 37c6b8de68f8..a04914b21e16 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
end: { column: 70, line: 3 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -30,9 +35,12 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [114, 117],
loc: {
@@ -40,14 +48,17 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
end: { column: 44, line: 3 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+- superTypeArguments: TSTypeParameterInstantiation {
++ superTypeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [128, 129],
loc: {
@@ -79,7 +90,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'A',
+- optional: false,
-
- range: [93, 94],
- loc: {
@@ -113,6 +126,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
},
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -123,9 +137,13 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
end: { column: 39, line: 6 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo2',
+- optional: false,
range: [150, 154],
loc: {
@@ -133,9 +151,12 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
end: { column: 10, line: 4 },
},
},
+- implements: Array [],
superClass: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [205, 208],
loc: {
@@ -143,14 +164,17 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
end: { column: 13, line: 6 },
},
},
- superTypeParameters: TSTypeParameterInstantiation {
+- superTypeArguments: TSTypeParameterInstantiation {
++ superTypeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [219, 220],
loc: {
@@ -202,7 +226,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'A',
+- optional: false,
+ name: 'A',
- range: [168, 169],
@@ -246,6 +272,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
end: { column: 75, line: 7 },
},
},
+- declare: false,
extends: Array [
- TSInterfaceHeritage {
- type: 'TSInterfaceHeritage',
@@ -253,7 +280,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar2',
+- optional: false,
range: [280, 284],
loc: {
@@ -261,14 +290,17 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
end: { column: 49, line: 7 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [295, 296],
loc: {
@@ -301,7 +333,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [245, 248],
loc: {
@@ -318,8 +352,11 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'A',
--
+- optional: false,
++ name: 'A',
+
- range: [259, 260],
- loc: {
- start: { column: 24, line: 7 },
@@ -327,8 +364,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
- },
- },
- out: false,
-+ name: 'A',
-
+-
range: [259, 260],
loc: {
start: { column: 24, line: 7 },
@@ -362,6 +398,7 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
end: { column: 39, line: 9 },
},
},
+- declare: false,
extends: Array [
- TSInterfaceHeritage {
- type: 'TSInterfaceHeritage',
@@ -369,7 +406,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
+ type: 'TSExpressionWithTypeArguments',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [373, 376],
loc: {
@@ -377,14 +416,17 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
end: { column: 13, line: 9 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [387, 388],
loc: {
@@ -417,7 +459,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar2',
+- optional: false,
range: [321, 325],
loc: {
@@ -454,7 +498,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments-heritage A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'A',
+- optional: false,
-
- range: [336, 337],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot
index 3ae73b01034c..f6120c1dd742 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/1-TSESTree-AST.shot
@@ -11,7 +11,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [73, 76],
loc: {
@@ -20,14 +22,16 @@ Program {
},
},
optional: false,
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [93, 94],
loc: {
@@ -77,11 +81,14 @@ Program {
end: { column: 40, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [124, 127],
loc: {
@@ -99,7 +106,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [138, 139],
loc: {
@@ -143,11 +152,14 @@ Program {
end: { column: 46, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [165, 168],
loc: {
@@ -166,7 +178,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [193, 196],
loc: {
@@ -184,7 +198,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [179, 180],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot
index 724bdedf9c7e..212f808e37d5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-parameters-comments/snapshots/5-AST-Alignment-AST.shot
@@ -15,7 +15,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm
arguments: Array [],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [73, 76],
loc: {
@@ -24,14 +26,17 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm
},
},
optional: false,
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [93, 94],
loc: {
@@ -81,11 +86,14 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm
end: { column: 40, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [124, 127],
loc: {
@@ -103,7 +111,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'A',
+- optional: false,
-
- range: [138, 139],
- loc: {
@@ -148,11 +158,14 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm
end: { column: 46, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [165, 168],
loc: {
@@ -171,7 +184,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [193, 196],
loc: {
@@ -189,7 +204,9 @@ exports[`AST Fixtures legacy-fixtures basics type-parameters-comments AST Alignm
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'A',
+- optional: false,
-
- range: [179, 180],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot
index ead0a8afdd7a..18334207c3b0 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -13,9 +14,13 @@ Program {
type: "PropertyDefinition",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "mBuffers",
+ optional: false,
range: [99, 107],
loc: {
@@ -23,17 +28,41 @@ Program {
end: { column: 10, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
+ typeArguments: TSTypeParameterInstantiation {
+ type: "TSTypeParameterInstantiation",
+ params: [
+ TSAnyKeyword {
+ type: "TSAnyKeyword",
+
+ range: [127, 130],
+ loc: {
+ start: { column: 30, line: 4 },
+ end: { column: 33, line: 4 },
+ },
+ },
+ ],
+
+ range: [126, 147],
+ loc: {
+ start: { column: 29, line: 4 },
+ end: { column: 50, line: 4 },
+ },
+ },
typeName: TSQualifiedName {
type: "TSQualifiedName",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "interop",
+ optional: false,
range: [109, 116],
loc: {
@@ -43,7 +72,9 @@ Program {
},
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "Reference",
+ optional: false,
range: [117, 126],
loc: {
@@ -58,26 +89,6 @@ Program {
end: { column: 29, line: 4 },
},
},
- typeParameters: TSTypeParameterInstantiation {
- type: "TSTypeParameterInstantiation",
- params: [
- TSAnyKeyword {
- type: "TSAnyKeyword",
-
- range: [127, 130],
- loc: {
- start: { column: 30, line: 4 },
- end: { column: 33, line: 4 },
- },
- },
- ],
-
- range: [126, 147],
- loc: {
- start: { column: 29, line: 4 },
- end: { column: 50, line: 4 },
- },
- },
range: [109, 147],
loc: {
@@ -108,9 +119,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "AudioBufferList",
+ optional: false,
range: [79, 94],
loc: {
@@ -118,6 +133,7 @@ Program {
end: { column: 21, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 150],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot
index 81d663d91cb1..4af0d045e7b5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-reference-comments/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures basics type-reference-comments AST Alignme
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -17,9 +18,13 @@ exports[`AST Fixtures legacy-fixtures basics type-reference-comments AST Alignme
type: 'PropertyDefinition',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'mBuffers',
+- optional: false,
range: [99, 107],
loc: {
@@ -27,17 +32,41 @@ exports[`AST Fixtures legacy-fixtures basics type-reference-comments AST Alignme
end: { column: 10, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
+- type: 'TSTypeParameterInstantiation',
+- params: Array [
+- TSAnyKeyword {
+- type: 'TSAnyKeyword',
+-
+- range: [127, 130],
+- loc: {
+- start: { column: 30, line: 4 },
+- end: { column: 33, line: 4 },
+- },
+- },
+- ],
+-
+- range: [126, 147],
+- loc: {
+- start: { column: 29, line: 4 },
+- end: { column: 50, line: 4 },
+- },
+- },
typeName: TSQualifiedName {
type: 'TSQualifiedName',
left: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'interop',
+- optional: false,
range: [109, 116],
loc: {
@@ -47,7 +76,9 @@ exports[`AST Fixtures legacy-fixtures basics type-reference-comments AST Alignme
},
right: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Reference',
+- optional: false,
range: [117, 126],
loc: {
@@ -60,26 +91,26 @@ exports[`AST Fixtures legacy-fixtures basics type-reference-comments AST Alignme
loc: {
start: { column: 12, line: 4 },
end: { column: 29, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
- type: 'TSTypeParameterInstantiation',
- params: Array [
- TSAnyKeyword {
- type: 'TSAnyKeyword',
-
- range: [127, 130],
- loc: {
- start: { column: 30, line: 4 },
- end: { column: 33, line: 4 },
- },
- },
- ],
-
- range: [126, 147],
- loc: {
- start: { column: 29, line: 4 },
- end: { column: 50, line: 4 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
++ type: 'TSTypeParameterInstantiation',
++ params: Array [
++ TSAnyKeyword {
++ type: 'TSAnyKeyword',
++
++ range: [127, 130],
++ loc: {
++ start: { column: 30, line: 4 },
++ end: { column: 33, line: 4 },
++ },
++ },
++ ],
++
++ range: [126, 147],
++ loc: {
++ start: { column: 29, line: 4 },
++ end: { column: 50, line: 4 },
},
},
@@ -112,9 +143,13 @@ exports[`AST Fixtures legacy-fixtures basics type-reference-comments AST Alignme
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'AudioBufferList',
+- optional: false,
range: [79, 94],
loc: {
@@ -122,6 +157,7 @@ exports[`AST Fixtures legacy-fixtures basics type-reference-comments AST Alignme
end: { column: 21, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 150],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/1-TSESTree-AST.shot
index d1f36b0011f8..eeaa588da123 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/5-AST-Alignment-AST.shot
index bba1fc6c6f9b..c9a2c6c13231 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-bigint/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-bigint AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSBigIntKeyword {
+ type: 'TSBigIntKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/1-TSESTree-AST.shot
index 15430d8a9ab9..32cc496fafb7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/5-AST-Alignment-AST.shot
index 26e84868cf50..f65e128096a6 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-boolean/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-boolean AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSBooleanKeyword {
+ type: 'TSBooleanKeyword',
+
+ range: [84, 91],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 93],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/1-TSESTree-AST.shot
index f3f2c5de74ea..68ab5918c6c3 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/5-AST-Alignment-AST.shot
index d96b38d76a7a..53aebf916f5a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-false/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,61 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-false AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSLiteralType {
+ type: 'TSLiteralType',
+ literal: Literal {
+ type: 'Literal',
+ raw: 'false',
+ value: false,
+
+ range: [84, 89],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+
+ range: [84, 89],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+
+ range: [73, 90],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/1-TSESTree-AST.shot
index 7f83badadf9e..350fee4f4c88 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/5-AST-Alignment-AST.shot
index c377742b9593..a353497f2ecb 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-never/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-never AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSNeverKeyword {
+ type: 'TSNeverKeyword',
+
+ range: [84, 89],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+
+ range: [73, 90],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/1-TSESTree-AST.shot
index 7db93d05ef4e..856c1022be0a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/5-AST-Alignment-AST.shot
index fca6050d833f..466b4987dd45 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-null AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSNullKeyword {
+ type: 'TSNullKeyword',
+
+ range: [84, 88],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+
+ range: [73, 89],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 90],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/1-TSESTree-AST.shot
index 4ccca319ab84..f6c3e5d04321 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/5-AST-Alignment-AST.shot
index 8eb6a37462b4..8055f6f1ce2f 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-number/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-number AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/1-TSESTree-AST.shot
index bb5100cf4363..0c1628c7f842 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/5-AST-Alignment-AST.shot
index 1989928fcdf8..29d534bf394c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-object/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-object AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSObjectKeyword {
+ type: 'TSObjectKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/1-TSESTree-AST.shot
index 0ee3d02dc01e..95dedbb1b0e4 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/5-AST-Alignment-AST.shot
index 5eca842524b8..feafd3896463 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-string/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-string AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/1-TSESTree-AST.shot
index 9ba239c957c1..e0535ac0dc9c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/5-AST-Alignment-AST.shot
index 8b7dfb95fb31..beffde570e4e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-symbol/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-symbol AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSSymbolKeyword {
+ type: 'TSSymbolKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/1-TSESTree-AST.shot
index c9d8f8739f4f..9067bea23968 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/5-AST-Alignment-AST.shot
index c25d16a9d1bd..5ee73a232e1e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-true/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,61 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-true AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSLiteralType {
+ type: 'TSLiteralType',
+ literal: Literal {
+ type: 'Literal',
+ raw: 'true',
+ value: true,
+
+ range: [84, 88],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+
+ range: [84, 88],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+
+ range: [73, 89],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 90],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/1-TSESTree-AST.shot
index f1244a520c35..05b18b493539 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/5-AST-Alignment-AST.shot
index 6ed7dcc09d3f..9756a5a473ee 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-undefined/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-undefined AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSUndefinedKeyword {
+ type: 'TSUndefinedKeyword',
+
+ range: [84, 93],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 95],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/1-TSESTree-AST.shot
index 3bd87f8c8809..fd72e2b25fcd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/5-AST-Alignment-AST.shot
index a2c14932bd7e..3c694ea56b11 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-unknown/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-unknown AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSUnknownKeyword {
+ type: 'TSUnknownKeyword',
+
+ range: [84, 91],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 93],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/1-TSESTree-AST.shot
index fb23e7665692..ee15266961d6 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/5-AST-Alignment-AST.shot
index 8b70a69a9c15..8310c147a49a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-void/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures basics typed-keyword-void AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSVoidKeyword {
+ type: 'TSVoidKeyword',
+
+ range: [84, 88],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+
+ range: [73, 89],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 90],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot
index 2349f700577d..36f2c1cf1d5d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -24,7 +27,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "h",
+ optional: false,
range: [88, 89],
loc: {
@@ -33,10 +38,13 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -63,6 +71,7 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSVoidKeyword {
@@ -81,6 +90,7 @@ Program {
end: { column: 22, line: 4 },
},
},
+ static: false,
range: [88, 109],
loc: {
@@ -93,7 +103,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "g",
+ optional: false,
range: [112, 113],
loc: {
@@ -102,17 +114,22 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [122, 123],
loc: {
@@ -142,13 +159,16 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [126, 127],
loc: {
@@ -170,6 +190,7 @@ Program {
end: { column: 17, line: 5 },
},
},
+ static: false,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
params: [
@@ -179,7 +200,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [114, 115],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot
index 71fe4bac95bb..837488858a5c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-method-signature/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [78, 81],
loc: {
@@ -28,7 +31,9 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'h',
+- optional: false,
range: [88, 89],
loc: {
@@ -37,11 +42,14 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
},
},
kind: 'method',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -68,6 +76,7 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -87,6 +96,7 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
end: { column: 22, line: 4 },
},
},
+- static: false,
range: [88, 109],
loc: {
@@ -99,7 +109,9 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'g',
+- optional: false,
range: [112, 113],
loc: {
@@ -108,18 +120,23 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
},
},
kind: 'method',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [122, 123],
loc: {
@@ -149,6 +166,7 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -156,7 +174,9 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [126, 127],
loc: {
@@ -178,6 +198,7 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
end: { column: 17, line: 5 },
},
},
+- static: false,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
params: Array [
@@ -187,7 +208,9 @@ exports[`AST Fixtures legacy-fixtures basics typed-method-signature AST Alignmen
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [114, 115],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/1-TSESTree-AST.shot
index 23109d3d2bb9..ed9374668d8c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "addClickListener",
+ optional: false,
range: [97, 113],
loc: {
@@ -23,10 +25,13 @@ Program {
},
},
kind: "method",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "onclick",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSFunctionType {
@@ -34,7 +39,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "this",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSVoidKeyword {
@@ -62,14 +69,18 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "e",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Event",
+ optional: false,
range: [139, 144],
loc: {
@@ -139,6 +150,7 @@ Program {
},
},
],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSVoidKeyword {
@@ -157,6 +169,7 @@ Program {
end: { column: 65, line: 4 },
},
},
+ static: false,
range: [97, 161],
loc: {
@@ -172,9 +185,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "UIElement",
+ optional: false,
range: [83, 92],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/5-AST-Alignment-AST.shot
index 6b66408fdf80..71878cff80a7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures basics typed-this AST Alignment - AST 1`]
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'addClickListener',
+- optional: false,
range: [97, 113],
loc: {
@@ -27,11 +29,14 @@ exports[`AST Fixtures legacy-fixtures basics typed-this AST Alignment - AST 1`]
},
},
kind: 'method',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'onclick',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSFunctionType {
@@ -40,7 +45,9 @@ exports[`AST Fixtures legacy-fixtures basics typed-this AST Alignment - AST 1`]
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'this',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSVoidKeyword {
@@ -68,14 +75,18 @@ exports[`AST Fixtures legacy-fixtures basics typed-this AST Alignment - AST 1`]
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'e',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Event',
+- optional: false,
range: [139, 144],
loc: {
@@ -146,6 +157,7 @@ exports[`AST Fixtures legacy-fixtures basics typed-this AST Alignment - AST 1`]
},
},
],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -165,6 +177,7 @@ exports[`AST Fixtures legacy-fixtures basics typed-this AST Alignment - AST 1`]
end: { column: 65, line: 4 },
},
},
+- static: false,
range: [97, 161],
loc: {
@@ -180,9 +193,13 @@ exports[`AST Fixtures legacy-fixtures basics typed-this AST Alignment - AST 1`]
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'UIElement',
+- optional: false,
range: [83, 92],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot
index ef064f93b5c6..285db979a8e9 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "union",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnionType {
@@ -75,6 +78,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 110],
@@ -88,9 +92,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "intersection",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSIntersectionType {
@@ -145,6 +152,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [111, 145],
@@ -158,9 +166,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "precedence1",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnionType {
@@ -235,6 +246,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [146, 191],
@@ -248,9 +260,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "precedence2",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnionType {
@@ -325,6 +340,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [192, 237],
@@ -335,9 +351,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "unionLeading",
+ optional: false,
range: [244, 256],
loc: {
@@ -383,9 +402,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "intersectionLeading",
+ optional: false,
range: [281, 300],
loc: {
@@ -431,9 +453,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "unionLeadingSingle",
+ optional: false,
range: [325, 343],
loc: {
@@ -459,9 +484,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "intersectionLeadingSingle",
+ optional: false,
range: [359, 384],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot
index 003d20be4436..0ba46d85e336 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'union',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSUnionType {
@@ -79,6 +82,7 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
},
},
],
+- declare: false,
kind: 'let',
range: [73, 110],
@@ -92,9 +96,12 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'intersection',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSIntersectionType {
@@ -149,6 +156,7 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
},
},
],
+- declare: false,
kind: 'let',
range: [111, 145],
@@ -162,9 +170,12 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'precedence1',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSUnionType {
@@ -268,6 +279,7 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
},
},
],
+- declare: false,
kind: 'let',
range: [146, 191],
@@ -281,9 +293,12 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'precedence2',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSUnionType {
@@ -387,6 +402,7 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
},
},
],
+- declare: false,
kind: 'let',
range: [192, 237],
@@ -397,9 +413,12 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'unionLeading',
+- optional: false,
range: [244, 256],
loc: {
@@ -445,9 +464,12 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'intersectionLeading',
+- optional: false,
range: [281, 300],
loc: {
@@ -493,9 +515,12 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'unionLeadingSingle',
+- optional: false,
range: [325, 343],
loc: {
@@ -521,9 +546,12 @@ exports[`AST Fixtures legacy-fixtures basics union-intersection AST Alignment -
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'intersectionLeadingSingle',
+- optional: false,
range: [359, 384],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/1-TSESTree-AST.shot
index 9ea2f9badb64..30380db61899 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [78, 79],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/5-AST-Alignment-AST.shot
index 624e3a6347f3..6c182a3ea16d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unique-symbol/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,60 @@
exports[`AST Fixtures legacy-fixtures basics unique-symbol AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [78, 79],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 6, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeOperator {
+ type: 'TSTypeOperator',
+ operator: 'unique',
+ typeAnnotation: TSSymbolKeyword {
+ type: 'TSSymbolKeyword',
+
+ range: [89, 95],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+
+ range: [82, 95],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+
+ range: [73, 96],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 97],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/1-TSESTree-AST.shot
index 55d50aa9f5bb..fd53d22a36b1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnknownKeyword {
@@ -46,6 +49,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 90],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/5-AST-Alignment-AST.shot
index 9a02cb1d49f0..eca7ce1e22c1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,73 @@
exports[`AST Fixtures legacy-fixtures basics unknown-type-annotation AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSUnknownKeyword {
+ type: 'TSUnknownKeyword',
+
+ range: [82, 89],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+
+ range: [80, 89],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+
+ range: [77, 89],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 89],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 90],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/1-TSESTree-AST.shot
index 09cad104b78e..85b642107fbc 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
@@ -22,7 +25,9 @@ Program {
type: "TSQualifiedName",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [82, 83],
loc: {
@@ -32,7 +37,9 @@ Program {
},
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [84, 85],
loc: {
@@ -49,7 +56,9 @@ Program {
},
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [86, 87],
loc: {
@@ -94,6 +103,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [73, 88],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/5-AST-Alignment-AST.shot
index c7abbe042676..d389263137db 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-dotted-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,127 @@
exports[`AST Fixtures legacy-fixtures basics var-with-dotted-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: TSQualifiedName {
+ type: 'TSQualifiedName',
+ left: TSQualifiedName {
+ type: 'TSQualifiedName',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [82, 83],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'B',
+- optional: false,
+
+ range: [84, 85],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ range: [82, 85],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'C',
+- optional: false,
+
+ range: [86, 87],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [82, 87],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [82, 87],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [80, 87],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [77, 87],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 87],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [73, 88],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 89],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/1-TSESTree-AST.shot
index e4a3ab04415a..fd1f20c21c60 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "name",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -56,6 +59,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [73, 103],
@@ -69,9 +73,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -116,6 +123,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [104, 128],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/5-AST-Alignment-AST.shot
index 5db71f16938d..8ea07ffae125 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/var-with-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,147 @@
exports[`AST Fixtures legacy-fixtures basics var-with-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'name',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [83, 89],
+ loc: {
+ start: { column: 10, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+
+ range: [81, 89],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+
+ range: [77, 89],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '\\'Nicholas\\'',
+ value: 'Nicholas',
+
+ range: [92, 102],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+
+ range: [77, 102],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [73, 103],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 30, line: 3 },
+ },
+ },
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [113, 119],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+
+ range: [111, 119],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+
+ range: [108, 119],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+ init: Literal {
+ type: 'Literal',
+ raw: '\\'Bar\\'',
+ value: 'Bar',
+
+ range: [122, 127],
+ loc: {
+ start: { column: 18, line: 4 },
+ end: { column: 23, line: 4 },
+ },
+ },
+
+ range: [108, 127],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 23, line: 4 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'var',
+
+ range: [104, 128],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 24, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 129],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/1-TSESTree-AST.shot
index 96cc28bc9e24..1185eb6f27c0 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -46,6 +49,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 87],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/5-AST-Alignment-AST.shot
index e4933e5c280d..27a1d0f281ec 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,73 @@
exports[`AST Fixtures legacy-fixtures basics variable-declaration-type-annotation-spacing AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [80, 86],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [78, 86],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [77, 86],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 86],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 87],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 88],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/1-TSESTree-AST.shot
index d29236eb3c07..f3fd3e4f191d 100644
--- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,6 +17,7 @@ Program {
end: { column: 21, line: 6 },
},
},
+ declare: false,
decorators: [
Decorator {
type: "Decorator",
@@ -30,7 +32,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "selector",
+ optional: false,
range: [88, 96],
loc: {
@@ -40,6 +44,7 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: false,
value: Literal {
type: "Literal",
@@ -70,7 +75,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "Component",
+ optional: false,
range: [74, 83],
loc: {
@@ -96,7 +103,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "FooComponent",
+ optional: false,
range: [114, 126],
loc: {
@@ -104,6 +113,7 @@ Program {
end: { column: 18, line: 6 },
},
},
+ implements: [],
superClass: null,
range: [73, 129],
diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/5-AST-Alignment-AST.shot
index 8c120b192b5c..d854a20c8885 100644
--- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator-factory/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,137 @@
exports[`AST Fixtures legacy-fixtures class-decorators class-decorator-factory AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [127, 129],
+ loc: {
+ start: { column: 19, line: 6 },
+ end: { column: 21, line: 6 },
+ },
+ },
+- declare: false,
+ decorators: Array [
+ Decorator {
+ type: 'Decorator',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [
+ ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'selector',
+- optional: false,
+
+ range: [88, 96],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+ kind: 'init',
+ method: false,
+- optional: false,
+ shorthand: false,
+ value: Literal {
+ type: 'Literal',
+ raw: '\\'foo\\'',
+ value: 'foo',
+
+ range: [98, 103],
+ loc: {
+ start: { column: 12, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+
+ range: [88, 103],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+ ],
+
+ range: [84, 106],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Component',
+- optional: false,
+
+ range: [74, 83],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+ optional: false,
+
+ range: [74, 107],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 2, line: 5 },
+ },
+ },
+
+ range: [73, 107],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 2, line: 5 },
+ },
+ },
+ ],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'FooComponent',
+- optional: false,
+
+ range: [114, 126],
+ loc: {
+ start: { column: 6, line: 6 },
+ end: { column: 18, line: 6 },
+ },
+ },
+- implements: Array [],
+ superClass: null,
+
+ range: [73, 129],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 21, line: 6 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 130],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 7 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/1-TSESTree-AST.shot
index e78551dadff3..772d11518e1b 100644
--- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,12 +17,15 @@ Program {
end: { column: 12, line: 4 },
},
},
+ declare: false,
decorators: [
Decorator {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "sealed",
+ optional: false,
range: [74, 80],
loc: {
@@ -39,7 +43,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Qux",
+ optional: false,
range: [87, 90],
loc: {
@@ -47,6 +53,7 @@ Program {
end: { column: 9, line: 4 },
},
},
+ implements: [],
superClass: null,
range: [73, 93],
diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/5-AST-Alignment-AST.shot
index 40e0a52e4096..1b6b38c2c77e 100644
--- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-decorator/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,77 @@
exports[`AST Fixtures legacy-fixtures class-decorators class-decorator AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [91, 93],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 12, line: 4 },
+ },
+ },
+- declare: false,
+ decorators: Array [
+ Decorator {
+ type: 'Decorator',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'sealed',
+- optional: false,
+
+ range: [74, 80],
+ loc: {
+ start: { column: 1, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+
+ range: [73, 80],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ ],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Qux',
+- optional: false,
+
+ range: [87, 90],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+- implements: Array [],
+ superClass: null,
+
+ range: [73, 93],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 12, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/1-TSESTree-AST.shot
index e4779292f6f7..ecf8541214ca 100644
--- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [85, 96],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 38, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -50,7 +56,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "d",
+ optional: false,
range: [98, 99],
loc: {
@@ -66,9 +74,12 @@ Program {
},
},
],
+ override: false,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -94,6 +105,8 @@ Program {
end: { column: 34, line: 4 },
},
},
+ readonly: false,
+ static: false,
range: [97, 117],
loc: {
@@ -124,9 +137,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [79, 80],
loc: {
@@ -134,6 +151,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 123],
diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/5-AST-Alignment-AST.shot
index ad0a3b6af28a..b5b95884e0e7 100644
--- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/class-parameter-property/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [85, 96],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property
end: { column: 38, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -54,7 +60,9 @@ exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'd',
+- optional: false,
range: [98, 99],
loc: {
@@ -70,9 +78,12 @@ exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property
},
},
],
+- override: false,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -98,6 +109,8 @@ exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property
end: { column: 34, line: 4 },
},
},
+- readonly: false,
+- static: false,
- range: [97, 117],
+ range: [100, 117],
@@ -130,9 +143,13 @@ exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [79, 80],
loc: {
@@ -140,6 +157,7 @@ exports[`AST Fixtures legacy-fixtures class-decorators class-parameter-property
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 123],
diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/1-TSESTree-AST.shot
index abac81f19e70..a703f5597c77 100644
--- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/1-TSESTree-AST.shot
@@ -8,6 +8,7 @@ Program {
type: "ExportDefaultDeclaration",
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,12 +19,15 @@ Program {
end: { column: 27, line: 4 },
},
},
+ declare: false,
decorators: [
Decorator {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "sealed",
+ optional: false,
range: [74, 80],
loc: {
@@ -41,7 +45,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Qux",
+ optional: false,
range: [102, 105],
loc: {
@@ -49,6 +55,7 @@ Program {
end: { column: 24, line: 4 },
},
},
+ implements: [],
superClass: null,
range: [96, 108],
diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/5-AST-Alignment-AST.shot
index aab5207c1cfc..e0c2bb34c55d 100644
--- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/snapshots/5-AST-Alignment-AST.shot
@@ -12,6 +12,7 @@ exports[`AST Fixtures legacy-fixtures class-decorators export-default-class-deco
type: 'ExportDefaultDeclaration',
declaration: ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -22,12 +23,15 @@ exports[`AST Fixtures legacy-fixtures class-decorators export-default-class-deco
end: { column: 27, line: 4 },
},
},
+- declare: false,
decorators: Array [
Decorator {
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'sealed',
+- optional: false,
range: [74, 80],
loc: {
@@ -45,7 +49,9 @@ exports[`AST Fixtures legacy-fixtures class-decorators export-default-class-deco
],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Qux',
+- optional: false,
range: [102, 105],
loc: {
@@ -53,6 +59,7 @@ exports[`AST Fixtures legacy-fixtures class-decorators export-default-class-deco
end: { column: 24, line: 4 },
},
},
+- implements: Array [],
superClass: null,
- range: [96, 108],
diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot
index c21177a9eba4..290ff765aedc 100644
--- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/1-TSESTree-AST.shot
@@ -9,6 +9,7 @@ Program {
assertions: [],
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -19,12 +20,15 @@ Program {
end: { column: 19, line: 4 },
},
},
+ declare: false,
decorators: [
Decorator {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "sealed",
+ optional: false,
range: [74, 80],
loc: {
@@ -42,7 +46,9 @@ Program {
],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Qux",
+ optional: false,
range: [94, 97],
loc: {
@@ -50,6 +56,7 @@ Program {
end: { column: 16, line: 4 },
},
},
+ implements: [],
superClass: null,
range: [88, 100],
diff --git a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot
index 129de117810a..d0ef16bd7f44 100644
--- a/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/snapshots/5-AST-Alignment-AST.shot
@@ -13,6 +13,7 @@ exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decora
assertions: Array [],
declaration: ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -23,12 +24,15 @@ exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decora
end: { column: 19, line: 4 },
},
},
+- declare: false,
decorators: Array [
Decorator {
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'sealed',
+- optional: false,
range: [74, 80],
loc: {
@@ -46,7 +50,9 @@ exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decora
],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Qux',
+- optional: false,
range: [94, 97],
loc: {
@@ -54,6 +60,7 @@ exports[`AST Fixtures legacy-fixtures class-decorators export-named-class-decora
end: { column: 16, line: 4 },
},
},
+- implements: Array [],
superClass: null,
- range: [88, 100],
diff --git a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/1-TSESTree-AST.shot
index 34a322c1be79..3bdfc6deac2f 100644
--- a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -23,7 +26,9 @@ Program {
type: "TSTypeAssertion",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [102, 105],
loc: {
@@ -35,7 +40,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [89, 92],
loc: {
@@ -65,6 +72,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [73, 106],
diff --git a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/5-AST-Alignment-AST.shot
index 72f39c2a9d75..e7bfc6ff2f75 100644
--- a/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/comments/fixtures/type-assertion-regression-test/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,96 @@
exports[`AST Fixtures legacy-fixtures comments type-assertion-regression-test AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [79, 82],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ init: TSTypeAssertion {
+ type: 'TSTypeAssertion',
+ expression: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [102, 105],
+ loc: {
+ start: { column: 1, line: 5 },
+ end: { column: 4, line: 5 },
+ },
+ },
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [89, 92],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+
+ range: [89, 92],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+
+ range: [85, 105],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 4, line: 5 },
+ },
+ },
+
+ range: [79, 105],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 4, line: 5 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [73, 106],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 5, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 107],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/1-TSESTree-AST.shot
index fa1b00d30dd1..674af2f29a5e 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/1-TSESTree-AST.shot
@@ -18,9 +18,12 @@ Program {
},
},
declare: true,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [96, 99],
loc: {
@@ -28,6 +31,7 @@ Program {
end: { column: 26, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 102],
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/5-AST-Alignment-AST.shot
index 5af6384c0158..2bb556fb9a33 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/abstract-class/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,55 @@
exports[`AST Fixtures legacy-fixtures declare abstract-class AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+ abstract: true,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [100, 102],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ declare: true,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [96, 99],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+- implements: Array [],
+ superClass: null,
+
+ range: [73, 102],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 103],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/1-TSESTree-AST.shot
index 21b0358d3fef..2d084540fd47 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -17,9 +18,12 @@ Program {
},
},
declare: true,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [87, 90],
loc: {
@@ -27,6 +31,7 @@ Program {
end: { column: 17, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 93],
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/5-AST-Alignment-AST.shot
index 87f188965e7c..88ee83e08811 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/class/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,55 @@
exports[`AST Fixtures legacy-fixtures declare class AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [],
+
+ range: [91, 93],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ declare: true,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [87, 90],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+- implements: Array [],
+ superClass: null,
+
+ range: [73, 93],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot
index 7286bec9b9ee..956fec5e84a7 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot
@@ -6,10 +6,13 @@ Program {
body: [
TSEnumDeclaration {
type: "TSEnumDeclaration",
+ const: false,
declare: true,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [86, 89],
loc: {
@@ -20,9 +23,12 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Bar",
+ optional: false,
range: [94, 97],
loc: {
@@ -39,9 +45,12 @@ Program {
},
TSEnumMember {
type: "TSEnumMember",
+ computed: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Baz",
+ optional: false,
range: [101, 104],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot
index be39111033ab..1ef1a9d0f0b7 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,88 @@
exports[`AST Fixtures legacy-fixtures declare enum AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSEnumDeclaration {
+ type: 'TSEnumDeclaration',
+- const: false,
+ declare: true,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [86, 89],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ members: Array [
+ TSEnumMember {
+ type: 'TSEnumMember',
+- computed: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Bar',
+- optional: false,
+
+ range: [94, 97],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+
+ range: [94, 97],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 5, line: 4 },
+ },
+ },
+ TSEnumMember {
+ type: 'TSEnumMember',
+- computed: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Baz',
+- optional: false,
+
+ range: [101, 104],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+
+ range: [101, 104],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 5, line: 5 },
+ },
+ },
+ ],
+
+ range: [73, 107],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 108],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 7 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/1-TSESTree-AST.shot
index 6340fab4fc2f..d623f02b8210 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [90, 93],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/5-AST-Alignment-AST.shot
index cef0cfc863ed..cd2704357cc3 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/function/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,63 @@
exports[`AST Fixtures legacy-fixtures declare function AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSDeclareFunction {
+ type: 'TSDeclareFunction',
+ async: false,
+ declare: true,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [90, 93],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ params: Array [],
+ returnType: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSVoidKeyword {
+ type: 'TSVoidKeyword',
+
+ range: [97, 101],
+ loc: {
+ start: { column: 24, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+
+ range: [95, 101],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+
+ range: [73, 102],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 103],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/1-TSESTree-AST.shot
index 23487f4ce1c0..cc9eddbeafab 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/1-TSESTree-AST.shot
@@ -17,9 +17,12 @@ Program {
},
},
declare: true,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [91, 94],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/5-AST-Alignment-AST.shot
index 13fe23e4d2a9..fb70f302dcc8 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/interface/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,52 @@
exports[`AST Fixtures legacy-fixtures declare interface AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSInterfaceDeclaration {
+ type: 'TSInterfaceDeclaration',
+ body: TSInterfaceBody {
+ type: 'TSInterfaceBody',
+ body: Array [],
+
+ range: [95, 97],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ declare: true,
+- extends: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [91, 94],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+
+ range: [73, 97],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 98],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot
index 8dacc4ec411f..5cc1db66c205 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/1-TSESTree-AST.shot
@@ -17,9 +17,12 @@ Program {
},
},
declare: true,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [88, 91],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot
index 575a9a6bd393..5060682c9ee7 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/module/snapshots/5-AST-Alignment-AST.shot
@@ -21,9 +21,12 @@ exports[`AST Fixtures legacy-fixtures declare module AST Alignment - AST 1`] = `
},
},
declare: true,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [88, 91],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-Babel-AST.shot
new file mode 100644
index 000000000000..34abdd0420bc
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-Babel-AST.shot
@@ -0,0 +1,46 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures declare namespace Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: Array [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: Array [],
+
+ range: [95, 97],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ declare: true,
+ id: Identifier {
+ type: "Identifier",
+ name: "Foo",
+
+ range: [91, 94],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+
+ range: [73, 97],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [73, 98],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+}
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot
index 3bb67741f110..2d4b418ebe61 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/1-TSESTree-AST.shot
@@ -17,9 +17,12 @@ Program {
},
},
declare: true,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [91, 94],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/2-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/2-Babel-Tokens.shot
new file mode 100644
index 000000000000..014f4d3e257a
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/2-Babel-Tokens.shot
@@ -0,0 +1,56 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures declare namespace Babel - Tokens 1`] = `
+Array [
+ Identifier {
+ type: "Identifier",
+ value: "declare",
+
+ range: [73, 80],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [81, 90],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [91, 94],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [95, 96],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [96, 97],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot
index ba41672f8430..967347feff5d 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/namespace/snapshots/5-AST-Alignment-AST.shot
@@ -21,9 +21,12 @@ exports[`AST Fixtures legacy-fixtures declare namespace AST Alignment - AST 1`]
},
},
declare: true,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [91, 94],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/1-TSESTree-AST.shot
index 20b1afc88e82..6f4e3b145e57 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/1-TSESTree-AST.shot
@@ -9,7 +9,9 @@ Program {
declare: true,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [86, 89],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot
index d425ca353e60..d47eb9051c4d 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/type-alias/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,50 @@
exports[`AST Fixtures legacy-fixtures declare type-alias AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+ declare: true,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [86, 89],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [92, 98],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 25, line: 3 },
+ },
+ },
+
+ range: [73, 99],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 100],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/1-TSESTree-AST.shot
index 1e7daf91eaff..802e2df12335 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/5-AST-Alignment-AST.shot
index 3dcece695fea..58499e81b157 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/variable/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,73 @@
exports[`AST Fixtures legacy-fixtures declare variable AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSAnyKeyword {
+ type: 'TSAnyKeyword',
+
+ range: [90, 93],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [88, 93],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [85, 93],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [85, 93],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+ declare: true,
+ kind: 'var',
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 95],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..60d72da36dd0
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends-implements Babel - Error 1`] = `[SyntaxError: Unexpected reserved word 'implements'. (3:18)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-TSESTree-Error.shot
index a645249de303..79b70db2f374 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends-implements TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends-implements TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | class Foo extends implements Bar {
+ | ^^^^^^^ 'extends' list cannot be empty.
+ 4 |
+ 5 | }
+ 6 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..d39f40658107
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/3-Alignment-Error.shot
index d39f40658107..9d6798ba38bf 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends-implements Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..4cf63d004827
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (6:0)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-TSESTree-Error.shot
index 403ed52cb6dd..f0fdcbf56a2b 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | class Foo extends {
+ | ^^^^^^^ 'extends' list cannot be empty.
+ 4 |
+ 5 | }
+ 6 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..797630b5f8c8
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/3-Alignment-Error.shot
index 797630b5f8c8..5074a50f9de0 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-empty-extends Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..0c3e448daa84
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-extends-empty-implements Babel - Error 1`] = `[SyntaxError: 'implements' list cannot be empty. (3:33)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-TSESTree-Error.shot
index 0a8ba11f7bcd..cc25ca4bc8e3 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-extends-empty-implements TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-extends-empty-implements TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | class Foo extends Bar implements {
+ | ^^^^^^^^^^ 'implements' list cannot be empty.
+ 4 |
+ 5 | }
+ 6 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..cda29807004a
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-extends-empty-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/3-Alignment-Error.shot
index cda29807004a..7b58138335d0 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-extends-empty-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-extends-empty-implements Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..ef0323f1248a
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-multiple-implements Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "," (3:21)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-TSESTree-Error.shot
index 1868f08ac3c9..c156a7ba5b6e 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-multiple-implements TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-multiple-implements TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | class a implements b implements c {}
+ | ^^^^^^^^^^^^ 'implements' clause already seen.
+ 4 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..519ad3a361f8
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-multiple-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/3-Alignment-Error.shot
index 519ad3a361f8..0fffeee4c5c2 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-multiple-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ class-multiple-implements Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..1111df2d4d55
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (3:5)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot
index bcb52edf68d0..3055b0dc4499 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | @dec enum E {}
+ | ^^^^ Decorators are not valid here."
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..17ba689c614b
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot
index 17ba689c614b..a6c9ea30e6f0 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-enum-declaration Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..4b9fe05a0db6
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-function Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (4:0)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-TSESTree-Error.shot
index 0d803ce647c5..ab74377190ca 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-function TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-function TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | @dec
+ | ^^^^ Decorators are not valid here.
+ 4 | function b(){}
+ 5 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..4c89abf9f72f
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-function Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/3-Alignment-Error.shot
index 4c89abf9f72f..875d107ab09f 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-function Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-function Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..46332174237d
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (4:0)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot
index 3905750f9aa5..45ea7f53044a 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | @deco()
+ | ^^^^^^^ Decorators are not valid here.
+ 4 | interface M {}"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..f7a4fa57521a
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot
index f7a4fa57521a..c8b6e5b79da0 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-interface-declaration Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..577ab6fdfd23
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Babel - Error 1`] = `[SyntaxError: Leading decorators must be attached to a class declaration. (4:0)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot
index 184f3d96b4d1..69123261b069 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | @deco()
+ | ^^^^^^^ Decorators are not valid here.
+ 4 | const a = 1
+ 5 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..1c90fdcf5406
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot
index 1c90fdcf5406..a48f982c9a85 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ decorator-on-variable Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..4992c1bda8ba
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression Babel - Error 1`] = `[SyntaxError: Unexpected token (3:4)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..c7ddaf4d3507
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..4330f2de54d1
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-new-expression Babel - Error 1`] = `[SyntaxError: Unexpected token (3:8)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..96ba6b3c25ae
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-new-expression Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..b9424b15c159
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments Babel - Error 1`] = `[SyntaxError: Type argument list cannot be empty. (3:14)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..231a4e0b03c8
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..12440d8874fa
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:11)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..04350071ad74
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..5bf5b3f2503c
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-constructor Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (4:13)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..406623be3732
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-constructor Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..108f139e0c1e
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-function-expression Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:20)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..e6cdab797b6c
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-function-expression Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..665c83f9988c
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-method-signature Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (4:6)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..a5fa26ec178e
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-method-signature Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..4e1cb147bbf1
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-method Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (4:6)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..bb1641bbb8ae
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-method Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..ae64111c78c0
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:11)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..14e18802b751
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..c16dc935997d
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ enum-with-keywords Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (3:7)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-TSESTree-Error.shot
index 264bd320faae..b90437fa5b2a 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ enum-with-keywords TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ enum-with-keywords TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | export private public protected static readonly abstract async enum X {}
+ | ^^^^^^^ 'private' modifier cannot appear on a module or namespace element."
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..ada94f82c3ab
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ enum-with-keywords Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/3-Alignment-Error.shot
index ada94f82c3ab..fd6c43a47044 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ enum-with-keywords Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ enum-with-keywords Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..c54798556f5f
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ index-signature-parameters Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "]" (4:12)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..9b3c693c259e
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ index-signature-parameters Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..edb821783089
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-empty-extends Babel - Error 1`] = `[SyntaxError: 'extends' list cannot be empty. (3:22)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..30ede9e96f27
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-empty-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..ddf064bf40fa
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-implements Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (3:12)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-TSESTree-Error.shot
index 292b542dcf51..bc87ac74bbf5 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-implements TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-implements TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | interface d implements e {}
+ | ^^^^^^^^^^^^ Interface declaration cannot have 'implements' clause.
+ 4 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..53470554fd31
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/3-Alignment-Error.shot
index 53470554fd31..15d3db96bf31 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-implements Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-implements Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..3bfdf5319d1a
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-export Babel - Error 1`] = `[SyntaxError: Unexpected token, expected ";" (4:9)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-TSESTree-Error.shot
index 4ed734c0a3d2..d601da71753a 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-export TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-export TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | export [baz: string]: string;
+ | ^^^^^^ 'export' modifier cannot appear on an index signature
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..36d9f4ef037f
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-export Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/3-Alignment-Error.shot
index 36d9f4ef037f..984bdc81d29e 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-export Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-export Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..55e7b4fae1c2
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-private Babel - Error 1`] = `[SyntaxError: 'private' modifier cannot appear on a type member. (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-TSESTree-Error.shot
index 13a96652b2b8..3940bf8f5ae6 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-private TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-private TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | private [baz: string]: string;
+ | ^^^^^^^ 'private' modifier cannot appear on an index signature
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..70ae64a4a824
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-private Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/3-Alignment-Error.shot
index 70ae64a4a824..1bf7e6a8b1e4 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-private Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-private Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..faf545c75f17
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-protected Babel - Error 1`] = `[SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-TSESTree-Error.shot
index b6d263475ee6..7147acc95765 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-protected TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-protected TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | protected [baz: string]: string;
+ | ^^^^^^^^^ 'protected' modifier cannot appear on an index signature
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..49a27a188b93
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-protected Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/3-Alignment-Error.shot
index 49a27a188b93..4c798313f87b 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-protected Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-protected Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..b92427a492b8
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-public Babel - Error 1`] = `[SyntaxError: 'public' modifier cannot appear on a type member. (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-TSESTree-Error.shot
index 0ca583aff845..d57bbb6da4ab 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-public TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-public TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | public [baz: string]: string;
+ | ^^^^^^ 'public' modifier cannot appear on an index signature
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..959f932de08c
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-public Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/3-Alignment-Error.shot
index 959f932de08c..50357e981e2b 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-public Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-public Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..f0cb1e241b2a
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-static Babel - Error 1`] = `[SyntaxError: 'static' modifier cannot appear on a type member. (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-TSESTree-Error.shot
index 1d5a7a35239a..e3b090eb8f01 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-static TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-static TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | static [baz: string]: string;
+ | ^^^^^^ 'static' modifier cannot appear on an index signature
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..1730fddc1735
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-static Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/3-Alignment-Error.shot
index 1730fddc1735..5267ec675b03 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-static Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-index-signature-static Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..ebb45418f678
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-export Babel - Error 1`] = `[SyntaxError: Unexpected token, expected ";" (4:11)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-TSESTree-Error.shot
index 9bffb118f219..02668d51abbd 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-export TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-export TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | export g(bar: string): void;
+ | ^^^^^^ 'export' modifier cannot appear on a type member
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..60a90127afa8
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-export Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/3-Alignment-Error.shot
index 60a90127afa8..6ea8f9cb251e 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-export Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-export Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..bfa1cb153913
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-private Babel - Error 1`] = `[SyntaxError: 'private' modifier cannot appear on a type member. (4:4)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-TSESTree-Error.shot
index 131a13aa7eec..b3cd691f7f0b 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-private TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-private TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | private g(bar: string): void;
+ | ^^^^^^^ 'private' modifier cannot appear on a type member
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..2afbbf45ed3c
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-private Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/3-Alignment-Error.shot
index 2afbbf45ed3c..910e9cc77aff 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-private Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-private Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..b78ab26d2d6f
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-protected Babel - Error 1`] = `[SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-TSESTree-Error.shot
index 2976cbb6ecf4..33f41f8ba616 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-protected TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-protected TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | protected g(bar: string): void;
+ | ^^^^^^^^^ 'protected' modifier cannot appear on a type member
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..0af7e82ad38f
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-protected Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/3-Alignment-Error.shot
index 0af7e82ad38f..c022672d659d 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-protected Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-protected Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..93ed430d9703
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-public Babel - Error 1`] = `[SyntaxError: 'public' modifier cannot appear on a type member. (4:4)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-TSESTree-Error.shot
index 32cb1ca974d9..bf76c446e284 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-public TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-public TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | public g(bar: string): void;
+ | ^^^^^^ 'public' modifier cannot appear on a type member
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..0a09195bd844
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-public Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/3-Alignment-Error.shot
index 0a09195bd844..61705bea29d2 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-public Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-public Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..10b06c120064
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-readonly Babel - Error 1`] = `[SyntaxError: 'readonly' modifier can only appear on a property declaration or index signature. (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-TSESTree-Error.shot
index 34d6269d02dd..7d3f94f66391 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-readonly TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-readonly TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | readonly g(bar: string): void;
+ | ^^^^^^^^ 'readonly' modifier can only appear on a property declaration or index signature.
+ 5 | }
+ 6 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..062e4baddd0a
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-readonly Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/3-Alignment-Error.shot
index 062e4baddd0a..9f0aaf74ac0e 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-readonly Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-readonly Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..abb471fc9c10
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-static Babel - Error 1`] = `[SyntaxError: 'static' modifier cannot appear on a type member. (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-TSESTree-Error.shot
index 01ec4dc383c1..55732d2bf4ac 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-static TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-static TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | static g(bar: string): void;
+ | ^^^^^^ 'static' modifier cannot appear on a type member
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..0cb366cff167
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-static Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/3-Alignment-Error.shot
index 0cb366cff167..a4a703dca99d 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-static Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-method-static Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..000b5cdd2478
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-multiple-extends Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "," (3:26)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..12254d1b48a1
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-multiple-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..01bd31b00cb4
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-export Babel - Error 1`] = `[SyntaxError: Unexpected token, expected ";" (4:9)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-TSESTree-Error.shot
index cd7457e48906..8cf3e746b6d5 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-export TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-export TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | export a: string;
+ | ^^^^^^ 'export' modifier cannot appear on a type member
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..62a5bb600657
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-export Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/3-Alignment-Error.shot
index 62a5bb600657..f62e1bd6555c 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-export Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-export Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..2808f07b4501
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-private Babel - Error 1`] = `[SyntaxError: 'private' modifier cannot appear on a type member. (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-TSESTree-Error.shot
index c9e45d49f90e..74e32d60e43f 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-private TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-private TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | private b: string;
+ | ^^^^^^^ 'private' modifier cannot appear on a type member
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..3a57033e136d
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-private Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/3-Alignment-Error.shot
index 3a57033e136d..a5c250cd314d 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-private Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-private Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..9af6d30fe85c
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-protected Babel - Error 1`] = `[SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-TSESTree-Error.shot
index 945a89aeb8ee..4ae03bf38901 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-protected TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-protected TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | protected a: string;
+ | ^^^^^^^^^ 'protected' modifier cannot appear on a type member
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..65e263e1264d
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-protected Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/3-Alignment-Error.shot
index 65e263e1264d..11ddafba81b7 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-protected Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-protected Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..af650dc52873
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-public Babel - Error 1`] = `[SyntaxError: 'public' modifier cannot appear on a type member. (4:4)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-TSESTree-Error.shot
index 0beb40de9876..43f06b1fa7c0 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-public TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-public TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | public a: string;
+ | ^^^^^^ 'public' modifier cannot appear on a type member
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..6fe49dd919f1
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-public Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/3-Alignment-Error.shot
index 6fe49dd919f1..b4deaff7a34f 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-public Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-public Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..6e667a50f6a3
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-static Babel - Error 1`] = `[SyntaxError: 'static' modifier cannot appear on a type member. (4:2)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-TSESTree-Error.shot
index 4e3c66ceceac..eb8d16d999f1 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-static TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-static TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | static a: string;
+ | ^^^^^^ 'static' modifier cannot appear on a type member
+ 5 | }
+ 6 |
+ 7 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..6e4940eb9ba6
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-static Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/3-Alignment-Error.shot
index 6e4940eb9ba6..bdd3d8671962 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-static Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-static Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..4b4b6efa0c57
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-with-default-value Babel - Error 1`] = `[SyntaxError: Unexpected token, expected ";" (4:14)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-TSESTree-Error.shot
index 2833ac9eb8f0..9e58d0d16033 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-with-default-value TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-with-default-value TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo {
+> 4 | bar: string = 'a';
+ | ^^^ A property signature cannot have an initializer.
+ 5 | }
+ 6 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..7b334875fc2d
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-with-default-value Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/3-Alignment-Error.shot
index 7b334875fc2d..19cbad977fbd 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-with-default-value Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-property-with-default-value Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..dc6c9ef4c0b7
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-no-body Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (4:0)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-TSESTree-Error.shot
index 2a48d4763193..95bd5eb7ffcf 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-no-body TSESTree - Error 1`] = `[TSError: '{' expected.]`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-no-body TSESTree - Error 1`] = `
+"TSError
+ 2 |
+ 3 | interface Foo
+> 4 |
+ | ^ '{' expected."
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..89ed2b199bb8
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-no-body Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..ae8600ccfdc3
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-optional-index-signature Babel - Error 1`] = `[SyntaxError: Unexpected token (4:7)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..0ae40614620b
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ interface-with-optional-index-signature Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..f18a58b39b2b
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-assertion-not-allowed Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "," (3:3)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-TSESTree-Error.shot
index 099a62b2b6ed..4ed8a518fdce 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-assertion-not-allowed TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-assertion-not-allowed TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | ({a!} = {})
+ | ^ A shorthand property assignment cannot have an exclamation token.
+ 4 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..2b47812c46cd
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-assertion-not-allowed Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/3-Alignment-Error.shot
index 2b47812c46cd..878ae2828d2d 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-assertion-not-allowed Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-assertion-not-allowed Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..373217628a29
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-optional-not-allowed Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "," (3:3)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-TSESTree-Error.shot
index 5f118120b57c..684488f02c2b 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-optional-not-allowed TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-optional-not-allowed TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | ({a?} = {})
+ | ^ A shorthand property assignment cannot have a question token.
+ 4 |"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..31aaad026ea5
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-optional-not-allowed Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/3-Alignment-Error.shot
index 31aaad026ea5..8579fdd31e62 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-optional-not-allowed Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ object-optional-not-allowed Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..4866de224eb4
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Babel - Error 1`] = `[SyntaxError: Unexpected token (3:5)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot
index acfafbcff24c..c178e7e591b5 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const TSESTree - Error 1`] = `"NO ERROR"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const TSESTree - Error 1`] = `
+"TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | const
+ | ^^^^^ A variable declaration list must have at least one variable declarator."
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..5ba96a6641ee
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot
index 5ba96a6641ee..2afa3285defb 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/3-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ solo-const Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..4f730913d192
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures expressions _error_ instantiation-expression Babel - Error 1`] = `"NO ERROR"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-TSESTree-Error.shot
index 1f60a6e34020..8064f9d96543 100644
--- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/1-TSESTree-Error.shot
@@ -1,3 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures expressions _error_ instantiation-expression TSESTree - Error 1`] = `[TSError: Expression expected.]`;
+exports[`AST Fixtures legacy-fixtures expressions _error_ instantiation-expression TSESTree - Error 1`] = `
+"TSError
+ 3 | a;
+ 4 |
+> 5 | a;
+ | ^ Expression expected.
+ 6 | a();
+ 7 | a?.();
+ 8 | a?.b();"
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..7a72a183ff52
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures expressions _error_ instantiation-expression Error Alignment 1`] = `"TSESTree errored but Babel didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot
index 17050128c74c..c12e069a6505 100644
--- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/1-TSESTree-AST.shot
@@ -11,7 +11,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [73, 76],
loc: {
@@ -20,14 +22,16 @@ Program {
},
},
optional: false,
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [77, 78],
loc: {
@@ -71,7 +75,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [83, 86],
loc: {
@@ -80,7 +86,7 @@ Program {
},
},
optional: false,
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSNumberKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
index 37371563dade..b49a2455c85a 100644
--- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,137 @@
exports[`AST Fixtures legacy-fixtures expressions call-expression-type-arguments AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [73, 76],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ optional: false,
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [77, 78],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 5, line: 3 },
+ },
+ },
+
+ range: [77, 78],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 5, line: 3 },
+ },
+ },
+ ],
+
+ range: [76, 79],
+ loc: {
+ start: { column: 3, line: 3 },
+ end: { column: 6, line: 3 },
+ },
+ },
+
+ range: [73, 81],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [73, 82],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [83, 86],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 3, line: 4 },
+ },
+ },
+ optional: false,
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [87, 93],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 10, line: 4 },
+ },
+ },
+ ],
+
+ range: [86, 94],
+ loc: {
+ start: { column: 3, line: 4 },
+ end: { column: 11, line: 4 },
+ },
+ },
+
+ range: [83, 96],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 13, line: 4 },
+ },
+ },
+
+ range: [83, 97],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 98],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot
index 406d14deb915..f34ef6e5f0e3 100644
--- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [79, 80],
loc: {
@@ -24,7 +27,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [87, 88],
loc: {
@@ -32,14 +37,16 @@ Program {
end: { column: 15, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [89, 90],
loc: {
@@ -77,6 +84,7 @@ Program {
},
},
],
+ declare: false,
kind: "const",
range: [73, 94],
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
index 09f148a90833..2786d19fdd3d 100644
--- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/new-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,109 @@
exports[`AST Fixtures legacy-fixtures expressions new-expression-type-arguments AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [79, 80],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ init: NewExpression {
+ type: 'NewExpression',
+ arguments: Array [],
+ callee: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [87, 88],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'B',
+- optional: false,
+
+ range: [89, 90],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [89, 90],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ ],
+
+ range: [88, 91],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+
+ range: [83, 93],
+ loc: {
+ start: { column: 10, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [79, 93],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 95],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot
index 3c9e84b61772..38b8c0d7eecd 100644
--- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/1-TSESTree-AST.shot
@@ -16,7 +16,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [73, 76],
loc: {
@@ -27,7 +29,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [78, 81],
loc: {
@@ -43,14 +47,16 @@ Program {
},
},
optional: false,
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [82, 83],
loc: {
@@ -106,7 +112,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [88, 91],
loc: {
@@ -117,7 +125,9 @@ Program {
optional: true,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [93, 96],
loc: {
@@ -133,7 +143,7 @@ Program {
},
},
optional: false,
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSNumberKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
index f0db811ffaff..e040ed835e20 100644
--- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,201 @@
exports[`AST Fixtures legacy-fixtures expressions optional-call-expression-type-arguments AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [73, 76],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [73, 81],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ optional: false,
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [82, 83],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+
+ range: [82, 83],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+ ],
+
+ range: [81, 84],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+
+ range: [73, 86],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [73, 86],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [73, 87],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: ChainExpression {
+ type: 'ChainExpression',
+ expression: CallExpression {
+ type: 'CallExpression',
+ arguments: Array [],
+ callee: MemberExpression {
+ type: 'MemberExpression',
+ computed: false,
+ object: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [88, 91],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 3, line: 4 },
+ },
+ },
+ optional: true,
+ property: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [93, 96],
+ loc: {
+ start: { column: 5, line: 4 },
+ end: { column: 8, line: 4 },
+ },
+ },
+
+ range: [88, 96],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 8, line: 4 },
+ },
+ },
+ optional: false,
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [97, 103],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 15, line: 4 },
+ },
+ },
+ ],
+
+ range: [96, 104],
+ loc: {
+ start: { column: 8, line: 4 },
+ end: { column: 16, line: 4 },
+ },
+ },
+
+ range: [88, 106],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 18, line: 4 },
+ },
+ },
+
+ range: [88, 106],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 18, line: 4 },
+ },
+ },
+
+ range: [88, 107],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 19, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 108],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot
index 8b0f3adc6849..faa9dd7a7f4d 100644
--- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/1-TSESTree-AST.shot
@@ -36,7 +36,9 @@ Program {
},
tag: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [73, 76],
loc: {
@@ -44,14 +46,16 @@ Program {
end: { column: 3, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [77, 80],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
index 63ff0bf8c59c..dcf8eb70d961 100644
--- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,108 @@
exports[`AST Fixtures legacy-fixtures expressions tagged-template-expression-type-arguments AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ExpressionStatement {
+ type: 'ExpressionStatement',
+ expression: TaggedTemplateExpression {
+ type: 'TaggedTemplateExpression',
+ quasi: TemplateLiteral {
+ type: 'TemplateLiteral',
+ expressions: Array [],
+ quasis: Array [
+ TemplateElement {
+ type: 'TemplateElement',
+ tail: true,
+ value: Object {
+ 'cooked': 'baz',
+ 'raw': 'baz',
+ },
+
+ range: [81, 86],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ ],
+
+ range: [81, 86],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ tag: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [73, 76],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'bar',
+- optional: false,
+
+ range: [77, 80],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+
+ range: [77, 80],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ ],
+
+ range: [76, 81],
+ loc: {
+ start: { column: 3, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [73, 86],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [73, 87],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 88],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot
index 8bcb096af8c3..8cd61f41b49d 100644
--- a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -32,7 +33,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "onlyRead",
+ optional: false,
range: [86, 94],
loc: {
@@ -58,7 +61,9 @@ Program {
],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "instanceMethod",
+ optional: false,
range: [104, 118],
loc: {
@@ -67,6 +72,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -82,6 +88,7 @@ Program {
end: { column: 21, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -108,9 +115,13 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [79, 80],
loc: {
@@ -118,6 +129,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 125],
diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot
index a4c8ddcb124c..af49176862ae 100644
--- a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -36,7 +37,9 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'onlyRead',
+- optional: false,
range: [86, 94],
loc: {
@@ -62,7 +65,9 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'instanceMethod',
+- optional: false,
range: [104, 118],
loc: {
@@ -71,6 +76,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -86,6 +92,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
end: { column: 21, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -112,9 +119,13 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
end: { column: 1, line: 6 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [79, 80],
loc: {
@@ -122,6 +133,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 125],
diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot
index 1ba188270935..5abb782c8617 100644
--- a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -32,7 +33,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [86, 89],
loc: {
@@ -58,7 +61,9 @@ Program {
],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "staticMethod",
+ optional: false,
range: [106, 118],
loc: {
@@ -67,6 +72,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: true,
value: FunctionExpression {
@@ -82,6 +88,7 @@ Program {
end: { column: 26, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -108,9 +115,13 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [79, 80],
loc: {
@@ -118,6 +129,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 125],
diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot
index 1e97f5d5c088..e4b0d9dadc87 100644
--- a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -36,7 +37,9 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [86, 89],
loc: {
@@ -62,7 +65,9 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'staticMethod',
+- optional: false,
range: [106, 118],
loc: {
@@ -71,6 +76,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
},
},
kind: 'method',
+- optional: false,
- override: false,
static: true,
value: FunctionExpression {
@@ -86,6 +92,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
end: { column: 26, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -112,9 +119,13 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
end: { column: 1, line: 6 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [79, 80],
loc: {
@@ -122,6 +133,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-factory
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 125],
diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/1-TSESTree-AST.shot
index a1e1b7adeea2..97a8f4687a69 100644
--- a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -17,7 +18,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "onlyRead",
+ optional: false,
range: [86, 94],
loc: {
@@ -35,7 +38,9 @@ Program {
],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "instanceMethod",
+ optional: false,
range: [97, 111],
loc: {
@@ -44,6 +49,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -59,6 +65,7 @@ Program {
end: { column: 21, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -85,9 +92,13 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [79, 80],
loc: {
@@ -95,6 +106,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
index fa544c6a3e88..9638d96862e4 100644
--- a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instanc
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -21,7 +22,9 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instanc
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'onlyRead',
+- optional: false,
range: [86, 94],
loc: {
@@ -39,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instanc
],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'instanceMethod',
+- optional: false,
range: [97, 111],
loc: {
@@ -48,6 +53,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instanc
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -63,6 +69,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instanc
end: { column: 21, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -89,9 +96,13 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instanc
end: { column: 1, line: 6 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [79, 80],
loc: {
@@ -99,6 +110,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-instanc
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/1-TSESTree-AST.shot
index e0879aad4f7f..535c073cbc96 100644
--- a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -17,7 +18,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [86, 89],
loc: {
@@ -35,7 +38,9 @@ Program {
],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "staticMethod",
+ optional: false,
range: [99, 111],
loc: {
@@ -44,6 +49,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: true,
value: FunctionExpression {
@@ -59,6 +65,7 @@ Program {
end: { column: 26, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -85,9 +92,13 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "D",
+ optional: false,
range: [79, 80],
loc: {
@@ -95,6 +106,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
index 4b4f60f3ffa6..27639e3a67bb 100644
--- a/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/method-decorators/fixtures/method-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -21,7 +22,9 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [86, 89],
loc: {
@@ -39,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-
],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'staticMethod',
+- optional: false,
range: [99, 111],
loc: {
@@ -48,6 +53,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-
},
},
kind: 'method',
+- optional: false,
- override: false,
static: true,
value: FunctionExpression {
@@ -63,6 +69,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-
end: { column: 26, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -89,9 +96,13 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-
end: { column: 1, line: 6 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'D',
+- optional: false,
range: [79, 80],
loc: {
@@ -99,6 +110,7 @@ exports[`AST Fixtures legacy-fixtures method-decorators method-decorator-static-
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot
index 6f6ba7b18771..85106e819d04 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/1-TSESTree-AST.shot
@@ -29,7 +29,9 @@ Program {
type: "ImportDefaultSpecifier",
local: Identifier {
type: "Identifier",
+ decorators: [],
name: "fs",
+ optional: false,
range: [114, 116],
loc: {
@@ -61,6 +63,7 @@ Program {
},
},
declare: true,
+ global: false,
id: Literal {
type: "Literal",
raw: "'i-use-things'",
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot
index a4bb38eda3cb..c77ae1fc5efb 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/ambient-module-declaration-with-import/snapshots/5-AST-Alignment-AST.shot
@@ -33,7 +33,9 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules ambient-module-decl
type: 'ImportDefaultSpecifier',
local: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'fs',
+- optional: false,
range: [114, 116],
loc: {
@@ -65,6 +67,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules ambient-module-decl
},
},
declare: true,
+- global: false,
id: Literal {
type: 'Literal',
raw: '\\'i-use-things\\'',
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-Babel-AST.shot
new file mode 100644
index 000000000000..d153d51196f0
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-Babel-AST.shot
@@ -0,0 +1,160 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-with-exported-function Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: Array [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: Array [
+ ExportNamedDeclaration {
+ type: "ExportNamedDeclaration",
+ assertions: Array [],
+ declaration: TSDeclareFunction {
+ type: "TSDeclareFunction",
+ async: false,
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: "Identifier",
+ name: "select",
+
+ range: [114, 120],
+ loc: {
+ start: { column: 18, line: 4 },
+ end: { column: 24, line: 4 },
+ },
+ },
+ params: Array [
+ Identifier {
+ type: "Identifier",
+ name: "selector",
+ typeAnnotation: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSStringKeyword {
+ type: "TSStringKeyword",
+
+ range: [131, 137],
+ loc: {
+ start: { column: 35, line: 4 },
+ end: { column: 41, line: 4 },
+ },
+ },
+
+ range: [129, 137],
+ loc: {
+ start: { column: 33, line: 4 },
+ end: { column: 41, line: 4 },
+ },
+ },
+
+ range: [121, 137],
+ loc: {
+ start: { column: 25, line: 4 },
+ end: { column: 41, line: 4 },
+ },
+ },
+ ],
+ returnType: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSTypeReference {
+ type: "TSTypeReference",
+ typeName: Identifier {
+ type: "Identifier",
+ name: "Selection",
+
+ range: [140, 149],
+ loc: {
+ start: { column: 44, line: 4 },
+ end: { column: 53, line: 4 },
+ },
+ },
+ typeParameters: TSTypeParameterInstantiation {
+ type: "TSTypeParameterInstantiation",
+ params: Array [
+ TSAnyKeyword {
+ type: "TSAnyKeyword",
+
+ range: [150, 153],
+ loc: {
+ start: { column: 54, line: 4 },
+ end: { column: 57, line: 4 },
+ },
+ },
+ ],
+
+ range: [149, 154],
+ loc: {
+ start: { column: 53, line: 4 },
+ end: { column: 58, line: 4 },
+ },
+ },
+
+ range: [140, 154],
+ loc: {
+ start: { column: 44, line: 4 },
+ end: { column: 58, line: 4 },
+ },
+ },
+
+ range: [138, 154],
+ loc: {
+ start: { column: 42, line: 4 },
+ end: { column: 58, line: 4 },
+ },
+ },
+
+ range: [105, 155],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 59, line: 4 },
+ },
+ },
+ exportKind: "value",
+ source: null,
+ specifiers: Array [],
+
+ range: [98, 155],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 59, line: 4 },
+ },
+ },
+ ],
+
+ range: [94, 157],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ declare: true,
+ id: Identifier {
+ type: "Identifier",
+ name: "d3",
+
+ range: [91, 93],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [73, 157],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+ ],
+ sourceType: "module",
+
+ range: [73, 158],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+}
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot
index 7a9520eefe6b..bc1ef7402cc8 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/1-TSESTree-AST.shot
@@ -15,11 +15,14 @@ Program {
declaration: TSDeclareFunction {
type: "TSDeclareFunction",
async: false,
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "select",
+ optional: false,
range: [114, 120],
loc: {
@@ -30,7 +33,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "selector",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -61,17 +66,7 @@ Program {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Selection",
-
- range: [140, 149],
- loc: {
- start: { column: 44, line: 4 },
- end: { column: 53, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSAnyKeyword {
@@ -91,6 +86,18 @@ Program {
end: { column: 58, line: 4 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Selection",
+ optional: false,
+
+ range: [140, 149],
+ loc: {
+ start: { column: 44, line: 4 },
+ end: { column: 53, line: 4 },
+ },
+ },
range: [140, 154],
loc: {
@@ -131,9 +138,12 @@ Program {
},
},
declare: true,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "d3",
+ optional: false,
range: [91, 93],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/2-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/2-Babel-Tokens.shot
new file mode 100644
index 000000000000..3461c38ebce4
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/2-Babel-Tokens.shot
@@ -0,0 +1,196 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-with-exported-function Babel - Tokens 1`] = `
+Array [
+ Identifier {
+ type: "Identifier",
+ value: "declare",
+
+ range: [73, 80],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [81, 90],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "d3",
+
+ range: [91, 93],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [94, 95],
+ loc: {
+ start: { column: 21, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "export",
+
+ range: [98, 104],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 8, line: 4 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "function",
+
+ range: [105, 113],
+ loc: {
+ start: { column: 9, line: 4 },
+ end: { column: 17, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "select",
+
+ range: [114, 120],
+ loc: {
+ start: { column: 18, line: 4 },
+ end: { column: 24, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [120, 121],
+ loc: {
+ start: { column: 24, line: 4 },
+ end: { column: 25, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "selector",
+
+ range: [121, 129],
+ loc: {
+ start: { column: 25, line: 4 },
+ end: { column: 33, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [129, 130],
+ loc: {
+ start: { column: 33, line: 4 },
+ end: { column: 34, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "string",
+
+ range: [131, 137],
+ loc: {
+ start: { column: 35, line: 4 },
+ end: { column: 41, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [137, 138],
+ loc: {
+ start: { column: 41, line: 4 },
+ end: { column: 42, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [138, 139],
+ loc: {
+ start: { column: 42, line: 4 },
+ end: { column: 43, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Selection",
+
+ range: [140, 149],
+ loc: {
+ start: { column: 44, line: 4 },
+ end: { column: 53, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [149, 150],
+ loc: {
+ start: { column: 53, line: 4 },
+ end: { column: 54, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "any",
+
+ range: [150, 153],
+ loc: {
+ start: { column: 54, line: 4 },
+ end: { column: 57, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [153, 154],
+ loc: {
+ start: { column: 57, line: 4 },
+ end: { column: 58, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [154, 155],
+ loc: {
+ start: { column: 58, line: 4 },
+ end: { column: 59, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [156, 157],
+ loc: {
+ start: { column: 0, line: 5 },
+ end: { column: 1, line: 5 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot
index 0281bcdcbc15..8732ff7462b1 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/declare-namespace-with-exported-function/snapshots/5-AST-Alignment-AST.shot
@@ -19,11 +19,14 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w
declaration: TSDeclareFunction {
type: 'TSDeclareFunction',
async: false,
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'select',
+- optional: false,
range: [114, 120],
loc: {
@@ -34,7 +37,9 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'selector',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -65,17 +70,18 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'Selection',
-
- range: [140, 149],
- loc: {
- start: { column: 44, line: 4 },
- end: { column: 53, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Selection',
++
++ range: [140, 149],
++ loc: {
++ start: { column: 44, line: 4 },
++ end: { column: 53, line: 4 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSAnyKeyword {
@@ -95,7 +101,19 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w
end: { column: 58, line: 4 },
},
},
-
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Selection',
+- optional: false,
+
+- range: [140, 149],
+- loc: {
+- start: { column: 44, line: 4 },
+- end: { column: 53, line: 4 },
+- },
+- },
+-
range: [140, 154],
loc: {
start: { column: 44, line: 4 },
@@ -135,9 +153,12 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules declare-namespace-w
},
},
declare: true,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'd3',
+- optional: false,
range: [91, 93],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-Babel-AST.shot
new file mode 100644
index 000000000000..138b3944413d
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-Babel-AST.shot
@@ -0,0 +1,108 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-declaration Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: Array [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: Array [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: Array [],
+
+ range: [114, 116],
+ loc: {
+ start: { column: 24, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+ declare: true,
+ id: Identifier {
+ type: "Identifier",
+ name: "global",
+
+ range: [107, 113],
+ loc: {
+ start: { column: 17, line: 4 },
+ end: { column: 23, line: 4 },
+ },
+ },
+
+ range: [92, 116],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: Array [],
+
+ range: [144, 146],
+ loc: {
+ start: { column: 27, line: 5 },
+ end: { column: 29, line: 5 },
+ },
+ },
+ declare: true,
+ id: Identifier {
+ type: "Identifier",
+ name: "global",
+
+ range: [137, 143],
+ loc: {
+ start: { column: 20, line: 5 },
+ end: { column: 26, line: 5 },
+ },
+ },
+
+ range: [119, 146],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 29, line: 5 },
+ },
+ },
+ ],
+
+ range: [88, 148],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ declare: true,
+ global: true,
+ id: Identifier {
+ type: "Identifier",
+ name: "global",
+
+ range: [81, 87],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [73, 148],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [73, 149],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 7 },
+ },
+}
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot
index 1d9549b200dd..19d5df14c2b8 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/1-TSESTree-AST.shot
@@ -22,9 +22,12 @@ Program {
},
},
declare: true,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "global",
+ optional: false,
range: [107, 113],
loc: {
@@ -53,9 +56,12 @@ Program {
},
},
declare: true,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "global",
+ optional: false,
range: [137, 143],
loc: {
@@ -83,7 +89,9 @@ Program {
global: true,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "global",
+ optional: false,
range: [81, 87],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/2-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/2-Babel-Tokens.shot
new file mode 100644
index 000000000000..dcc869e00d23
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/2-Babel-Tokens.shot
@@ -0,0 +1,146 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-declaration Babel - Tokens 1`] = `
+Array [
+ Identifier {
+ type: "Identifier",
+ value: "declare",
+
+ range: [73, 80],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 7, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "global",
+
+ range: [81, 87],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [88, 89],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "declare",
+
+ range: [92, 99],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "module",
+
+ range: [100, 106],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 16, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "global",
+
+ range: [107, 113],
+ loc: {
+ start: { column: 17, line: 4 },
+ end: { column: 23, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [114, 115],
+ loc: {
+ start: { column: 24, line: 4 },
+ end: { column: 25, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [115, 116],
+ loc: {
+ start: { column: 25, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "declare",
+
+ range: [119, 126],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "namespace",
+
+ range: [127, 136],
+ loc: {
+ start: { column: 10, line: 5 },
+ end: { column: 19, line: 5 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "global",
+
+ range: [137, 143],
+ loc: {
+ start: { column: 20, line: 5 },
+ end: { column: 26, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [144, 145],
+ loc: {
+ start: { column: 27, line: 5 },
+ end: { column: 28, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [145, 146],
+ loc: {
+ start: { column: 28, line: 5 },
+ end: { column: 29, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [147, 148],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 1, line: 6 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot
index 3256de744361..369d392b0bb2 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/global-module-declaration/snapshots/5-AST-Alignment-AST.shot
@@ -26,9 +26,12 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-decla
},
},
declare: true,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'global',
+- optional: false,
range: [107, 113],
loc: {
@@ -57,9 +60,12 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-decla
},
},
declare: true,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'global',
+- optional: false,
range: [137, 143],
loc: {
@@ -87,7 +93,9 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules global-module-decla
global: true,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'global',
+- optional: false,
range: [81, 87],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot
index 8995a4b18b96..95abe8bc166d 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/1-TSESTree-AST.shot
@@ -13,15 +13,19 @@ Program {
type: "ExportDefaultDeclaration",
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "method",
+ optional: false,
range: [119, 125],
loc: {
@@ -30,6 +34,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -45,6 +50,7 @@ Program {
end: { column: 18, line: 5 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -55,7 +61,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [129, 130],
loc: {
@@ -99,9 +107,13 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [111, 112],
loc: {
@@ -109,6 +121,7 @@ Program {
end: { column: 24, line: 4 },
},
},
+ implements: [],
superClass: null,
range: [105, 137],
@@ -140,11 +153,14 @@ Program {
end: { column: 34, line: 7 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [164, 167],
loc: {
@@ -176,6 +192,8 @@ Program {
end: { column: 1, line: 8 },
},
},
+ declare: false,
+ global: false,
id: Literal {
type: "Literal",
raw: "'foo'",
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot
index 8c520bc89571..0ea1f6bf795d 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/module-with-default-exports/snapshots/5-AST-Alignment-AST.shot
@@ -17,15 +17,19 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default
type: 'ExportDefaultDeclaration',
declaration: ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'method',
+- optional: false,
range: [119, 125],
loc: {
@@ -34,6 +38,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -49,6 +54,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default
end: { column: 18, line: 5 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -59,7 +65,9 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [129, 130],
loc: {
@@ -103,9 +111,13 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default
end: { column: 3, line: 6 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [111, 112],
loc: {
@@ -113,6 +125,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default
end: { column: 24, line: 4 },
},
},
+- implements: Array [],
superClass: null,
range: [105, 137],
@@ -144,11 +157,14 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default
end: { column: 34, line: 7 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [164, 167],
loc: {
@@ -180,6 +196,8 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules module-with-default
end: { column: 1, line: 8 },
},
},
+- declare: false,
+- global: false,
id: Literal {
type: 'Literal',
raw: '\\'foo\\'',
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot
index 7a69ae733f8d..1c290645bdc6 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot
@@ -17,9 +17,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [97, 98],
loc: {
@@ -46,6 +49,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [93, 115],
@@ -69,15 +73,19 @@ Program {
assertions: [],
declaration: ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [143, 154],
loc: {
@@ -86,6 +94,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -101,6 +110,7 @@ Program {
end: { column: 54, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -108,9 +118,13 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "public",
+ decorators: [],
+ override: false,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -136,6 +150,8 @@ Program {
end: { column: 32, line: 6 },
},
},
+ readonly: false,
+ static: false,
range: [155, 171],
loc: {
@@ -146,9 +162,13 @@ Program {
TSParameterProperty {
type: "TSParameterProperty",
accessibility: "public",
+ decorators: [],
+ override: false,
parameter: Identifier {
type: "Identifier",
+ decorators: [],
name: "y",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -174,6 +194,8 @@ Program {
end: { column: 50, line: 6 },
},
},
+ readonly: false,
+ static: false,
range: [173, 189],
loc: {
@@ -204,9 +226,13 @@ Program {
end: { column: 3, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Point",
+ optional: false,
range: [131, 136],
loc: {
@@ -214,6 +240,7 @@ Program {
end: { column: 20, line: 5 },
},
},
+ implements: [],
superClass: null,
range: [125, 197],
@@ -253,7 +280,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "name",
+ optional: false,
range: [250, 254],
loc: {
@@ -261,6 +290,9 @@ Program {
end: { column: 10, line: 10 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -294,9 +326,13 @@ Program {
end: { column: 5, line: 11 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Id",
+ optional: false,
range: [239, 241],
loc: {
@@ -329,9 +365,13 @@ Program {
end: { column: 3, line: 12 },
},
},
+ declare: false,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [214, 215],
loc: {
@@ -365,9 +405,13 @@ Program {
end: { column: 1, line: 13 },
},
},
+ declare: false,
+ global: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [80, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot
index e56b3755388b..dd7ddcca6f73 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot
@@ -21,9 +21,12 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
range: [97, 98],
loc: {
@@ -50,6 +53,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
},
},
],
+- declare: false,
kind: 'var',
range: [93, 115],
@@ -73,15 +77,19 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
assertions: Array [],
declaration: ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [143, 154],
loc: {
@@ -90,6 +98,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -105,6 +114,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
end: { column: 54, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -112,9 +122,13 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'public',
+- decorators: Array [],
+- override: false,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -140,6 +154,8 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
end: { column: 32, line: 6 },
},
},
+- readonly: false,
+- static: false,
range: [155, 171],
loc: {
@@ -150,9 +166,13 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
TSParameterProperty {
type: 'TSParameterProperty',
accessibility: 'public',
+- decorators: Array [],
+- override: false,
parameter: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'y',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -178,6 +198,8 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
end: { column: 50, line: 6 },
},
},
+- readonly: false,
+- static: false,
range: [173, 189],
loc: {
@@ -208,9 +230,13 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
end: { column: 3, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Point',
+- optional: false,
range: [131, 136],
loc: {
@@ -218,6 +244,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
end: { column: 20, line: 5 },
},
},
+- implements: Array [],
superClass: null,
range: [125, 197],
@@ -257,7 +284,9 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'name',
+- optional: false,
range: [250, 254],
loc: {
@@ -265,6 +294,9 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
end: { column: 10, line: 10 },
},
},
+- optional: false,
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -298,9 +330,13 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
end: { column: 5, line: 11 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Id',
+- optional: false,
range: [239, 241],
loc: {
@@ -333,9 +369,13 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
end: { column: 3, line: 12 },
},
},
+- declare: false,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [214, 215],
loc: {
@@ -369,9 +409,13 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod
end: { column: 1, line: 13 },
},
},
+- declare: false,
+- global: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [80, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot
index 0d66ff7b55fa..a2999a6fc227 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/1-TSESTree-AST.shot
@@ -7,6 +7,7 @@ Program {
TSModuleDeclaration {
type: "TSModuleDeclaration",
declare: true,
+ global: false,
id: Literal {
type: "Literal",
raw: "'hot-new-module'",
diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot
index f03ca3edb1e7..2071f13fefd8 100644
--- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/shorthand-ambient-module-declaration/snapshots/5-AST-Alignment-AST.shot
@@ -11,6 +11,7 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules shorthand-ambient-m
TSModuleDeclaration {
type: 'TSModuleDeclaration',
declare: true,
+- global: false,
id: Literal {
type: 'Literal',
raw: '\\'hot-new-module\\'',
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..719a4d1f4573
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures parameter-decorators _error_ parameter-array-pattern-decorator Babel - Error 1`] = `[SyntaxError: Unexpected token (4:28)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..c2c925447ebe
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures parameter-decorators _error_ parameter-array-pattern-decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..0cc1f7178069
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures parameter-decorators _error_ parameter-rest-element-decorator Babel - Error 1`] = `[SyntaxError: Unexpected token (4:21)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..49d961c5a2ff
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures parameter-decorators _error_ parameter-rest-element-decorator Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/1-TSESTree-AST.shot
index 8c0302752486..50f94cf4a557 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "constructor",
+ optional: false,
range: [91, 102],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "constructor",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -50,7 +55,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "title",
+ optional: false,
range: [153, 158],
loc: {
@@ -71,7 +78,9 @@ Program {
computed: false,
object: Identifier {
type: "Identifier",
+ decorators: [],
name: "config",
+ optional: false,
range: [161, 167],
loc: {
@@ -82,7 +91,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "title",
+ optional: false,
range: [168, 173],
loc: {
@@ -119,6 +130,7 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -133,7 +145,9 @@ Program {
arguments: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "APP_CONFIG",
+ optional: false,
range: [111, 121],
loc: {
@@ -144,7 +158,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "Inject",
+ optional: false,
range: [104, 110],
loc: {
@@ -169,13 +185,16 @@ Program {
},
],
name: "config",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "AppConfig",
+ optional: false,
range: [131, 140],
loc: {
@@ -227,9 +246,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Service",
+ optional: false,
range: [79, 86],
loc: {
@@ -237,6 +260,7 @@ Program {
end: { column: 13, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 180],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/5-AST-Alignment-AST.shot
index 888328c7c4b7..e7f1056280c2 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-constructor/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'constructor',
+- optional: false,
range: [91, 102],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
},
},
kind: 'constructor',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -54,7 +59,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'title',
+- optional: false,
range: [153, 158],
loc: {
@@ -75,7 +82,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
computed: false,
object: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'config',
+- optional: false,
range: [161, 167],
loc: {
@@ -86,7 +95,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'title',
+- optional: false,
range: [168, 173],
loc: {
@@ -123,6 +134,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
end: { column: 3, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -137,7 +149,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
arguments: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'APP_CONFIG',
+- optional: false,
range: [111, 121],
loc: {
@@ -148,7 +162,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Inject',
+- optional: false,
range: [104, 110],
loc: {
@@ -173,13 +189,16 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
},
],
name: 'config',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'AppConfig',
+- optional: false,
range: [131, 140],
loc: {
@@ -231,9 +250,13 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Service',
+- optional: false,
range: [79, 86],
loc: {
@@ -241,6 +264,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-c
end: { column: 13, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 180],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/1-TSESTree-AST.shot
index 8a4d5f4c98bc..16c3a1c34753 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [87, 90],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 36, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -64,7 +70,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "special",
+ optional: false,
range: [92, 99],
loc: {
@@ -89,6 +97,7 @@ Program {
},
],
name: "baz",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -137,9 +146,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -147,6 +160,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 123],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
index 5f239612d63b..c38dc753a9da 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [87, 90],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
end: { column: 36, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -68,7 +74,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'special',
+- optional: false,
range: [92, 99],
loc: {
@@ -93,6 +101,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
},
],
name: 'baz',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -141,9 +150,13 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -151,6 +164,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 123],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/1-TSESTree-AST.shot
index 13b43a4c7868..562801ba6bc2 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [100, 103],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: true,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 43, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -64,7 +70,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "special",
+ optional: false,
range: [105, 112],
loc: {
@@ -89,6 +97,7 @@ Program {
},
],
name: "baz",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -137,9 +146,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "StaticFoo",
+ optional: false,
range: [79, 88],
loc: {
@@ -147,6 +160,7 @@ Program {
end: { column: 15, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 136],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
index ec48a91bda01..392950de414b 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [100, 103],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
},
},
kind: 'method',
+- optional: false,
- override: false,
static: true,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
end: { column: 43, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -68,7 +74,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'special',
+- optional: false,
range: [105, 112],
loc: {
@@ -93,6 +101,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
},
],
name: 'baz',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -141,9 +150,13 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'StaticFoo',
+- optional: false,
range: [79, 88],
loc: {
@@ -151,6 +164,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-d
end: { column: 15, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 136],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/1-TSESTree-AST.shot
index 0c36c85c3fb6..8daae6f9517c 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "greet",
+ optional: false,
range: [91, 96],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -51,7 +56,9 @@ Program {
operator: "+",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "name",
+ optional: false,
range: [145, 149],
loc: {
@@ -100,6 +107,7 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -111,7 +119,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "required",
+ optional: false,
range: [98, 106],
loc: {
@@ -128,6 +138,7 @@ Program {
},
],
name: "name",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -176,9 +187,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Greeter",
+ optional: false,
range: [79, 86],
loc: {
@@ -186,6 +201,7 @@ Program {
end: { column: 13, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 162],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
index b84aefb6c2cd..e8ae8251a0b5 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-i
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'greet',
+- optional: false,
range: [91, 96],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-i
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -55,7 +60,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-i
operator: '+',
right: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'name',
+- optional: false,
range: [145, 149],
loc: {
@@ -104,6 +111,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-i
end: { column: 3, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -115,7 +123,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-i
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'required',
+- optional: false,
range: [98, 106],
loc: {
@@ -132,6 +142,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-i
},
],
name: 'name',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -180,9 +191,13 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-i
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Greeter',
+- optional: false,
range: [79, 86],
loc: {
@@ -190,6 +205,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-i
end: { column: 13, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 162],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/1-TSESTree-AST.shot
index 010f9e11d874..c0b3496f741f 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "greet",
+ optional: false,
range: [104, 109],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: true,
value: FunctionExpression {
@@ -51,7 +56,9 @@ Program {
operator: "+",
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "name",
+ optional: false,
range: [158, 162],
loc: {
@@ -100,6 +107,7 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -111,7 +119,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "required",
+ optional: false,
range: [111, 119],
loc: {
@@ -128,6 +138,7 @@ Program {
},
],
name: "name",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -176,9 +187,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "StaticGreeter",
+ optional: false,
range: [79, 92],
loc: {
@@ -186,6 +201,7 @@ Program {
end: { column: 19, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 175],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
index 137099e071b7..337726590abf 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-s
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'greet',
+- optional: false,
range: [104, 109],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-s
},
},
kind: 'method',
+- optional: false,
- override: false,
static: true,
value: FunctionExpression {
@@ -55,7 +60,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-s
operator: '+',
right: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'name',
+- optional: false,
range: [158, 162],
loc: {
@@ -104,6 +111,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-s
end: { column: 3, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -115,7 +123,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-s
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'required',
+- optional: false,
range: [111, 119],
loc: {
@@ -132,6 +142,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-s
},
],
name: 'name',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSStringKeyword {
@@ -180,9 +191,13 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-s
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'StaticGreeter',
+- optional: false,
range: [79, 92],
loc: {
@@ -190,6 +205,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-decorator-s
end: { column: 19, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 175],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/1-TSESTree-AST.shot
index d74da3c5e8bd..667f786e0348 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [87, 90],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 37, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -64,7 +70,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "special",
+ optional: false,
range: [92, 99],
loc: {
@@ -88,13 +96,16 @@ Program {
},
},
],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [108, 111],
loc: {
@@ -104,10 +115,13 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: true,
value: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [108, 111],
loc: {
@@ -171,9 +185,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [79, 82],
loc: {
@@ -181,6 +199,7 @@ Program {
end: { column: 9, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 124],
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/5-AST-Alignment-AST.shot
index 95cc2b085793..514ba574c587 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/parameter-object-pattern-decorator/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-patt
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [87, 90],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-patt
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-patt
end: { column: 37, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -68,7 +74,9 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-patt
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'special',
+- optional: false,
range: [92, 99],
loc: {
@@ -92,13 +100,16 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-patt
},
},
],
+- optional: false,
properties: Array [
Property {
type: 'Property',
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [108, 111],
loc: {
@@ -108,10 +119,13 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-patt
},
kind: 'init',
method: false,
+- optional: false,
shorthand: true,
value: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [108, 111],
loc: {
@@ -175,9 +189,13 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-patt
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [79, 82],
loc: {
@@ -185,6 +203,7 @@ exports[`AST Fixtures legacy-fixtures parameter-decorators parameter-object-patt
end: { column: 9, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 124],
diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot
index 966aaf6f6141..f0f1404d5e8c 100644
--- a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -21,7 +22,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "Input",
+ optional: false,
range: [98, 103],
loc: {
@@ -45,9 +48,12 @@ Program {
},
},
],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "data",
+ optional: false,
range: [106, 110],
loc: {
@@ -55,7 +61,9 @@ Program {
end: { column: 15, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -77,7 +85,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "Output",
+ optional: false,
range: [115, 121],
loc: {
@@ -101,9 +111,12 @@ Program {
},
},
],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "click",
+ optional: false,
range: [126, 131],
loc: {
@@ -111,14 +124,18 @@ Program {
end: { column: 7, line: 6 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: NewExpression {
type: "NewExpression",
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "EventEmitter",
+ optional: false,
range: [138, 150],
loc: {
@@ -148,9 +165,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "SomeComponent",
+ optional: false,
range: [79, 92],
loc: {
@@ -158,6 +179,7 @@ Program {
end: { column: 19, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 155],
diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot
index 2190670be4d9..30900af22c04 100644
--- a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-instance-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -25,7 +26,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
arguments: Array [],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Input',
+- optional: false,
range: [98, 103],
loc: {
@@ -49,9 +52,12 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
},
},
],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'data',
+- optional: false,
range: [106, 110],
loc: {
@@ -59,7 +65,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
end: { column: 15, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -81,7 +89,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
arguments: Array [],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Output',
+- optional: false,
range: [115, 121],
loc: {
@@ -105,9 +115,12 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
},
},
],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'click',
+- optional: false,
range: [126, 131],
loc: {
@@ -115,14 +128,18 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
end: { column: 7, line: 6 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: NewExpression {
type: 'NewExpression',
arguments: Array [],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'EventEmitter',
+- optional: false,
range: [138, 150],
loc: {
@@ -152,9 +169,13 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'SomeComponent',
+- optional: false,
range: [79, 92],
loc: {
@@ -162,6 +183,7 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
end: { column: 19, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 155],
diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot
index 42d3d5a3c5cb..89002b0a3837 100644
--- a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -33,7 +34,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "configurable",
+ optional: false,
range: [86, 98],
loc: {
@@ -57,9 +60,12 @@ Program {
},
},
],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop1",
+ optional: false,
range: [112, 117],
loc: {
@@ -67,7 +73,9 @@ Program {
end: { column: 34, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: true,
value: null,
@@ -101,7 +109,9 @@ Program {
],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "configurable",
+ optional: false,
range: [123, 135],
loc: {
@@ -125,9 +135,12 @@ Program {
},
},
],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "prop2",
+ optional: false,
range: [152, 157],
loc: {
@@ -135,7 +148,9 @@ Program {
end: { column: 14, line: 7 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: true,
value: null,
@@ -153,9 +168,13 @@ Program {
end: { column: 1, line: 8 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [79, 80],
loc: {
@@ -163,6 +182,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 160],
diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot
index 600f2728babb..837f9a425a76 100644
--- a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -37,7 +38,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'configurable',
+- optional: false,
range: [86, 98],
loc: {
@@ -61,9 +64,12 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
},
},
],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop1',
+- optional: false,
range: [112, 117],
loc: {
@@ -71,7 +77,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
end: { column: 34, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: true,
value: null,
@@ -105,7 +113,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'configurable',
+- optional: false,
range: [123, 135],
loc: {
@@ -129,9 +139,12 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
},
},
],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'prop2',
+- optional: false,
range: [152, 157],
loc: {
@@ -139,7 +152,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
end: { column: 14, line: 7 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: true,
value: null,
@@ -157,9 +172,13 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
end: { column: 1, line: 8 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [79, 80],
loc: {
@@ -167,6 +186,7 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-fac
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 160],
diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/1-TSESTree-AST.shot
index dda047dc2e91..3ea99285bd04 100644
--- a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -18,7 +19,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [86, 89],
loc: {
@@ -34,9 +37,12 @@ Program {
},
},
],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [90, 91],
loc: {
@@ -44,7 +50,9 @@ Program {
end: { column: 8, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -63,7 +71,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "bar",
+ optional: false,
range: [96, 99],
loc: {
@@ -79,9 +89,12 @@ Program {
},
},
],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "y",
+ optional: false,
range: [102, 103],
loc: {
@@ -89,7 +102,9 @@ Program {
end: { column: 3, line: 6 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
value: null,
@@ -107,9 +122,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [79, 80],
loc: {
@@ -117,6 +136,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 106],
diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
index 01d21db7abad..bfed32cce868 100644
--- a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-ins
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -22,7 +23,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-ins
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [86, 89],
loc: {
@@ -38,9 +41,12 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-ins
},
},
],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
range: [90, 91],
loc: {
@@ -48,7 +54,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-ins
end: { column: 8, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -67,7 +75,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-ins
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'bar',
+- optional: false,
range: [96, 99],
loc: {
@@ -83,9 +93,12 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-ins
},
},
],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'y',
+- optional: false,
range: [102, 103],
loc: {
@@ -93,7 +106,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-ins
end: { column: 3, line: 6 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
value: null,
@@ -111,9 +126,13 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-ins
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [79, 80],
loc: {
@@ -121,6 +140,7 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-ins
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 106],
diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/1-TSESTree-AST.shot
index 02a59096f9bf..6d0c6efc36c4 100644
--- a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -18,7 +19,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "baz",
+ optional: false,
range: [86, 89],
loc: {
@@ -34,9 +37,12 @@ Program {
},
},
],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [97, 98],
loc: {
@@ -44,7 +50,9 @@ Program {
end: { column: 15, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: true,
value: null,
@@ -63,7 +71,9 @@ Program {
type: "Decorator",
expression: Identifier {
type: "Identifier",
+ decorators: [],
name: "qux",
+ optional: false,
range: [103, 106],
loc: {
@@ -79,9 +89,12 @@ Program {
},
},
],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [116, 117],
loc: {
@@ -89,7 +102,9 @@ Program {
end: { column: 10, line: 6 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: true,
value: null,
@@ -107,9 +122,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [79, 80],
loc: {
@@ -117,6 +136,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 120],
diff --git a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
index 8e633925fae0..13aebd9d6085 100644
--- a/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-sta
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -22,7 +23,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-sta
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'baz',
+- optional: false,
range: [86, 89],
loc: {
@@ -38,9 +41,12 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-sta
},
},
],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [97, 98],
loc: {
@@ -48,7 +54,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-sta
end: { column: 15, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: true,
value: null,
@@ -67,7 +75,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-sta
type: 'Decorator',
expression: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'qux',
+- optional: false,
range: [103, 106],
loc: {
@@ -83,9 +93,12 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-sta
},
},
],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [116, 117],
loc: {
@@ -93,7 +106,9 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-sta
end: { column: 10, line: 6 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: true,
value: null,
@@ -111,9 +126,13 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-sta
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [79, 80],
loc: {
@@ -121,6 +140,7 @@ exports[`AST Fixtures legacy-fixtures property-decorators property-decorator-sta
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 120],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/1-TSESTree-AST.shot
index 225fb3a806d4..9b9c1ecf16e2 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/5-AST-Alignment-AST.shot
index 66962c9338cf..d167672eac00 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/array-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,59 @@
exports[`AST Fixtures legacy-fixtures types array-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSArrayType {
+ type: 'TSArrayType',
+ elementType: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [84, 92],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+
+ range: [73, 93],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot
index 90bc84863782..0a99fe4c889a 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Unpacked",
+ optional: false,
range: [78, 86],
loc: {
@@ -22,7 +25,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [92, 93],
loc: {
@@ -47,7 +52,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [109, 110],
loc: {
@@ -83,7 +90,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [124, 125],
loc: {
@@ -106,7 +115,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [140, 141],
loc: {
@@ -135,7 +146,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [152, 153],
loc: {
@@ -152,17 +165,7 @@ Program {
},
extendsType: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Promise",
-
- range: [162, 169],
- loc: {
- start: { column: 14, line: 7 },
- end: { column: 21, line: 7 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSInferType {
@@ -173,7 +176,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [176, 177],
loc: {
@@ -204,6 +209,18 @@ Program {
end: { column: 30, line: 7 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Promise",
+ optional: false,
+
+ range: [162, 169],
+ loc: {
+ start: { column: 14, line: 7 },
+ end: { column: 21, line: 7 },
+ },
+ },
range: [162, 178],
loc: {
@@ -215,7 +232,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [189, 190],
loc: {
@@ -234,7 +253,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [183, 184],
loc: {
@@ -260,7 +281,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [146, 147],
loc: {
@@ -286,7 +309,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [118, 119],
loc: {
@@ -317,7 +342,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [87, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot
index 72a35e38426f..d24b29499950 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-nested/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Unpacked',
+- optional: false,
range: [78, 86],
loc: {
@@ -26,7 +29,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [92, 93],
loc: {
@@ -51,6 +56,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
+ elementType: TSParenthesizedType {
+ type: 'TSParenthesizedType',
+ typeAnnotation: TSInferType {
@@ -58,6 +64,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
+ typeParameter: TSTypeParameter {
+ type: 'TSTypeParameter',
name: 'U',
+- optional: false,
range: [109, 110],
loc: {
@@ -98,7 +105,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [124, 125],
loc: {
@@ -121,7 +130,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [140, 141],
- loc: {
@@ -151,7 +162,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [152, 153],
loc: {
@@ -168,17 +181,18 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
},
extendsType: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'Promise',
-
- range: [162, 169],
- loc: {
- start: { column: 14, line: 7 },
- end: { column: 21, line: 7 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Promise',
++
++ range: [162, 169],
++ loc: {
++ start: { column: 14, line: 7 },
++ end: { column: 21, line: 7 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSInferType {
@@ -189,7 +203,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [176, 177],
- loc: {
@@ -221,7 +237,19 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
end: { column: 30, line: 7 },
},
},
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Promise',
+- optional: false,
+- range: [162, 169],
+- loc: {
+- start: { column: 14, line: 7 },
+- end: { column: 21, line: 7 },
+- },
+- },
+-
range: [162, 178],
loc: {
start: { column: 14, line: 7 },
@@ -232,7 +260,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [189, 190],
loc: {
@@ -251,7 +281,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [183, 184],
loc: {
@@ -277,7 +309,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [146, 147],
loc: {
@@ -303,7 +337,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [118, 119],
loc: {
@@ -334,7 +370,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-nested AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [87, 88],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot
index 75f88840e0cc..7154c778112c 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -22,7 +25,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [87, 88],
loc: {
@@ -45,7 +50,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [99, 100],
loc: {
@@ -53,6 +60,9 @@ Program {
end: { column: 27, line: 3 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSInferType {
@@ -63,7 +73,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [108, 109],
loc: {
@@ -105,7 +117,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [111, 112],
loc: {
@@ -113,6 +127,9 @@ Program {
end: { column: 39, line: 3 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSInferType {
@@ -123,7 +140,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [120, 121],
loc: {
@@ -181,7 +200,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [126, 127],
loc: {
@@ -212,7 +233,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [82, 83],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot
index 3e71f1e73e3d..eea7b96d4730 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-simple/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [78, 81],
loc: {
@@ -26,7 +29,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [87, 88],
loc: {
@@ -49,7 +54,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [99, 100],
loc: {
@@ -57,6 +64,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
end: { column: 27, line: 3 },
},
},
+- optional: false,
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSInferType {
@@ -67,8 +77,11 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
--
+- optional: false,
++ name: 'U',
+
- range: [108, 109],
- loc: {
- start: { column: 35, line: 3 },
@@ -76,8 +89,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
- },
- },
- out: false,
-+ name: 'U',
-
+-
range: [108, 109],
loc: {
start: { column: 35, line: 3 },
@@ -110,7 +122,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [111, 112],
loc: {
@@ -118,6 +132,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
end: { column: 39, line: 3 },
},
},
+- optional: false,
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSInferType {
@@ -128,7 +145,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [120, 121],
- loc: {
@@ -187,7 +206,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [126, 127],
loc: {
@@ -218,7 +239,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-simple AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [82, 83],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot
index 7f0ff3f13014..d2240994ff9e 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X3",
+ optional: false,
range: [78, 80],
loc: {
@@ -22,7 +25,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [86, 87],
loc: {
@@ -57,7 +62,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [103, 104],
loc: {
@@ -99,24 +106,16 @@ Program {
},
trueType: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "MustBeNumber",
-
- range: [123, 135],
- loc: {
- start: { column: 50, line: 3 },
- end: { column: 62, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [136, 137],
loc: {
@@ -139,6 +138,18 @@ Program {
end: { column: 65, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "MustBeNumber",
+ optional: false,
+
+ range: [123, 135],
+ loc: {
+ start: { column: 50, line: 3 },
+ end: { column: 62, line: 3 },
+ },
+ },
range: [123, 138],
loc: {
@@ -162,7 +173,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [81, 82],
loc: {
@@ -195,9 +208,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X4",
+ optional: false,
range: [153, 155],
loc: {
@@ -211,7 +227,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [161, 162],
loc: {
@@ -246,7 +264,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [178, 179],
loc: {
@@ -286,7 +306,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [202, 203],
loc: {
@@ -328,24 +350,16 @@ Program {
},
trueType: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "MustBeNumber",
-
- range: [224, 236],
- loc: {
- start: { column: 4, line: 5 },
- end: { column: 16, line: 5 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [237, 238],
loc: {
@@ -368,6 +382,18 @@ Program {
end: { column: 19, line: 5 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "MustBeNumber",
+ optional: false,
+
+ range: [224, 236],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 16, line: 5 },
+ },
+ },
range: [224, 239],
loc: {
@@ -391,7 +417,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [156, 157],
loc: {
@@ -424,9 +452,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X5",
+ optional: false,
range: [256, 258],
loc: {
@@ -440,7 +471,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [264, 265],
loc: {
@@ -475,7 +508,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [281, 282],
loc: {
@@ -506,7 +541,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [305, 306],
loc: {
@@ -548,24 +585,16 @@ Program {
},
trueType: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "MustBeNumber",
-
- range: [312, 324],
- loc: {
- start: { column: 4, line: 8 },
- end: { column: 16, line: 8 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [325, 326],
loc: {
@@ -588,6 +617,18 @@ Program {
end: { column: 19, line: 8 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "MustBeNumber",
+ optional: false,
+
+ range: [312, 324],
+ loc: {
+ start: { column: 4, line: 8 },
+ end: { column: 16, line: 8 },
+ },
+ },
range: [312, 327],
loc: {
@@ -611,7 +652,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [259, 260],
loc: {
@@ -644,9 +687,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X6",
+ optional: false,
range: [344, 346],
loc: {
@@ -660,7 +706,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [352, 353],
loc: {
@@ -686,7 +734,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [369, 370],
loc: {
@@ -726,7 +776,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [378, 379],
loc: {
@@ -768,24 +820,16 @@ Program {
},
trueType: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "MustBeNumber",
-
- range: [400, 412],
- loc: {
- start: { column: 4, line: 11 },
- end: { column: 16, line: 11 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [413, 414],
loc: {
@@ -808,6 +852,18 @@ Program {
end: { column: 19, line: 11 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "MustBeNumber",
+ optional: false,
+
+ range: [400, 412],
+ loc: {
+ start: { column: 4, line: 11 },
+ end: { column: 16, line: 11 },
+ },
+ },
range: [400, 415],
loc: {
@@ -831,7 +887,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [347, 348],
loc: {
@@ -864,9 +922,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "X7",
+ optional: false,
range: [432, 434],
loc: {
@@ -880,7 +941,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [440, 441],
loc: {
@@ -915,7 +978,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [457, 458],
loc: {
@@ -955,7 +1020,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [481, 482],
loc: {
@@ -999,7 +1066,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [503, 504],
loc: {
@@ -1030,7 +1099,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [435, 436],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot
index 66f821f85af7..1b714bc69893 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer-with-constraint/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X3',
+- optional: false,
range: [78, 80],
loc: {
@@ -26,7 +29,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [86, 87],
loc: {
@@ -61,7 +66,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [103, 104],
- loc: {
@@ -104,24 +111,27 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
},
trueType: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'MustBeNumber',
-
- range: [123, 135],
- loc: {
- start: { column: 50, line: 3 },
- end: { column: 62, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'MustBeNumber',
++
++ range: [123, 135],
++ loc: {
++ start: { column: 50, line: 3 },
++ end: { column: 62, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [136, 137],
loc: {
@@ -142,6 +152,18 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
loc: {
start: { column: 62, line: 3 },
end: { column: 65, line: 3 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'MustBeNumber',
+- optional: false,
+-
+- range: [123, 135],
+- loc: {
+- start: { column: 50, line: 3 },
+- end: { column: 62, line: 3 },
},
},
@@ -167,7 +189,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [81, 82],
- loc: {
@@ -201,9 +225,12 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X4',
+- optional: false,
range: [153, 155],
loc: {
@@ -217,7 +244,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [161, 162],
loc: {
@@ -252,7 +281,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [178, 179],
- loc: {
@@ -293,7 +324,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [202, 203],
- loc: {
@@ -336,24 +369,27 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
},
trueType: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'MustBeNumber',
-
- range: [224, 236],
- loc: {
- start: { column: 4, line: 5 },
- end: { column: 16, line: 5 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'MustBeNumber',
++
++ range: [224, 236],
++ loc: {
++ start: { column: 4, line: 5 },
++ end: { column: 16, line: 5 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [237, 238],
loc: {
@@ -376,7 +412,19 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
end: { column: 19, line: 5 },
},
},
-
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'MustBeNumber',
+- optional: false,
+
+- range: [224, 236],
+- loc: {
+- start: { column: 4, line: 5 },
+- end: { column: 16, line: 5 },
+- },
+- },
+-
range: [224, 239],
loc: {
start: { column: 4, line: 5 },
@@ -399,8 +447,11 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
--
+- optional: false,
++ name: 'T',
+
- range: [156, 157],
- loc: {
- start: { column: 8, line: 4 },
@@ -408,8 +459,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- },
- },
- out: false,
-+ name: 'T',
-
+-
range: [156, 157],
loc: {
start: { column: 8, line: 4 },
@@ -433,9 +483,12 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X5',
+- optional: false,
range: [256, 258],
loc: {
@@ -449,7 +502,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [264, 265],
loc: {
@@ -484,9 +539,10 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
-+ name: 'U',
-
+- optional: false,
+-
- range: [281, 282],
- loc: {
- start: { column: 30, line: 7 },
@@ -494,7 +550,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- },
- },
- out: false,
--
++ name: 'U',
+
range: [281, 297],
loc: {
start: { column: 30, line: 7 },
@@ -516,7 +573,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [305, 306],
- loc: {
@@ -559,24 +618,27 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
},
trueType: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'MustBeNumber',
-
- range: [312, 324],
- loc: {
- start: { column: 4, line: 8 },
- end: { column: 16, line: 8 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'MustBeNumber',
++
++ range: [312, 324],
++ loc: {
++ start: { column: 4, line: 8 },
++ end: { column: 16, line: 8 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [325, 326],
loc: {
@@ -597,6 +659,18 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
loc: {
start: { column: 16, line: 8 },
end: { column: 19, line: 8 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'MustBeNumber',
+- optional: false,
+-
+- range: [312, 324],
+- loc: {
+- start: { column: 4, line: 8 },
+- end: { column: 16, line: 8 },
},
},
@@ -622,7 +696,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [259, 260],
- loc: {
@@ -656,9 +732,12 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X6',
+- optional: false,
range: [344, 346],
loc: {
@@ -672,7 +751,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [352, 353],
loc: {
@@ -698,7 +779,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [369, 370],
- loc: {
@@ -739,7 +822,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [378, 379],
- loc: {
@@ -782,24 +867,27 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
},
trueType: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'MustBeNumber',
-
- range: [400, 412],
- loc: {
- start: { column: 4, line: 11 },
- end: { column: 16, line: 11 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'MustBeNumber',
++
++ range: [400, 412],
++ loc: {
++ start: { column: 4, line: 11 },
++ end: { column: 16, line: 11 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [413, 414],
loc: {
@@ -820,6 +908,18 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
loc: {
start: { column: 16, line: 11 },
end: { column: 19, line: 11 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'MustBeNumber',
+- optional: false,
+-
+- range: [400, 412],
+- loc: {
+- start: { column: 4, line: 11 },
+- end: { column: 16, line: 11 },
},
},
@@ -845,7 +945,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [347, 348],
- loc: {
@@ -879,9 +981,12 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'X7',
+- optional: false,
range: [432, 434],
loc: {
@@ -895,7 +1000,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [440, 441],
loc: {
@@ -930,7 +1037,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [457, 458],
- loc: {
@@ -971,9 +1080,10 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
-+ name: 'U',
-
+- optional: false,
+-
- range: [481, 482],
- loc: {
- start: { column: 54, line: 13 },
@@ -981,7 +1091,8 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- },
- },
- out: false,
--
++ name: 'U',
+
range: [481, 497],
loc: {
start: { column: 54, line: 13 },
@@ -1016,7 +1127,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [503, 504],
loc: {
@@ -1047,7 +1160,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer-with-constraint AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [435, 436],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot
index 5729345d21ce..799c9beb9baa 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Element",
+ optional: false,
range: [78, 85],
loc: {
@@ -22,7 +25,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [91, 92],
loc: {
@@ -47,7 +52,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [108, 109],
loc: {
@@ -81,7 +88,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [119, 120],
loc: {
@@ -100,7 +109,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [115, 116],
loc: {
@@ -131,7 +142,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [86, 87],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot
index bc029519defe..5e5c20256cff 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-infer/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - AS
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Element',
+- optional: false,
range: [78, 85],
loc: {
@@ -26,7 +29,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [91, 92],
loc: {
@@ -51,6 +56,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
+ elementType: TSParenthesizedType {
+ type: 'TSParenthesizedType',
+ typeAnnotation: TSInferType {
@@ -58,6 +64,7 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - AS
+ typeParameter: TSTypeParameter {
+ type: 'TSTypeParameter',
name: 'U',
+- optional: false,
range: [108, 109],
loc: {
@@ -96,7 +103,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [119, 120],
loc: {
@@ -115,7 +124,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [115, 116],
loc: {
@@ -146,7 +157,9 @@ exports[`AST Fixtures legacy-fixtures types conditional-infer AST Alignment - AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [86, 87],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/1-TSESTree-AST.shot
index c706c876155b..f8289e158478 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSConditionalType {
@@ -82,6 +85,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 119],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/5-AST-Alignment-AST.shot
index be2ad0cc13c7..ed615cbcd198 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,109 @@
exports[`AST Fixtures legacy-fixtures types conditional-with-null AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSConditionalType {
+ type: 'TSConditionalType',
+ checkType: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [80, 86],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ extendsType: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [95, 101],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ falseType: TSNullKeyword {
+ type: 'TSNullKeyword',
+
+ range: [114, 118],
+ loc: {
+ start: { column: 41, line: 3 },
+ end: { column: 45, line: 3 },
+ },
+ },
+ trueType: TSBooleanKeyword {
+ type: 'TSBooleanKeyword',
+
+ range: [104, 111],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [80, 118],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 45, line: 3 },
+ },
+ },
+
+ range: [78, 118],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 45, line: 3 },
+ },
+ },
+
+ range: [77, 118],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 45, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 118],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 45, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 119],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 46, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 120],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/1-TSESTree-AST.shot
index 169e3213d250..c44680df9113 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSConditionalType {
@@ -82,6 +85,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 121],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/5-AST-Alignment-AST.shot
index f451cd316293..a9d6aaafa0fd 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,109 @@
exports[`AST Fixtures legacy-fixtures types conditional AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSConditionalType {
+ type: 'TSConditionalType',
+ checkType: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [80, 86],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ extendsType: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [95, 101],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ falseType: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [114, 120],
+ loc: {
+ start: { column: 41, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+ trueType: TSBooleanKeyword {
+ type: 'TSBooleanKeyword',
+
+ range: [104, 111],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 38, line: 3 },
+ },
+ },
+
+ range: [80, 120],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+
+ range: [78, 120],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+
+ range: [77, 120],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 120],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 47, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 121],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 48, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 122],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/1-TSESTree-AST.shot
index fe59ab02cade..7becf39220cf 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSConstructorType {
@@ -66,6 +69,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [73, 104],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/5-AST-Alignment-AST.shot
index 18d7b8a9fb1c..323e019ff1fd 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-abstract/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types constructor-abstract AST Alignment -
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSConstructorType {
@@ -72,6 +75,7 @@ exports[`AST Fixtures legacy-fixtures types constructor-abstract AST Alignment -
},
},
],
+- declare: false,
kind: 'var',
range: [73, 104],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/1-TSESTree-AST.shot
index 1c3027b53b7b..293811334c3b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSConstructorType {
@@ -66,6 +69,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [73, 95],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/5-AST-Alignment-AST.shot
index 06360892a57d..b396e883fd4c 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-empty/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types constructor-empty AST Alignment - AS
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSConstructorType {
@@ -72,6 +75,7 @@ exports[`AST Fixtures legacy-fixtures types constructor-empty AST Alignment - AS
},
},
],
+- declare: false,
kind: 'var',
range: [73, 95],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot
index f033a300a711..c857057fcb43 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSConstructorType {
@@ -20,14 +23,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [91, 92],
loc: {
@@ -63,7 +70,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [97, 98],
loc: {
@@ -94,7 +103,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [85, 86],
loc: {
@@ -148,6 +159,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 99],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot
index 1726ad50b2fb..19c035fb72cd 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types constructor-generic AST Alignment -
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'f',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSConstructorType {
@@ -25,14 +28,18 @@ exports[`AST Fixtures legacy-fixtures types constructor-generic AST Alignment -
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [91, 92],
loc: {
@@ -69,7 +76,9 @@ exports[`AST Fixtures legacy-fixtures types constructor-generic AST Alignment -
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [97, 98],
loc: {
@@ -100,7 +109,9 @@ exports[`AST Fixtures legacy-fixtures types constructor-generic AST Alignment -
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [85, 86],
- loc: {
@@ -155,6 +166,7 @@ exports[`AST Fixtures legacy-fixtures types constructor-generic AST Alignment -
},
},
],
+- declare: false,
kind: 'let',
range: [73, 99],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot
index b67848f0878e..5d1733dfb27b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/1-TSESTree-AST.shot
@@ -9,24 +9,17 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Array",
-
- range: [80, 85],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 12, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSConstructorType {
@@ -66,6 +59,18 @@ Program {
end: { column: 30, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Array",
+ optional: false,
+
+ range: [80, 85],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
range: [80, 103],
loc: {
@@ -96,6 +101,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 104],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot
index 322828642b24..bccbac1b833b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/5-AST-Alignment-AST.shot
@@ -13,24 +13,28 @@ exports[`AST Fixtures legacy-fixtures types constructor-in-generic AST Alignment
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'Array',
-
- range: [80, 85],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 12, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Array',
++
++ range: [80, 85],
++ loc: {
++ start: { column: 7, line: 3 },
++ end: { column: 12, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSConstructorType {
@@ -72,7 +76,19 @@ exports[`AST Fixtures legacy-fixtures types constructor-in-generic AST Alignment
end: { column: 30, line: 3 },
},
},
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Array',
+- optional: false,
+- range: [80, 85],
+- loc: {
+- start: { column: 7, line: 3 },
+- end: { column: 12, line: 3 },
+- },
+- },
+-
range: [80, 103],
loc: {
start: { column: 7, line: 3 },
@@ -102,6 +118,7 @@ exports[`AST Fixtures legacy-fixtures types constructor-in-generic AST Alignment
},
},
],
+- declare: false,
kind: 'let',
range: [73, 104],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/1-TSESTree-AST.shot
index 2948097fb1cc..dd4b9cc383a0 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSConstructorType {
@@ -22,7 +25,9 @@ Program {
type: "RestElement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [88, 89],
loc: {
@@ -30,6 +35,8 @@ Program {
end: { column: 16, line: 3 },
},
},
+ decorators: [],
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSArrayType {
@@ -113,6 +120,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 109],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/5-AST-Alignment-AST.shot
index 7dd96ce1e6af..8f5e827d8c86 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types constructor-with-rest AST Alignment
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'f',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSConstructorType {
@@ -27,7 +30,9 @@ exports[`AST Fixtures legacy-fixtures types constructor-with-rest AST Alignment
type: 'RestElement',
argument: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [88, 89],
loc: {
@@ -35,6 +40,8 @@ exports[`AST Fixtures legacy-fixtures types constructor-with-rest AST Alignment
end: { column: 16, line: 3 },
},
},
+- decorators: Array [],
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSArrayType {
@@ -119,6 +126,7 @@ exports[`AST Fixtures legacy-fixtures types constructor-with-rest AST Alignment
},
},
],
+- declare: false,
kind: 'let',
range: [73, 109],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/1-TSESTree-AST.shot
index a4234ce3c195..775dc0a72514 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSConstructorType {
@@ -20,7 +23,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -48,6 +53,7 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
optional: true,
typeAnnotation: TSTypeAnnotation {
@@ -124,6 +130,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 116],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/5-AST-Alignment-AST.shot
index c5fe0cca283a..6514d6460114 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types constructor AST Alignment - AST 1`]
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'f',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSConstructorType {
@@ -25,7 +28,9 @@ exports[`AST Fixtures legacy-fixtures types constructor AST Alignment - AST 1`]
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -53,6 +58,7 @@ exports[`AST Fixtures legacy-fixtures types constructor AST Alignment - AST 1`]
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
optional: true,
typeAnnotation: TSTypeAnnotation {
@@ -130,6 +136,7 @@ exports[`AST Fixtures legacy-fixtures types constructor AST Alignment - AST 1`]
},
},
],
+- declare: false,
kind: 'let',
range: [73, 116],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot
index a35ab7d77703..752b2d73dc64 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSFunctionType {
@@ -19,14 +22,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [87, 88],
loc: {
@@ -62,7 +69,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [93, 94],
loc: {
@@ -93,7 +102,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [81, 82],
loc: {
@@ -147,6 +158,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 95],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot
index 8fcec2c09052..d376aae29392 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types function-generic AST Alignment - AST
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'f',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSFunctionType {
@@ -24,14 +27,18 @@ exports[`AST Fixtures legacy-fixtures types function-generic AST Alignment - AST
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [87, 88],
loc: {
@@ -68,7 +75,9 @@ exports[`AST Fixtures legacy-fixtures types function-generic AST Alignment - AST
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [93, 94],
loc: {
@@ -99,7 +108,9 @@ exports[`AST Fixtures legacy-fixtures types function-generic AST Alignment - AST
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [81, 82],
- loc: {
@@ -154,6 +165,7 @@ exports[`AST Fixtures legacy-fixtures types function-generic AST Alignment - AST
},
},
],
+- declare: false,
kind: 'let',
range: [73, 95],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot
index 485bc5c50e6e..70a3a44d61aa 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/1-TSESTree-AST.shot
@@ -9,24 +9,17 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Array",
-
- range: [80, 85],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 12, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSFunctionType {
@@ -65,6 +58,18 @@ Program {
end: { column: 24, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Array",
+ optional: false,
+
+ range: [80, 85],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
range: [80, 97],
loc: {
@@ -95,6 +100,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 98],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot
index 98ba2c71171c..bf666f461df8 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/5-AST-Alignment-AST.shot
@@ -13,24 +13,28 @@ exports[`AST Fixtures legacy-fixtures types function-in-generic AST Alignment -
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'Array',
-
- range: [80, 85],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 12, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Array',
++
++ range: [80, 85],
++ loc: {
++ start: { column: 7, line: 3 },
++ end: { column: 12, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSFunctionType {
@@ -71,7 +75,19 @@ exports[`AST Fixtures legacy-fixtures types function-in-generic AST Alignment -
end: { column: 24, line: 3 },
},
},
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Array',
+- optional: false,
+- range: [80, 85],
+- loc: {
+- start: { column: 7, line: 3 },
+- end: { column: 12, line: 3 },
+- },
+- },
+-
range: [80, 97],
loc: {
start: { column: 7, line: 3 },
@@ -101,6 +117,7 @@ exports[`AST Fixtures legacy-fixtures types function-in-generic AST Alignment -
},
},
],
+- declare: false,
kind: 'let',
range: [73, 98],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/1-TSESTree-AST.shot
index 59b1a0bf91fe..f6aad4b354a5 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -21,10 +24,13 @@ Program {
params: [
ArrayPattern {
type: "ArrayPattern",
+ decorators: [],
elements: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [86, 87],
loc: {
@@ -33,6 +39,7 @@ Program {
},
},
],
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSAnyKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/5-AST-Alignment-AST.shot
index a786bec4d073..be570c8c5434 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-array-destruction/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types function-with-array-destruction AST
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [78, 81],
loc: {
@@ -26,10 +29,13 @@ exports[`AST Fixtures legacy-fixtures types function-with-array-destruction AST
+ parameters: Array [
ArrayPattern {
type: 'ArrayPattern',
+- decorators: Array [],
elements: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [86, 87],
loc: {
@@ -38,6 +44,7 @@ exports[`AST Fixtures legacy-fixtures types function-with-array-destruction AST
},
},
],
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSAnyKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/1-TSESTree-AST.shot
index 9483d5e94bc6..2b07172adad8 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -21,13 +24,17 @@ Program {
params: [
ObjectPattern {
type: "ObjectPattern",
+ decorators: [],
+ optional: false,
properties: [
Property {
type: "Property",
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [87, 88],
loc: {
@@ -37,10 +44,13 @@ Program {
},
kind: "init",
method: false,
+ optional: false,
shorthand: true,
value: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [87, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/5-AST-Alignment-AST.shot
index 2f06b281d400..8ffbb928e8a0 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-object-destruction/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types function-with-object-destruction AST
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [78, 81],
loc: {
@@ -26,13 +29,17 @@ exports[`AST Fixtures legacy-fixtures types function-with-object-destruction AST
+ parameters: Array [
ObjectPattern {
type: 'ObjectPattern',
+- decorators: Array [],
+- optional: false,
properties: Array [
Property {
type: 'Property',
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [87, 88],
loc: {
@@ -42,10 +49,13 @@ exports[`AST Fixtures legacy-fixtures types function-with-object-destruction AST
},
kind: 'init',
method: false,
+- optional: false,
shorthand: true,
value: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [87, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/1-TSESTree-AST.shot
index 8d1b9c4abcbb..78cfd6f6f5b7 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSFunctionType {
@@ -21,7 +24,9 @@ Program {
type: "RestElement",
argument: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [84, 85],
loc: {
@@ -29,6 +34,8 @@ Program {
end: { column: 12, line: 3 },
},
},
+ decorators: [],
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSArrayType {
@@ -112,6 +119,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 105],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/5-AST-Alignment-AST.shot
index 7a302d9a4188..90262f9c0dc8 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types function-with-rest AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'f',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSFunctionType {
@@ -26,7 +29,9 @@ exports[`AST Fixtures legacy-fixtures types function-with-rest AST Alignment - A
type: 'RestElement',
argument: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [84, 85],
loc: {
@@ -34,6 +39,8 @@ exports[`AST Fixtures legacy-fixtures types function-with-rest AST Alignment - A
end: { column: 12, line: 3 },
},
},
+- decorators: Array [],
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSArrayType {
@@ -118,6 +125,7 @@ exports[`AST Fixtures legacy-fixtures types function-with-rest AST Alignment - A
},
},
],
+- declare: false,
kind: 'let',
range: [73, 105],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/1-TSESTree-AST.shot
index 554d54e3428f..52d66c25f8d0 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSFunctionType {
@@ -19,7 +22,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "this",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -94,6 +99,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 103],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/5-AST-Alignment-AST.shot
index 6687e26e8c88..f6147ae4510d 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types function-with-this AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'f',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSFunctionType {
@@ -24,7 +27,9 @@ exports[`AST Fixtures legacy-fixtures types function-with-this AST Alignment - A
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'this',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -100,6 +105,7 @@ exports[`AST Fixtures legacy-fixtures types function-with-this AST Alignment - A
},
},
],
+- declare: false,
kind: 'let',
range: [73, 103],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/1-TSESTree-AST.shot
index be2b938133dc..17f5453b3120 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "f",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSFunctionType {
@@ -19,7 +22,9 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -47,6 +52,7 @@ Program {
},
Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
optional: true,
typeAnnotation: TSTypeAnnotation {
@@ -123,6 +129,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 112],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/5-AST-Alignment-AST.shot
index 41bd32adba56..367d12afbcb8 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types function AST Alignment - AST 1`] = `
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'f',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSFunctionType {
@@ -24,7 +27,9 @@ exports[`AST Fixtures legacy-fixtures types function AST Alignment - AST 1`] = `
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSNumberKeyword {
@@ -52,6 +57,7 @@ exports[`AST Fixtures legacy-fixtures types function AST Alignment - AST 1`] = `
},
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
optional: true,
typeAnnotation: TSTypeAnnotation {
@@ -129,6 +135,7 @@ exports[`AST Fixtures legacy-fixtures types function AST Alignment - AST 1`] = `
},
},
],
+- declare: false,
kind: 'let',
range: [73, 112],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/1-TSESTree-AST.shot
index 6a8370b6b8b0..e889f7ff8ffc 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -24,7 +27,9 @@ Program {
parameters: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "key",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -52,6 +57,7 @@ Program {
},
],
readonly: true,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/5-AST-Alignment-AST.shot
index 0500b9d57fb8..7bb45645947c 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-readonly/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,113 @@
exports[`AST Fixtures legacy-fixtures types index-signature-readonly AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeLiteral {
+ type: 'TSTypeLiteral',
+ members: Array [
+ TSIndexSignature {
+ type: 'TSIndexSignature',
+ parameters: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'key',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [103, 109],
+ loc: {
+ start: { column: 17, line: 4 },
+ end: { column: 23, line: 4 },
+ },
+ },
+
+ range: [101, 109],
+ loc: {
+ start: { column: 15, line: 4 },
+ end: { column: 23, line: 4 },
+ },
+ },
+
+ range: [98, 109],
+ loc: {
+ start: { column: 12, line: 4 },
+ end: { column: 23, line: 4 },
+ },
+ },
+ ],
+ readonly: true,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [112, 118],
+ loc: {
+ start: { column: 26, line: 4 },
+ end: { column: 32, line: 4 },
+ },
+ },
+
+ range: [110, 118],
+ loc: {
+ start: { column: 24, line: 4 },
+ end: { column: 32, line: 4 },
+ },
+ },
+
+ range: [88, 119],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 33, line: 4 },
+ },
+ },
+ ],
+
+ range: [84, 121],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+
+ range: [73, 122],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 2, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 123],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/1-TSESTree-AST.shot
index e7fab0bebdf8..1290d0b54eb6 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -24,7 +27,9 @@ Program {
parameters: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -51,6 +56,8 @@ Program {
},
},
],
+ readonly: false,
+ static: false,
range: [88, 100],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/5-AST-Alignment-AST.shot
index 5f1910026682..bc1599183a9d 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature-without-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,95 @@
exports[`AST Fixtures legacy-fixtures types index-signature-without-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeLiteral {
+ type: 'TSTypeLiteral',
+ members: Array [
+ TSIndexSignature {
+ type: 'TSIndexSignature',
+ parameters: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [92, 98],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 12, line: 4 },
+ },
+ },
+
+ range: [90, 98],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 12, line: 4 },
+ },
+ },
+
+ range: [89, 98],
+ loc: {
+ start: { column: 3, line: 4 },
+ end: { column: 12, line: 4 },
+ },
+ },
+ ],
+- readonly: false,
+- static: false,
+
+ range: [88, 100],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
+ ],
+
+ range: [84, 102],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+
+ range: [73, 103],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 2, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 104],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/1-TSESTree-AST.shot
index 48d1e43110b2..8f98fb5c807c 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -24,7 +27,9 @@ Program {
parameters: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
@@ -51,6 +56,8 @@ Program {
},
},
],
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSStringKeyword {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/5-AST-Alignment-AST.shot
index 4382f42ebd50..39cb215c3056 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/index-signature/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,113 @@
exports[`AST Fixtures legacy-fixtures types index-signature AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSTypeLiteral {
+ type: 'TSTypeLiteral',
+ members: Array [
+ TSIndexSignature {
+ type: 'TSIndexSignature',
+ parameters: Array [
+ Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [92, 98],
+ loc: {
+ start: { column: 6, line: 4 },
+ end: { column: 12, line: 4 },
+ },
+ },
+
+ range: [90, 98],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 12, line: 4 },
+ },
+ },
+
+ range: [89, 98],
+ loc: {
+ start: { column: 3, line: 4 },
+ end: { column: 12, line: 4 },
+ },
+ },
+ ],
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [101, 107],
+ loc: {
+ start: { column: 15, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+
+ range: [99, 107],
+ loc: {
+ start: { column: 13, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+
+ range: [88, 108],
+ loc: {
+ start: { column: 2, line: 4 },
+ end: { column: 22, line: 4 },
+ },
+ },
+ ],
+
+ range: [84, 110],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 1, line: 5 },
+ },
+ },
+
+ range: [73, 111],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 2, line: 5 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 112],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 6 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/1-TSESTree-AST.shot
index 742fbfdcd812..0a9ea38fabe5 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSIndexedAccessType {
@@ -20,7 +23,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "K",
+ optional: false,
range: [82, 83],
loc: {
@@ -39,7 +44,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [80, 81],
loc: {
@@ -84,6 +91,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 85],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/5-AST-Alignment-AST.shot
index cebd390f70d8..13b1dbd25268 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,115 @@
exports[`AST Fixtures legacy-fixtures types indexed AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSIndexedAccessType {
+ type: 'TSIndexedAccessType',
+ indexType: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'K',
+- optional: false,
+
+ range: [82, 83],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+
+ range: [82, 83],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+ objectType: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'T',
+- optional: false,
+
+ range: [80, 81],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [80, 81],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [80, 84],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+
+ range: [78, 84],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+
+ range: [77, 84],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 84],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 85],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 86],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/1-TSESTree-AST.shot
index 3cdaa13d47c9..5ee5b38f53b0 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/1-TSESTree-AST.shot
@@ -14,7 +14,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "size",
+ optional: false,
range: [97, 101],
loc: {
@@ -23,7 +25,9 @@ Program {
},
},
kind: "get",
+ optional: false,
params: [],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -42,6 +46,7 @@ Program {
end: { column: 20, line: 4 },
},
},
+ static: false,
range: [93, 112],
loc: {
@@ -54,7 +59,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "size",
+ optional: false,
range: [119, 123],
loc: {
@@ -63,10 +70,13 @@ Program {
},
},
kind: "set",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "value",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnionType {
@@ -122,6 +132,8 @@ Program {
},
},
],
+ readonly: false,
+ static: false,
range: [115, 158],
loc: {
@@ -137,9 +149,13 @@ Program {
end: { column: 1, line: 6 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Thing",
+ optional: false,
range: [83, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/5-AST-Alignment-AST.shot
index 385e910cd900..c9675620d002 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/interface-with-accessors/snapshots/5-AST-Alignment-AST.shot
@@ -18,7 +18,9 @@ exports[`AST Fixtures legacy-fixtures types interface-with-accessors AST Alignme
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'size',
+- optional: false,
range: [97, 101],
loc: {
@@ -27,7 +29,9 @@ exports[`AST Fixtures legacy-fixtures types interface-with-accessors AST Alignme
},
},
kind: 'get',
+- optional: false,
- params: Array [],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ parameters: Array [],
+ typeAnnotation: TSTypeAnnotation {
@@ -48,6 +52,7 @@ exports[`AST Fixtures legacy-fixtures types interface-with-accessors AST Alignme
end: { column: 20, line: 4 },
},
},
+- static: false,
range: [93, 112],
loc: {
@@ -60,7 +65,9 @@ exports[`AST Fixtures legacy-fixtures types interface-with-accessors AST Alignme
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'size',
+- optional: false,
range: [119, 123],
loc: {
@@ -69,11 +76,14 @@ exports[`AST Fixtures legacy-fixtures types interface-with-accessors AST Alignme
},
},
kind: 'set',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'value',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSUnionType {
@@ -129,6 +139,8 @@ exports[`AST Fixtures legacy-fixtures types interface-with-accessors AST Alignme
},
},
],
+- readonly: false,
+- static: false,
range: [115, 158],
loc: {
@@ -144,9 +156,13 @@ exports[`AST Fixtures legacy-fixtures types interface-with-accessors AST Alignme
end: { column: 1, line: 6 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Thing',
+- optional: false,
range: [83, 88],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot
index 8a6935a581d0..2b505af45b4d 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "LinkedList",
+ optional: false,
range: [78, 88],
loc: {
@@ -23,7 +26,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [94, 95],
loc: {
@@ -46,7 +51,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "next",
+ optional: false,
range: [100, 104],
loc: {
@@ -54,28 +61,23 @@ Program {
end: { column: 31, line: 3 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "LinkedList",
-
- range: [106, 116],
- loc: {
- start: { column: 33, line: 3 },
- end: { column: 43, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [117, 118],
loc: {
@@ -98,6 +100,18 @@ Program {
end: { column: 46, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "LinkedList",
+ optional: false,
+
+ range: [106, 116],
+ loc: {
+ start: { column: 33, line: 3 },
+ end: { column: 43, line: 3 },
+ },
+ },
range: [106, 119],
loc: {
@@ -144,7 +158,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [89, 90],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot
index 1a756edb61f7..21aa48fbc9af 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/intersection-type/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'LinkedList',
+- optional: false,
range: [78, 88],
loc: {
@@ -27,7 +30,9 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [94, 95],
loc: {
@@ -50,7 +55,9 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'next',
+- optional: false,
range: [100, 104],
loc: {
@@ -58,28 +65,34 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS
end: { column: 31, line: 3 },
},
},
+- optional: false,
+- readonly: false,
+- static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'LinkedList',
-
- range: [106, 116],
- loc: {
- start: { column: 33, line: 3 },
- end: { column: 43, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'LinkedList',
++
++ range: [106, 116],
++ loc: {
++ start: { column: 33, line: 3 },
++ end: { column: 43, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [117, 118],
loc: {
@@ -100,6 +113,18 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS
loc: {
start: { column: 43, line: 3 },
end: { column: 46, line: 3 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'LinkedList',
+- optional: false,
+-
+- range: [106, 116],
+- loc: {
+- start: { column: 33, line: 3 },
+- end: { column: 43, line: 3 },
},
},
@@ -148,7 +173,9 @@ exports[`AST Fixtures legacy-fixtures types intersection-type AST Alignment - AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [89, 90],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/1-TSESTree-AST.shot
index c5ac10f6295e..60ba2df8e35b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSLiteralType {
@@ -68,6 +71,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 83],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/5-AST-Alignment-AST.shot
index 3d4e5e78f7ef..0c3009c51c58 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,95 @@
exports[`AST Fixtures legacy-fixtures types literal-number-negative AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSLiteralType {
+ type: 'TSLiteralType',
+ literal: UnaryExpression {
+ type: 'UnaryExpression',
+ argument: Literal {
+ type: 'Literal',
+ raw: '1',
+ value: 1,
+
+ range: [81, 82],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ operator: '-',
+ prefix: true,
+
+ range: [80, 82],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+
+ range: [80, 82],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+
+ range: [78, 82],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+
+ range: [77, 82],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 82],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 83],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 84],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/1-TSESTree-AST.shot
index 6c06c92f57db..04decd134663 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSLiteralType {
@@ -57,6 +60,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 82],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/5-AST-Alignment-AST.shot
index 8c89c0f442ec..aae165b9340e 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,84 @@
exports[`AST Fixtures legacy-fixtures types literal-number AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSLiteralType {
+ type: 'TSLiteralType',
+ literal: Literal {
+ type: 'Literal',
+ raw: '0',
+ value: 0,
+
+ range: [80, 81],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [80, 81],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [77, 81],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 81],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 82],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 83],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/1-TSESTree-AST.shot
index 9fb6b4117f72..a5e0b48f53b1 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSLiteralType {
@@ -57,6 +60,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 86],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/5-AST-Alignment-AST.shot
index e1c0de620172..81f3f3505601 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,84 @@
exports[`AST Fixtures legacy-fixtures types literal-string AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSLiteralType {
+ type: 'TSLiteralType',
+ literal: Literal {
+ type: 'Literal',
+ raw: '\\'foo\\'',
+ value: 'foo',
+
+ range: [80, 85],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ range: [80, 85],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ range: [78, 85],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ range: [77, 85],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 85],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 86],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 87],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot
index 646e99d15643..ef00d6dd163a 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Test",
+ optional: false,
range: [78, 82],
loc: {
@@ -44,7 +47,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "P",
+ optional: false,
range: [117, 118],
loc: {
@@ -63,7 +68,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [115, 116],
loc: {
@@ -95,7 +102,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [104, 105],
loc: {
@@ -120,7 +129,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "P",
+ optional: false,
range: [93, 94],
loc: {
@@ -152,7 +163,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [83, 84],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot
index e18890770ec2..368c485e82da 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-named-type/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types mapped-named-type AST Alignment - AS
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Test',
+- optional: false,
range: [78, 82],
loc: {
@@ -48,7 +51,9 @@ exports[`AST Fixtures legacy-fixtures types mapped-named-type AST Alignment - AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'P',
+- optional: false,
range: [117, 118],
loc: {
@@ -67,7 +72,9 @@ exports[`AST Fixtures legacy-fixtures types mapped-named-type AST Alignment - AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [115, 116],
loc: {
@@ -99,7 +106,9 @@ exports[`AST Fixtures legacy-fixtures types mapped-named-type AST Alignment - AS
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [104, 105],
loc: {
@@ -124,7 +133,9 @@ exports[`AST Fixtures legacy-fixtures types mapped-named-type AST Alignment - AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'P',
+- optional: false,
-
- range: [93, 94],
- loc: {
@@ -157,7 +168,9 @@ exports[`AST Fixtures legacy-fixtures types mapped-named-type AST Alignment - AS
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [83, 84],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot
index a6cf5a6a9cee..5e7781c3ef65 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "map",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSMappedType {
@@ -43,7 +46,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "P",
+ optional: false,
range: [95, 96],
loc: {
@@ -89,6 +94,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 120],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot
index 624a79fb35de..5a1e7b20c516 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus AST Alignment
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'map',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSMappedType {
@@ -47,8 +50,11 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus AST Alignment
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'P',
--
+- optional: false,
++ name: 'P',
+
- range: [95, 96],
- loc: {
- start: { column: 22, line: 3 },
@@ -56,8 +62,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus AST Alignment
- },
- },
- out: false,
-+ name: 'P',
-
+-
range: [95, 106],
loc: {
start: { column: 22, line: 3 },
@@ -94,6 +99,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly-minus AST Alignment
},
},
],
+- declare: false,
kind: 'let',
range: [73, 120],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot
index 0bdfb991d52c..fcdef4d6c306 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "map",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSMappedType {
@@ -43,7 +46,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "P",
+ optional: false,
range: [95, 96],
loc: {
@@ -89,6 +94,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 120],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot
index e6d132ed1619..6beae1721224 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus AST Alignment -
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'map',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSMappedType {
@@ -47,8 +50,11 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus AST Alignment -
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'P',
--
+- optional: false,
++ name: 'P',
+
- range: [95, 96],
- loc: {
- start: { column: 22, line: 3 },
@@ -56,8 +62,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus AST Alignment -
- },
- },
- out: false,
-+ name: 'P',
-
+-
range: [95, 106],
loc: {
start: { column: 22, line: 3 },
@@ -94,6 +99,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly-plus AST Alignment -
},
},
],
+- declare: false,
kind: 'let',
range: [73, 120],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot
index 8c1a4635b40a..f70b1ed6956b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "map",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSMappedType {
@@ -43,7 +46,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "P",
+ optional: false,
range: [94, 95],
loc: {
@@ -89,6 +94,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot
index cd82008e2c36..8c8500647fd6 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly AST Alignment - AST
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'map',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSMappedType {
@@ -47,8 +50,11 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly AST Alignment - AST
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'P',
--
+- optional: false,
++ name: 'P',
+
- range: [94, 95],
- loc: {
- start: { column: 21, line: 3 },
@@ -56,8 +62,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly AST Alignment - AST
- },
- },
- out: false,
-+ name: 'P',
-
+-
range: [94, 105],
loc: {
start: { column: 21, line: 3 },
@@ -94,6 +99,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-readonly AST Alignment - AST
},
},
],
+- declare: false,
kind: 'let',
range: [73, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot
index fe12ec4ef043..d57cfcd0f424 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "map",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSMappedType {
@@ -32,7 +35,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "P",
+ optional: false,
range: [85, 86],
loc: {
@@ -78,6 +83,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 100],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot
index 11ad724238e3..5af936438b5b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types mapped-untypped AST Alignment - AST
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'map',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSMappedType {
@@ -36,8 +39,11 @@ exports[`AST Fixtures legacy-fixtures types mapped-untypped AST Alignment - AST
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'P',
--
+- optional: false,
++ name: 'P',
+
- range: [85, 86],
- loc: {
- start: { column: 12, line: 3 },
@@ -45,8 +51,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-untypped AST Alignment - AST
- },
- },
- out: false,
-+ name: 'P',
-
+-
range: [85, 96],
loc: {
start: { column: 12, line: 3 },
@@ -83,6 +88,7 @@ exports[`AST Fixtures legacy-fixtures types mapped-untypped AST Alignment - AST
},
},
],
+- declare: false,
kind: 'let',
range: [73, 100],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot
index 7c422caf01e5..82119bfda8e2 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "map",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSMappedType {
@@ -41,7 +44,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "P",
+ optional: false,
range: [85, 86],
loc: {
@@ -87,6 +92,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 108],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot
index 75db4f143539..2fcdfabe0986 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types mapped AST Alignment - AST 1`] = `
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'map',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSMappedType {
@@ -45,8 +48,11 @@ exports[`AST Fixtures legacy-fixtures types mapped AST Alignment - AST 1`] = `
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'P',
--
+- optional: false,
++ name: 'P',
+
- range: [85, 86],
- loc: {
- start: { column: 12, line: 3 },
@@ -54,8 +60,7 @@ exports[`AST Fixtures legacy-fixtures types mapped AST Alignment - AST 1`] = `
- },
- },
- out: false,
-+ name: 'P',
-
+-
range: [85, 96],
loc: {
start: { column: 12, line: 3 },
@@ -92,6 +97,7 @@ exports[`AST Fixtures legacy-fixtures types mapped AST Alignment - AST 1`] = `
},
},
],
+- declare: false,
kind: 'let',
range: [73, 108],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/1-TSESTree-AST.shot
index 9b1b1ae826cb..dbc54945f815 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/5-AST-Alignment-AST.shot
index 87b233890935..80ae05900af1 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types nested-types AST Alignment - AST 1`]
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Foo',
+- optional: false,
range: [78, 81],
loc: {
@@ -179,17 +182,7 @@ exports[`AST Fixtures legacy-fixtures types nested-types AST Alignment - AST 1`]
+ types: Array [
+ TSNullKeyword {
+ type: 'TSNullKeyword',
-
-- range: [139, 143],
-- loc: {
-- start: { column: 23, line: 5 },
-- end: { column: 27, line: 5 },
-- },
-- },
-- TSArrayType {
-- type: 'TSArrayType',
-- elementType: TSBooleanKeyword {
-- type: 'TSBooleanKeyword',
++
+ range: [139, 143],
+ loc: {
+ start: { column: 23, line: 5 },
@@ -201,17 +194,27 @@ exports[`AST Fixtures legacy-fixtures types nested-types AST Alignment - AST 1`]
+ elementType: TSBooleanKeyword {
+ type: 'TSBooleanKeyword',
-- range: [146, 153],
-- loc: {
-- start: { column: 30, line: 5 },
-- end: { column: 37, line: 5 },
+- range: [139, 143],
+- loc: {
+- start: { column: 23, line: 5 },
+- end: { column: 27, line: 5 },
+- },
+- },
+- TSArrayType {
+- type: 'TSArrayType',
+- elementType: TSBooleanKeyword {
+- type: 'TSBooleanKeyword',
+ range: [146, 153],
+ loc: {
+ start: { column: 30, line: 5 },
+ end: { column: 37, line: 5 },
+ },
+ },
-+
+
+- range: [146, 153],
+- loc: {
+- start: { column: 30, line: 5 },
+- end: { column: 37, line: 5 },
+ range: [146, 155],
+ loc: {
+ start: { column: 30, line: 5 },
@@ -241,54 +244,54 @@ exports[`AST Fixtures legacy-fixtures types nested-types AST Alignment - AST 1`]
+ end: { column: 40, line: 5 },
+ },
},
-+ ],
-+
-+ range: [126, 156],
-+ loc: {
-+ start: { column: 10, line: 5 },
-+ end: { column: 40, line: 5 },
- },
+- },
- ],
-+ },
-+ ],
++ ],
- range: [126, 156],
- loc: {
- start: { column: 10, line: 5 },
- end: { column: 40, line: 5 },
-- },
++ range: [126, 156],
++ loc: {
++ start: { column: 10, line: 5 },
++ end: { column: 40, line: 5 },
++ },
+ },
++ ],
++
+ range: [121, 157],
+ loc: {
+ start: { column: 5, line: 5 },
+ end: { column: 41, line: 5 },
},
- ],
--
++ },
++ TSTypeLiteral {
++ type: 'TSTypeLiteral',
++ members: Array [],
+
- range: [121, 157],
- loc: {
- start: { column: 5, line: 5 },
- end: { column: 41, line: 5 },
++ range: [160, 162],
++ loc: {
++ start: { column: 44, line: 5 },
++ end: { column: 46, line: 5 },
++ },
},
- },
- TSTypeLiteral {
- type: 'TSTypeLiteral',
- members: Array [],
-+ TSTypeLiteral {
-+ type: 'TSTypeLiteral',
-+ members: Array [],
++ ],
- range: [160, 162],
- loc: {
- start: { column: 44, line: 5 },
- end: { column: 46, line: 5 },
-+ range: [160, 162],
-+ loc: {
-+ start: { column: 44, line: 5 },
-+ end: { column: 46, line: 5 },
-+ },
- },
-+ ],
-+
+- },
+ range: [121, 162],
+ loc: {
+ start: { column: 5, line: 5 },
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/1-TSESTree-AST.shot
index 7c92699d3913..0b336f277a92 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Thing",
+ optional: false,
range: [78, 83],
loc: {
@@ -24,7 +27,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "size",
+ optional: false,
range: [94, 98],
loc: {
@@ -33,7 +38,9 @@ Program {
},
},
kind: "get",
+ optional: false,
params: [],
+ readonly: false,
returnType: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -52,6 +59,7 @@ Program {
end: { column: 20, line: 4 },
},
},
+ static: false,
range: [90, 109],
loc: {
@@ -64,7 +72,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "size",
+ optional: false,
range: [116, 120],
loc: {
@@ -73,10 +83,13 @@ Program {
},
},
kind: "set",
+ optional: false,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "value",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnionType {
@@ -132,6 +145,8 @@ Program {
},
},
],
+ readonly: false,
+ static: false,
range: [112, 155],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/5-AST-Alignment-AST.shot
index d1b1d336bcf5..f2c26b3d6fd8 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/object-literal-type-with-accessors/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors A
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Thing',
+- optional: false,
range: [78, 83],
loc: {
@@ -28,7 +31,9 @@ exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors A
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'size',
+- optional: false,
range: [94, 98],
loc: {
@@ -37,7 +42,9 @@ exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors A
},
},
kind: 'get',
+- optional: false,
- params: Array [],
+- readonly: false,
- returnType: TSTypeAnnotation {
+ parameters: Array [],
+ typeAnnotation: TSTypeAnnotation {
@@ -58,6 +65,7 @@ exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors A
end: { column: 20, line: 4 },
},
},
+- static: false,
range: [90, 109],
loc: {
@@ -70,7 +78,9 @@ exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors A
computed: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'size',
+- optional: false,
range: [116, 120],
loc: {
@@ -79,11 +89,14 @@ exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors A
},
},
kind: 'set',
+- optional: false,
- params: Array [
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'value',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSUnionType {
@@ -139,6 +152,8 @@ exports[`AST Fixtures legacy-fixtures types object-literal-type-with-accessors A
},
},
],
+- readonly: false,
+- static: false,
range: [112, 155],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot
index c30d5480c1f7..02cc273d157d 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Mapper",
+ optional: false,
range: [78, 84],
loc: {
@@ -21,14 +24,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [104, 105],
loc: {
@@ -64,7 +71,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [110, 111],
loc: {
@@ -102,7 +111,9 @@ Program {
in: true,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [88, 89],
loc: {
@@ -124,7 +135,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [95, 96],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot
index d5831586688e..3e272fa01fbe 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-and-out/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out AST Ali
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Mapper',
+- optional: false,
range: [78, 84],
loc: {
@@ -26,14 +29,18 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out AST Ali
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [104, 105],
loc: {
@@ -70,7 +77,9 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out AST Ali
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [110, 111],
loc: {
@@ -108,7 +117,9 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out AST Ali
in: true,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [88, 89],
- loc: {
@@ -131,7 +142,9 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-and-out AST Ali
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [95, 96],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot
index 1b19115ffe86..989cdb4163c0 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Processor",
+ optional: false,
range: [78, 87],
loc: {
@@ -21,14 +24,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [104, 105],
loc: {
@@ -64,7 +71,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [110, 111],
loc: {
@@ -102,7 +111,9 @@ Program {
in: true,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [95, 96],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot
index 5b560fa04c44..022afd59b609 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in-out/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-out AST Alignme
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Processor',
+- optional: false,
range: [78, 87],
loc: {
@@ -26,14 +29,18 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-out AST Alignme
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [104, 105],
loc: {
@@ -70,7 +77,9 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-out AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [110, 111],
loc: {
@@ -108,7 +117,9 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in-out AST Alignme
in: true,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [95, 96],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot
index faca7d2d1f9e..3289fff4fc2c 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Consumer",
+ optional: false,
range: [78, 86],
loc: {
@@ -21,14 +24,18 @@ Program {
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [99, 100],
loc: {
@@ -92,7 +99,9 @@ Program {
in: true,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [90, 91],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot
index 1c8d89c36809..6d432fe68d9b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-in/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in AST Alignment -
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Consumer',
+- optional: false,
range: [78, 86],
loc: {
@@ -26,14 +29,18 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in AST Alignment -
+ parameters: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [99, 100],
loc: {
@@ -98,7 +105,9 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-in AST Alignment -
in: true,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [90, 91],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot
index b815cfcfa19a..2b88be0b9888 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Provider",
+ optional: false,
range: [78, 86],
loc: {
@@ -25,7 +28,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [102, 103],
loc: {
@@ -63,7 +68,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [91, 92],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot
index 9afebcfe4301..55cf4924e65b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/optional-variance-out/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-out AST Alignment
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Provider',
+- optional: false,
range: [78, 86],
loc: {
@@ -31,7 +34,9 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-out AST Alignment
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [102, 103],
loc: {
@@ -69,7 +74,9 @@ exports[`AST Fixtures legacy-fixtures types optional-variance-out AST Alignment
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [91, 92],
- loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/1-TSESTree-AST.shot
index 5729d78a6fba..a5c59c38fe15 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/5-AST-Alignment-AST.shot
index 2a275a364407..85783e1a93c4 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/parenthesized-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,70 @@
exports[`AST Fixtures legacy-fixtures types parenthesized-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSUnionType {
+ type: 'TSUnionType',
+ types: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [93, 99],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+ ],
+
+ range: [84, 99],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+
+ range: [73, 100],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 101],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot
index 5012a3b27dc9..19b7f5d47af7 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/1-TSESTree-AST.shot
@@ -9,39 +9,22 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Array",
-
- range: [80, 85],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 12, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Array",
-
- range: [86, 91],
- loc: {
- start: { column: 13, line: 3 },
- end: { column: 18, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSNumberKeyword {
@@ -61,6 +44,18 @@ Program {
end: { column: 26, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Array",
+ optional: false,
+
+ range: [86, 91],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
range: [86, 99],
loc: {
@@ -76,6 +71,18 @@ Program {
end: { column: 27, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Array",
+ optional: false,
+
+ range: [80, 85],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
range: [80, 100],
loc: {
@@ -106,6 +113,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 101],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot
index 7a6abfb9236f..1d1e3d2d4774 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,159 @@
exports[`AST Fixtures legacy-fixtures types reference-generic-nested AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Array',
++
++ range: [80, 85],
++ loc: {
++ start: { column: 7, line: 3 },
++ end: { column: 12, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSTypeReference {
+ type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Array',
++
++ range: [86, 91],
++ loc: {
++ start: { column: 13, line: 3 },
++ end: { column: 18, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [92, 98],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 25, line: 3 },
+ },
+ },
+ ],
+
+ range: [91, 99],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Array',
+- optional: false,
+-
+- range: [86, 91],
+- loc: {
+- start: { column: 13, line: 3 },
+- end: { column: 18, line: 3 },
+- },
+- },
+
+ range: [86, 99],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+ ],
+
+ range: [85, 100],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Array',
+- optional: false,
+-
+- range: [80, 85],
+- loc: {
+- start: { column: 7, line: 3 },
+- end: { column: 12, line: 3 },
+- },
+- },
+
+ range: [80, 100],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+
+ range: [78, 100],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+
+ range: [77, 100],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 100],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 101],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 102],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot
index 50b96bafccea..21655befda9d 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/1-TSESTree-AST.shot
@@ -9,24 +9,17 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Array",
-
- range: [80, 85],
- loc: {
- start: { column: 7, line: 3 },
- end: { column: 12, line: 3 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSNumberKeyword {
@@ -46,6 +39,18 @@ Program {
end: { column: 20, line: 3 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Array",
+ optional: false,
+
+ range: [80, 85],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
range: [80, 93],
loc: {
@@ -76,6 +81,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 94],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot
index 5653a047406e..ef82ec276a6b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,116 @@
exports[`AST Fixtures legacy-fixtures types reference-generic AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'Array',
++
++ range: [80, 85],
++ loc: {
++ start: { column: 7, line: 3 },
++ end: { column: 12, line: 3 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [86, 92],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ ],
+
+ range: [85, 93],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Array',
+- optional: false,
+
+- range: [80, 85],
+- loc: {
+- start: { column: 7, line: 3 },
+- end: { column: 12, line: 3 },
+- },
+- },
+-
+ range: [80, 93],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [78, 93],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [77, 93],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 93],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 95],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/1-TSESTree-AST.shot
index c3beb71c60b6..8805dcedca14 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/1-TSESTree-AST.shot
@@ -9,16 +9,21 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [80, 81],
loc: {
@@ -56,6 +61,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 82],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/5-AST-Alignment-AST.shot
index c396b9e2ddb6..2d73832918f6 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,85 @@
exports[`AST Fixtures legacy-fixtures types reference AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'T',
+- optional: false,
+
+ range: [80, 81],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [80, 81],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+
+ range: [77, 81],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 81],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 82],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 83],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/1-TSESTree-AST.shot
index e489dedcf781..9942b2c7959f 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [78, 79],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/5-AST-Alignment-AST.shot
index e85a5a9b7bf2..b07fdd831c69 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-1/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,76 @@
exports[`AST Fixtures legacy-fixtures types template-literal-type-1 AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'T',
+- optional: false,
+
+ range: [78, 79],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 6, line: 3 },
+ },
+ },
+ typeAnnotation: TSLiteralType {
+ type: 'TSLiteralType',
+ literal: TemplateLiteral {
+ type: 'TemplateLiteral',
+ expressions: Array [],
+ quasis: Array [
+ TemplateElement {
+ type: 'TemplateElement',
+ tail: true,
+ value: Object {
+ 'cooked': 'foo',
+ 'raw': 'foo',
+ },
+
+ range: [82, 87],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+
+ range: [82, 87],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [82, 87],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [73, 88],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 89],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/1-TSESTree-AST.shot
index 4ac13fbd2c3c..b0f8d40f1633 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [78, 79],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/5-AST-Alignment-AST.shot
index f15ba271fc39..404715ae22a3 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-2/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-2 AST Alignmen
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'T',
+- optional: false,
range: [78, 79],
loc: {
@@ -30,18 +33,7 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-2 AST Alignmen
- 'cooked': 'foo',
- 'raw': 'foo',
- },
-+ typeAnnotation: TSLiteralType {
-+ type: 'TSLiteralType',
-+ literal: TemplateLiteral {
-+ type: 'TemplateLiteral',
-+ expressions: Array [
-+ TSLiteralType {
-+ type: 'TSLiteralType',
-+ literal: Literal {
-+ type: 'Literal',
-+ raw: '\\'bar\\'',
-+ value: 'bar',
-
+-
- range: [82, 88],
- loc: {
- start: { column: 9, line: 3 },
@@ -55,12 +47,17 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-2 AST Alignmen
- 'cooked': '',
- 'raw': '',
- },
-+ range: [88, 93],
-+ loc: {
-+ start: { column: 15, line: 3 },
-+ end: { column: 20, line: 3 },
-+ },
-+ },
++ typeAnnotation: TSLiteralType {
++ type: 'TSLiteralType',
++ literal: TemplateLiteral {
++ type: 'TemplateLiteral',
++ expressions: Array [
++ TSLiteralType {
++ type: 'TSLiteralType',
++ literal: Literal {
++ type: 'Literal',
++ raw: '\\'bar\\'',
++ value: 'bar',
- range: [93, 95],
- loc: {
@@ -76,7 +73,13 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-2 AST Alignmen
- type: 'Literal',
- raw: '\\'bar\\'',
- value: 'bar',
--
++ range: [88, 93],
++ loc: {
++ start: { column: 15, line: 3 },
++ end: { column: 20, line: 3 },
++ },
++ },
+
range: [88, 93],
loc: {
start: { column: 15, line: 3 },
@@ -102,7 +105,7 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-2 AST Alignmen
+ start: { column: 9, line: 3 },
+ end: { column: 15, line: 3 },
+ },
-+ },
+ },
+ TemplateElement {
+ type: 'TemplateElement',
+ tail: true,
@@ -116,7 +119,7 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-2 AST Alignmen
+ start: { column: 20, line: 3 },
+ end: { column: 22, line: 3 },
+ },
- },
++ },
+ ],
+
+ range: [82, 95],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/1-TSESTree-AST.shot
index 30a5603b2a01..fbf01b73f264 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Color",
+ optional: false,
range: [78, 83],
loc: {
@@ -76,9 +79,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Quantity",
+ optional: false,
range: [107, 115],
loc: {
@@ -146,9 +152,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "SeussFish",
+ optional: false,
range: [138, 147],
loc: {
@@ -196,7 +205,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Quantity",
+ optional: false,
range: [153, 161],
loc: {
@@ -215,7 +226,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "Color",
+ optional: false,
range: [164, 169],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/5-AST-Alignment-AST.shot
index 570ef602314d..44cf2dd87553 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-3/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-3 AST Alignmen
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Color',
+- optional: false,
range: [78, 83],
loc: {
@@ -80,9 +83,12 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-3 AST Alignmen
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Quantity',
+- optional: false,
range: [107, 115],
loc: {
@@ -150,9 +156,12 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-3 AST Alignmen
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'SeussFish',
+- optional: false,
range: [138, 147],
loc: {
@@ -170,6 +179,20 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-3 AST Alignmen
- 'cooked': '',
- 'raw': '',
- },
+-
+- range: [150, 153],
+- loc: {
+- start: { column: 17, line: 5 },
+- end: { column: 20, line: 5 },
+- },
+- },
+- TemplateElement {
+- type: 'TemplateElement',
+- tail: true,
+- value: Object {
+- 'cooked': ' fish',
+- 'raw': ' fish',
+- },
+ typeAnnotation: TSLiteralType {
+ type: 'TSLiteralType',
+ literal: TemplateLiteral {
@@ -184,20 +207,6 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-3 AST Alignmen
+ type: 'Identifier',
+ name: 'Quantity',
-- range: [150, 153],
-- loc: {
-- start: { column: 17, line: 5 },
-- end: { column: 20, line: 5 },
-- },
-- },
-- TemplateElement {
-- type: 'TemplateElement',
-- tail: true,
-- value: Object {
-- 'cooked': ' fish',
-- 'raw': ' fish',
-- },
--
- range: [169, 176],
- loc: {
- start: { column: 36, line: 5 },
@@ -213,7 +222,9 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-3 AST Alignmen
- type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'Quantity',
+- optional: false,
+ range: [153, 161],
+ loc: {
+ start: { column: 20, line: 5 },
@@ -243,7 +254,9 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-3 AST Alignmen
- type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'Color',
+- optional: false,
+ range: [164, 169],
+ loc: {
+ start: { column: 31, line: 5 },
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot
index 36213a03e944..08cdee8255cd 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "EnthusiasticGreeting",
+ optional: false,
range: [78, 98],
loc: {
@@ -93,24 +96,16 @@ Program {
types: [
TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Uppercase",
-
- range: [124, 133],
- loc: {
- start: { column: 5, line: 4 },
- end: { column: 14, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [134, 135],
loc: {
@@ -133,6 +128,18 @@ Program {
end: { column: 17, line: 4 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Uppercase",
+ optional: false,
+
+ range: [124, 133],
+ loc: {
+ start: { column: 5, line: 4 },
+ end: { column: 14, line: 4 },
+ },
+ },
range: [124, 136],
loc: {
@@ -142,24 +149,16 @@ Program {
},
TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Lowercase",
-
- range: [142, 151],
- loc: {
- start: { column: 23, line: 4 },
- end: { column: 32, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [152, 153],
loc: {
@@ -182,6 +181,18 @@ Program {
end: { column: 35, line: 4 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Lowercase",
+ optional: false,
+
+ range: [142, 151],
+ loc: {
+ start: { column: 23, line: 4 },
+ end: { column: 32, line: 4 },
+ },
+ },
range: [142, 154],
loc: {
@@ -191,24 +202,16 @@ Program {
},
TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Capitalize",
-
- range: [160, 170],
- loc: {
- start: { column: 41, line: 4 },
- end: { column: 51, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [171, 172],
loc: {
@@ -231,6 +234,18 @@ Program {
end: { column: 54, line: 4 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Capitalize",
+ optional: false,
+
+ range: [160, 170],
+ loc: {
+ start: { column: 41, line: 4 },
+ end: { column: 51, line: 4 },
+ },
+ },
range: [160, 173],
loc: {
@@ -240,24 +255,16 @@ Program {
},
TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "Uncapitalize",
-
- range: [179, 191],
- loc: {
- start: { column: 60, line: 4 },
- end: { column: 72, line: 4 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [192, 193],
loc: {
@@ -280,6 +287,18 @@ Program {
end: { column: 75, line: 4 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Uncapitalize",
+ optional: false,
+
+ range: [179, 191],
+ loc: {
+ start: { column: 60, line: 4 },
+ end: { column: 72, line: 4 },
+ },
+ },
range: [179, 194],
loc: {
@@ -313,7 +332,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [99, 100],
loc: {
@@ -346,9 +367,12 @@ Program {
},
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "HELLO",
+ optional: false,
range: [203, 208],
loc: {
@@ -358,17 +382,7 @@ Program {
},
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
- typeName: Identifier {
- type: "Identifier",
- name: "EnthusiasticGreeting",
-
- range: [211, 231],
- loc: {
- start: { column: 13, line: 5 },
- end: { column: 33, line: 5 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSLiteralType {
@@ -399,6 +413,18 @@ Program {
end: { column: 42, line: 5 },
},
},
+ typeName: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "EnthusiasticGreeting",
+ optional: false,
+
+ range: [211, 231],
+ loc: {
+ start: { column: 13, line: 5 },
+ end: { column: 33, line: 5 },
+ },
+ },
range: [211, 240],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot
index a1f3c64cd6b3..1b0760380972 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/template-literal-type-4/snapshots/5-AST-Alignment-AST.shot
@@ -10,9 +10,12 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
body: Array [
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'EnthusiasticGreeting',
+- optional: false,
range: [78, 98],
loc: {
@@ -121,24 +124,16 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
- types: Array [
- TSTypeReference {
- type: 'TSTypeReference',
-- typeName: Identifier {
-- type: 'Identifier',
-- name: 'Uppercase',
--
-- range: [124, 133],
-- loc: {
-- start: { column: 5, line: 4 },
-- end: { column: 14, line: 4 },
-- },
-- },
-- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
- type: 'TSTypeParameterInstantiation',
- params: Array [
- TSTypeReference {
- type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
+ range: [134, 135],
+ loc: {
+ start: { column: 15, line: 4 },
@@ -175,28 +170,21 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
end: { column: 17, line: 4 },
},
},
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Uppercase',
+- optional: false,
+ TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+ name: 'Lowercase',
-- range: [124, 136],
-- loc: {
-- start: { column: 5, line: 4 },
-- end: { column: 17, line: 4 },
-- },
-- },
-- TSTypeReference {
-- type: 'TSTypeReference',
-- typeName: Identifier {
-- type: 'Identifier',
-- name: 'Lowercase',
--
-- range: [142, 151],
+- range: [124, 133],
- loc: {
-- start: { column: 23, line: 4 },
-- end: { column: 32, line: 4 },
+- start: { column: 5, line: 4 },
+- end: { column: 14, line: 4 },
+ range: [142, 151],
+ loc: {
+ start: { column: 23, line: 4 },
@@ -204,14 +192,6 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ },
},
- },
-- typeParameters: TSTypeParameterInstantiation {
-- type: 'TSTypeParameterInstantiation',
-- params: Array [
-- TSTypeReference {
-- type: 'TSTypeReference',
-- typeName: Identifier {
-- type: 'Identifier',
-- name: 'T',
+ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
@@ -220,7 +200,25 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ typeName: Identifier {
+ type: 'Identifier',
+ name: 'T',
-+
+
+- range: [124, 136],
+- loc: {
+- start: { column: 5, line: 4 },
+- end: { column: 17, line: 4 },
+- },
+- },
+- TSTypeReference {
+- type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
+- type: 'TSTypeParameterInstantiation',
+- params: Array [
+- TSTypeReference {
+- type: 'TSTypeReference',
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'T',
+- optional: false,
+ range: [152, 153],
+ loc: {
+ start: { column: 33, line: 4 },
@@ -256,29 +254,22 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ start: { column: 23, line: 4 },
end: { column: 35, line: 4 },
},
-- },
--
-- range: [142, 154],
-- loc: {
-- start: { column: 23, line: 4 },
-- end: { column: 35, line: 4 },
},
-- },
-- TSTypeReference {
-- type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
-- name: 'Capitalize',
+- decorators: Array [],
+- name: 'Lowercase',
+- optional: false,
+ TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+ name: 'Capitalize',
-- range: [160, 170],
+- range: [142, 151],
- loc: {
-- start: { column: 41, line: 4 },
-- end: { column: 51, line: 4 },
+- start: { column: 23, line: 4 },
+- end: { column: 32, line: 4 },
+ range: [160, 170],
+ loc: {
+ start: { column: 41, line: 4 },
@@ -286,14 +277,6 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ },
},
- },
-- typeParameters: TSTypeParameterInstantiation {
-- type: 'TSTypeParameterInstantiation',
-- params: Array [
-- TSTypeReference {
-- type: 'TSTypeReference',
-- typeName: Identifier {
-- type: 'Identifier',
-- name: 'T',
+ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
@@ -303,13 +286,31 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ type: 'Identifier',
+ name: 'T',
+- range: [142, 154],
+- loc: {
+- start: { column: 23, line: 4 },
+- end: { column: 35, line: 4 },
+- },
+- },
+- TSTypeReference {
+- type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
+- type: 'TSTypeParameterInstantiation',
+- params: Array [
+- TSTypeReference {
+- type: 'TSTypeReference',
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'T',
+- optional: false,
+ range: [171, 172],
+ loc: {
+ start: { column: 52, line: 4 },
+ end: { column: 53, line: 4 },
+ },
+ },
-+
+
range: [171, 172],
loc: {
start: { column: 52, line: 4 },
@@ -338,29 +339,22 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ start: { column: 41, line: 4 },
end: { column: 54, line: 4 },
},
-- },
--
-- range: [160, 173],
-- loc: {
-- start: { column: 41, line: 4 },
-- end: { column: 54, line: 4 },
},
-- },
-- TSTypeReference {
-- type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
-- name: 'Uncapitalize',
+- decorators: Array [],
+- name: 'Capitalize',
+- optional: false,
+ TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+ name: 'Uncapitalize',
-- range: [179, 191],
+- range: [160, 170],
- loc: {
-- start: { column: 60, line: 4 },
-- end: { column: 72, line: 4 },
+- start: { column: 41, line: 4 },
+- end: { column: 51, line: 4 },
+ range: [179, 191],
+ loc: {
+ start: { column: 60, line: 4 },
@@ -368,14 +362,6 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ },
},
- },
-- typeParameters: TSTypeParameterInstantiation {
-- type: 'TSTypeParameterInstantiation',
-- params: Array [
-- TSTypeReference {
-- type: 'TSTypeReference',
-- typeName: Identifier {
-- type: 'Identifier',
-- name: 'T',
+ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
@@ -384,7 +370,25 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ typeName: Identifier {
+ type: 'Identifier',
+ name: 'T',
-+
+
+- range: [160, 173],
+- loc: {
+- start: { column: 41, line: 4 },
+- end: { column: 54, line: 4 },
+- },
+- },
+- TSTypeReference {
+- type: 'TSTypeReference',
+- typeArguments: TSTypeParameterInstantiation {
+- type: 'TSTypeParameterInstantiation',
+- params: Array [
+- TSTypeReference {
+- type: 'TSTypeReference',
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'T',
+- optional: false,
+ range: [192, 193],
+ loc: {
+ start: { column: 73, line: 4 },
@@ -421,6 +425,11 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
end: { column: 75, line: 4 },
},
},
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'Uncapitalize',
+- optional: false,
+ ],
+ quasis: Array [
+ TemplateElement {
@@ -430,11 +439,7 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ 'cooked': '',
+ 'raw': '',
+ },
-
-- range: [179, 194],
-- loc: {
-- start: { column: 60, line: 4 },
-- end: { column: 75, line: 4 },
++
+ range: [121, 124],
+ loc: {
+ start: { column: 2, line: 4 },
@@ -448,13 +453,16 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ 'cooked': ' - ',
+ 'raw': ' - ',
+ },
-+
+
+- range: [179, 191],
+ range: [136, 142],
-+ loc: {
+ loc: {
+- start: { column: 60, line: 4 },
+- end: { column: 72, line: 4 },
+ start: { column: 17, line: 4 },
+ end: { column: 23, line: 4 },
-+ },
-+ },
+ },
+ },
+ TemplateElement {
+ type: 'TemplateElement',
+ tail: false,
@@ -462,7 +470,11 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
+ 'cooked': ' - ',
+ 'raw': ' - ',
+ },
-+
+
+- range: [179, 194],
+- loc: {
+- start: { column: 60, line: 4 },
+- end: { column: 75, line: 4 },
+ range: [154, 160],
+ loc: {
+ start: { column: 35, line: 4 },
@@ -531,7 +543,9 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [99, 100],
- loc: {
@@ -565,9 +579,12 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
},
TSTypeAliasDeclaration {
type: 'TSTypeAliasDeclaration',
+- declare: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'HELLO',
+- optional: false,
range: [203, 208],
loc: {
@@ -577,17 +594,18 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
},
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
- typeName: Identifier {
- type: 'Identifier',
- name: 'EnthusiasticGreeting',
-
- range: [211, 231],
- loc: {
- start: { column: 13, line: 5 },
- end: { column: 33, line: 5 },
- },
- },
- typeParameters: TSTypeParameterInstantiation {
+- typeArguments: TSTypeParameterInstantiation {
++ typeName: Identifier {
++ type: 'Identifier',
++ name: 'EnthusiasticGreeting',
++
++ range: [211, 231],
++ loc: {
++ start: { column: 13, line: 5 },
++ end: { column: 33, line: 5 },
++ },
++ },
++ typeParameters: TSTypeParameterInstantiation {
type: 'TSTypeParameterInstantiation',
params: Array [
TSLiteralType {
@@ -616,6 +634,18 @@ exports[`AST Fixtures legacy-fixtures types template-literal-type-4 AST Alignmen
loc: {
start: { column: 33, line: 5 },
end: { column: 42, line: 5 },
+- },
+- },
+- typeName: Identifier {
+- type: 'Identifier',
+- decorators: Array [],
+- name: 'EnthusiasticGreeting',
+- optional: false,
+-
+- range: [211, 231],
+- loc: {
+- start: { column: 13, line: 5 },
+- end: { column: 33, line: 5 },
},
},
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/1-TSESTree-AST.shot
index 352030ef386a..822ae4ea3367 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
@@ -14,9 +15,13 @@ Program {
accessibility: "public",
computed: false,
declare: false,
+ decorators: [],
+ definite: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [92, 93],
loc: {
@@ -24,7 +29,9 @@ Program {
end: { column: 10, line: 4 },
},
},
+ optional: false,
override: false,
+ readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
@@ -56,9 +63,12 @@ Program {
type: "MethodDefinition",
accessibility: "public",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "method",
+ optional: false,
range: [113, 119],
loc: {
@@ -67,6 +77,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -92,7 +103,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [158, 159],
loc: {
@@ -122,13 +135,16 @@ Program {
end: { column: 3, line: 8 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "this",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSThisType {
@@ -191,9 +207,12 @@ Program {
type: "MethodDefinition",
accessibility: "public",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "method2",
+ optional: false,
range: [175, 182],
loc: {
@@ -202,6 +221,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -227,7 +247,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [216, 217],
loc: {
@@ -257,20 +279,25 @@ Program {
end: { column: 3, line: 12 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "this",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [189, 190],
loc: {
@@ -336,9 +363,12 @@ Program {
type: "MethodDefinition",
accessibility: "public",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "method3",
+ optional: false,
range: [233, 240],
loc: {
@@ -347,6 +377,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -360,9 +391,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [271, 273],
loc: {
@@ -388,7 +422,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [287, 288],
loc: {
@@ -422,6 +458,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [267, 289],
@@ -437,7 +474,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [301, 303],
loc: {
@@ -468,13 +507,16 @@ Program {
end: { column: 3, line: 17 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "this",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSThisType {
@@ -537,9 +579,12 @@ Program {
type: "MethodDefinition",
accessibility: "public",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "method4",
+ optional: false,
range: [321, 328],
loc: {
@@ -548,6 +593,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -561,9 +607,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [356, 358],
loc: {
@@ -589,7 +638,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [372, 373],
loc: {
@@ -623,6 +674,7 @@ Program {
},
},
],
+ declare: false,
kind: "var",
range: [352, 374],
@@ -638,7 +690,9 @@ Program {
arguments: [],
callee: Identifier {
type: "Identifier",
+ decorators: [],
name: "fn",
+ optional: false,
range: [386, 388],
loc: {
@@ -669,20 +723,25 @@ Program {
end: { column: 3, line: 22 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "this",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [335, 336],
loc: {
@@ -747,9 +806,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "staticMethod",
+ optional: false,
range: [406, 418],
loc: {
@@ -758,6 +820,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: true,
value: FunctionExpression {
@@ -783,7 +846,9 @@ Program {
optional: false,
property: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [454, 455],
loc: {
@@ -813,20 +878,25 @@ Program {
end: { column: 3, line: 26 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "this",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [425, 426],
loc: {
@@ -891,9 +961,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "typeof",
+ optional: false,
range: [471, 477],
loc: {
@@ -902,6 +975,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: true,
value: FunctionExpression {
@@ -947,20 +1021,25 @@ Program {
end: { column: 3, line: 30 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
params: [
Identifier {
type: "Identifier",
+ decorators: [],
name: "this",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [484, 485],
loc: {
@@ -1030,9 +1109,13 @@ Program {
end: { column: 1, line: 31 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [79, 80],
loc: {
@@ -1040,6 +1123,7 @@ Program {
end: { column: 7, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 524],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/5-AST-Alignment-AST.shot
index 11f2406bcb57..9e0dd132e21e 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
@@ -18,9 +19,13 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
accessibility: 'public',
computed: false,
- declare: false,
+- decorators: Array [],
+- definite: false,
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [92, 93],
loc: {
@@ -28,7 +33,9 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
end: { column: 10, line: 4 },
},
},
+- optional: false,
- override: false,
+- readonly: false,
static: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
@@ -60,9 +67,12 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
type: 'MethodDefinition',
accessibility: 'public',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'method',
+- optional: false,
range: [113, 119],
loc: {
@@ -71,6 +81,7 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -96,7 +107,9 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [158, 159],
loc: {
@@ -126,13 +139,16 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
end: { column: 3, line: 8 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'this',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSThisType {
@@ -195,9 +211,12 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
type: 'MethodDefinition',
accessibility: 'public',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'method2',
+- optional: false,
range: [175, 182],
loc: {
@@ -206,6 +225,7 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -231,7 +251,9 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [216, 217],
loc: {
@@ -261,20 +283,25 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
end: { column: 3, line: 12 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'this',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [189, 190],
loc: {
@@ -340,9 +367,12 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
type: 'MethodDefinition',
accessibility: 'public',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'method3',
+- optional: false,
range: [233, 240],
loc: {
@@ -351,6 +381,7 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -364,9 +395,12 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'fn',
+- optional: false,
range: [271, 273],
loc: {
@@ -392,7 +426,9 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [287, 288],
loc: {
@@ -426,6 +462,7 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
},
},
],
+- declare: false,
kind: 'var',
range: [267, 289],
@@ -441,7 +478,9 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
arguments: Array [],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'fn',
+- optional: false,
range: [301, 303],
loc: {
@@ -472,13 +511,16 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
end: { column: 3, line: 17 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'this',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSThisType {
@@ -541,9 +583,12 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
type: 'MethodDefinition',
accessibility: 'public',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'method4',
+- optional: false,
range: [321, 328],
loc: {
@@ -552,6 +597,7 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -565,9 +611,12 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'fn',
+- optional: false,
range: [356, 358],
loc: {
@@ -593,7 +642,9 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [372, 373],
loc: {
@@ -627,6 +678,7 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
},
},
],
+- declare: false,
kind: 'var',
range: [352, 374],
@@ -642,7 +694,9 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
arguments: Array [],
callee: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'fn',
+- optional: false,
range: [386, 388],
loc: {
@@ -673,20 +727,25 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
end: { column: 3, line: 22 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'this',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [335, 336],
loc: {
@@ -751,9 +810,12 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'staticMethod',
+- optional: false,
range: [406, 418],
loc: {
@@ -762,6 +824,7 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: true,
value: FunctionExpression {
@@ -787,7 +850,9 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
optional: false,
property: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [454, 455],
loc: {
@@ -817,20 +882,25 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
end: { column: 3, line: 26 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'this',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [425, 426],
loc: {
@@ -895,9 +965,12 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'typeof',
+- optional: false,
range: [471, 477],
loc: {
@@ -906,6 +979,7 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
},
},
kind: 'method',
+- optional: false,
- override: false,
static: true,
value: FunctionExpression {
@@ -951,20 +1025,25 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
end: { column: 3, line: 30 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
params: Array [
Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'this',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeReference {
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [484, 485],
loc: {
@@ -1034,9 +1113,13 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
end: { column: 1, line: 31 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [79, 80],
loc: {
@@ -1044,6 +1127,7 @@ exports[`AST Fixtures legacy-fixtures types this-type-expanded AST Alignment - A
end: { column: 7, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 524],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/1-TSESTree-AST.shot
index c87626f17e1c..cd31f7615741 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "clone",
+ optional: false,
range: [91, 96],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -57,6 +62,7 @@ Program {
end: { column: 3, line: 6 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -101,9 +107,13 @@ Program {
end: { column: 1, line: 7 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Message",
+ optional: false,
range: [79, 86],
loc: {
@@ -111,6 +121,7 @@ Program {
end: { column: 13, line: 3 },
},
},
+ implements: [],
superClass: null,
range: [73, 129],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/5-AST-Alignment-AST.shot
index f4e9993acaef..2f079c26764e 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures legacy-fixtures types this-type AST Alignment - AST 1`] =
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'clone',
+- optional: false,
range: [91, 96],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures legacy-fixtures types this-type AST Alignment - AST 1`] =
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -61,6 +66,7 @@ exports[`AST Fixtures legacy-fixtures types this-type AST Alignment - AST 1`] =
end: { column: 3, line: 6 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -105,9 +111,13 @@ exports[`AST Fixtures legacy-fixtures types this-type AST Alignment - AST 1`] =
end: { column: 1, line: 7 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'Message',
+- optional: false,
range: [79, 86],
loc: {
@@ -115,6 +125,7 @@ exports[`AST Fixtures legacy-fixtures types this-type AST Alignment - AST 1`] =
end: { column: 13, line: 3 },
},
},
+- implements: Array [],
superClass: null,
range: [73, 129],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/1-TSESTree-AST.shot
index 239f33768f09..f2472dfa34b6 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTupleType {
@@ -47,6 +50,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 83],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/5-AST-Alignment-AST.shot
index f467aab6aae7..93ce1725a9e0 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,74 @@
exports[`AST Fixtures legacy-fixtures types tuple-empty AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTupleType {
+ type: 'TSTupleType',
+ elementTypes: Array [],
+
+ range: [80, 82],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+
+ range: [78, 82],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+
+ range: [77, 82],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 82],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 83],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 10, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 84],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/1-TSESTree-AST.shot
index 99d8dc3bbeb9..707abc21ee7c 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTupleType {
@@ -30,7 +33,9 @@ Program {
},
label: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [81, 82],
loc: {
@@ -59,7 +64,9 @@ Program {
},
label: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [92, 93],
loc: {
@@ -108,7 +115,9 @@ Program {
},
label: Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [104, 105],
loc: {
@@ -155,6 +164,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 125],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/5-AST-Alignment-AST.shot
index 487dca4144bf..cf045fd04e46 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,188 @@
exports[`AST Fixtures legacy-fixtures types tuple-named-optional AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTupleType {
+ type: 'TSTupleType',
+ elementTypes: Array [
+ TSNamedTupleMember {
+ type: 'TSNamedTupleMember',
+ elementType: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ label: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [81, 82],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ optional: false,
+
+ range: [81, 90],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ TSNamedTupleMember {
+ type: 'TSNamedTupleMember',
+ elementType: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [96, 102],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ label: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [92, 93],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ optional: true,
+
+ range: [92, 102],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ TSNamedTupleMember {
+ type: 'TSNamedTupleMember',
+ elementType: TSUnionType {
+ type: 'TSUnionType',
+ types: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [108, 114],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [117, 123],
+ loc: {
+ start: { column: 44, line: 3 },
+ end: { column: 50, line: 3 },
+ },
+ },
+ ],
+
+ range: [108, 123],
+ loc: {
+ start: { column: 35, line: 3 },
+ end: { column: 50, line: 3 },
+ },
+ },
+ label: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'c',
+- optional: false,
+
+ range: [104, 105],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
+ optional: true,
+
+ range: [104, 123],
+ loc: {
+ start: { column: 31, line: 3 },
+ end: { column: 50, line: 3 },
+ },
+ },
+ ],
+
+ range: [80, 124],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 51, line: 3 },
+ },
+ },
+
+ range: [78, 124],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 51, line: 3 },
+ },
+ },
+
+ range: [77, 124],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 51, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 124],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 51, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 125],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 52, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 126],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/1-TSESTree-AST.shot
index 45c75cbc463f..b59584ba3772 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTupleType {
@@ -30,7 +33,9 @@ Program {
},
label: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [81, 82],
loc: {
@@ -70,7 +75,9 @@ Program {
},
label: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [95, 96],
loc: {
@@ -124,6 +131,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 108],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/5-AST-Alignment-AST.shot
index 4355a551b828..c7398b84a5b3 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,155 @@
exports[`AST Fixtures legacy-fixtures types tuple-named-rest AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTupleType {
+ type: 'TSTupleType',
+ elementTypes: Array [
+ TSNamedTupleMember {
+ type: 'TSNamedTupleMember',
+ elementType: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ label: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [81, 82],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ optional: false,
+
+ range: [81, 90],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ TSRestType {
+ type: 'TSRestType',
+ typeAnnotation: TSNamedTupleMember {
+ type: 'TSNamedTupleMember',
+ elementType: TSArrayType {
+ type: 'TSArrayType',
+ elementType: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [98, 104],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+
+ range: [98, 106],
+ loc: {
+ start: { column: 25, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
+ label: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [95, 96],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ optional: false,
+
+ range: [95, 106],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
+
+ range: [92, 106],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
+ ],
+
+ range: [80, 107],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [78, 107],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [77, 107],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 107],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 108],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 35, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 109],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/1-TSESTree-AST.shot
index 64bc8b2e2f6c..a734af5b7e10 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
@@ -32,7 +35,9 @@ Program {
},
label: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [85, 86],
loc: {
@@ -61,7 +66,9 @@ Program {
},
label: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [96, 97],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/5-AST-Alignment-AST.shot
index 8767560841d4..44ce3bf0db01 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,114 @@
exports[`AST Fixtures legacy-fixtures types tuple-named-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSTupleType {
+ type: 'TSTupleType',
+ elementTypes: Array [
+ TSNamedTupleMember {
+ type: 'TSNamedTupleMember',
+ elementType: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [88, 94],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ label: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [85, 86],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ optional: false,
+
+ range: [85, 94],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ TSNamedTupleMember {
+ type: 'TSNamedTupleMember',
+ elementType: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [100, 106],
+ loc: {
+ start: { column: 27, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
+ label: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [96, 97],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 24, line: 3 },
+ },
+ },
+ optional: true,
+
+ range: [96, 106],
+ loc: {
+ start: { column: 23, line: 3 },
+ end: { column: 33, line: 3 },
+ },
+ },
+ ],
+
+ range: [84, 107],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 34, line: 3 },
+ },
+ },
+
+ range: [73, 108],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 35, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 109],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/1-TSESTree-AST.shot
index 7dea97ebde46..a1e56710e951 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTupleType {
@@ -30,7 +33,9 @@ Program {
},
label: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [81, 82],
loc: {
@@ -59,7 +64,9 @@ Program {
},
label: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [92, 93],
loc: {
@@ -88,7 +95,9 @@ Program {
},
label: Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [103, 104],
loc: {
@@ -135,6 +144,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 114],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/5-AST-Alignment-AST.shot
index 99fb9783e7cf..46056560b922 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,168 @@
exports[`AST Fixtures legacy-fixtures types tuple-named AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTupleType {
+ type: 'TSTupleType',
+ elementTypes: Array [
+ TSNamedTupleMember {
+ type: 'TSNamedTupleMember',
+ elementType: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ label: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'a',
+- optional: false,
+
+ range: [81, 82],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 9, line: 3 },
+ },
+ },
+ optional: false,
+
+ range: [81, 90],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ TSNamedTupleMember {
+ type: 'TSNamedTupleMember',
+ elementType: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [95, 101],
+ loc: {
+ start: { column: 22, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ label: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [92, 93],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ optional: false,
+
+ range: [92, 101],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ TSNamedTupleMember {
+ type: 'TSNamedTupleMember',
+ elementType: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [106, 112],
+ loc: {
+ start: { column: 33, line: 3 },
+ end: { column: 39, line: 3 },
+ },
+ },
+ label: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'c',
+- optional: false,
+
+ range: [103, 104],
+ loc: {
+ start: { column: 30, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+ optional: false,
+
+ range: [103, 112],
+ loc: {
+ start: { column: 30, line: 3 },
+ end: { column: 39, line: 3 },
+ },
+ },
+ ],
+
+ range: [80, 113],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+
+ range: [78, 113],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+
+ range: [77, 113],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 113],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 40, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 114],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 41, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 115],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/1-TSESTree-AST.shot
index 73cfc3cad6b1..085e71318ccd 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTupleType {
@@ -113,6 +116,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/5-AST-Alignment-AST.shot
index 92d042d52fb2..c18e7df81ac2 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types tuple-optional AST Alignment - AST 1
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'x',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTupleType {
@@ -146,6 +149,7 @@ exports[`AST Fixtures legacy-fixtures types tuple-optional AST Alignment - AST 1
},
},
],
+- declare: false,
kind: 'let',
range: [73, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/1-TSESTree-AST.shot
index 4661a8567f5e..5ae74be0a298 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTupleType {
@@ -84,6 +87,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 102],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/5-AST-Alignment-AST.shot
index f5b3150c2e71..39b744ef4e5a 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,111 @@
exports[`AST Fixtures legacy-fixtures types tuple-rest AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTupleType {
+ type: 'TSTupleType',
+ elementTypes: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [81, 87],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ TSRestType {
+ type: 'TSRestType',
+ typeAnnotation: TSArrayType {
+ type: 'TSArrayType',
+ elementType: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [92, 98],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 25, line: 3 },
+ },
+ },
+
+ range: [92, 100],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+
+ range: [89, 100],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+ ],
+
+ range: [80, 101],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+
+ range: [78, 101],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+
+ range: [77, 101],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 101],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 102],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 103],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/1-TSESTree-AST.shot
index ee875d4f166a..72e55c01a012 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/5-AST-Alignment-AST.shot
index 861edac4e34b..c60916510296 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,79 @@
exports[`AST Fixtures legacy-fixtures types tuple-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSTupleType {
+ type: 'TSTupleType',
+ elementTypes: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [85, 91],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ TSOptionalType {
+ type: 'TSOptionalType',
+ typeAnnotation: TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [93, 99],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+
+ range: [93, 100],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+ ],
+
+ range: [84, 101],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 28, line: 3 },
+ },
+ },
+
+ range: [73, 102],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 29, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 103],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/1-TSESTree-AST.shot
index 41466b9f8f2f..a5ac7394e1d0 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTupleType {
@@ -75,6 +78,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 105],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/5-AST-Alignment-AST.shot
index 9daf8bf8637f..17d1d9f4695a 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,102 @@
exports[`AST Fixtures legacy-fixtures types tuple AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTupleType {
+ type: 'TSTupleType',
+ elementTypes: Array [
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [81, 87],
+ loc: {
+ start: { column: 8, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [89, 95],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [97, 103],
+ loc: {
+ start: { column: 24, line: 3 },
+ end: { column: 30, line: 3 },
+ },
+ },
+ ],
+
+ range: [80, 104],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+
+ range: [78, 104],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+
+ range: [77, 104],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 104],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 31, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 105],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 32, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 106],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/1-TSESTree-AST.shot
index 2b64d5846c8b..af94ebe300bc 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "obj",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeLiteral {
@@ -22,7 +25,9 @@ Program {
computed: false,
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
range: [84, 85],
loc: {
@@ -30,6 +35,9 @@ Program {
end: { column: 12, line: 3 },
},
},
+ optional: false,
+ readonly: false,
+ static: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSNumberKeyword {
@@ -86,6 +94,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 96],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/5-AST-Alignment-AST.shot
index f7e7f8866014..66cd9e9abe86 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,118 @@
exports[`AST Fixtures legacy-fixtures types type-literal AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'obj',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeLiteral {
+ type: 'TSTypeLiteral',
+ members: Array [
+ TSPropertySignature {
+ type: 'TSPropertySignature',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+
+ range: [84, 85],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+- optional: false,
+- readonly: false,
+- static: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [87, 93],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [85, 93],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [84, 93],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+
+ range: [82, 95],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+
+ range: [80, 95],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+
+ range: [77, 95],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 95],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 22, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 96],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 23, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 97],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/1-TSESTree-AST.shot
index 29698cef44e1..150915876a76 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeOperator {
@@ -21,7 +24,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [86, 87],
loc: {
@@ -66,6 +71,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 88],
@@ -79,9 +85,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "y",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeOperator {
@@ -126,6 +135,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [89, 110],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/5-AST-Alignment-AST.shot
index ae11f119f07d..1cc236c53e00 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,159 @@
exports[`AST Fixtures legacy-fixtures types type-operator AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeOperator {
+ type: 'TSTypeOperator',
+ operator: 'keyof',
+ typeAnnotation: TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'T',
+- optional: false,
+
+ range: [86, 87],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [86, 87],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [80, 87],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [78, 87],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+
+ range: [77, 87],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 87],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 88],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'y',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeOperator {
+ type: 'TSTypeOperator',
+ operator: 'unique',
+ typeAnnotation: TSSymbolKeyword {
+ type: 'TSSymbolKeyword',
+
+ range: [103, 109],
+ loc: {
+ start: { column: 14, line: 4 },
+ end: { column: 20, line: 4 },
+ },
+ },
+
+ range: [96, 109],
+ loc: {
+ start: { column: 7, line: 4 },
+ end: { column: 20, line: 4 },
+ },
+ },
+
+ range: [94, 109],
+ loc: {
+ start: { column: 5, line: 4 },
+ end: { column: 20, line: 4 },
+ },
+ },
+
+ range: [93, 109],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 20, line: 4 },
+ },
+ },
+ init: null,
+
+ range: [93, 109],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 20, line: 4 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [89, 110],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 111],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 5 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/1-TSESTree-AST.shot
index cb47a67aee4b..c78aefba38d2 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "self",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeQuery {
@@ -55,6 +58,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 95],
@@ -68,9 +72,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeQuery {
@@ -88,7 +95,9 @@ Program {
},
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "foo",
+ optional: false,
range: [117, 120],
loc: {
@@ -133,6 +142,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [96, 121],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/5-AST-Alignment-AST.shot
index 742698e35d82..e032e84b0c5f 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types typeof-this AST Alignment - AST 1`]
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'self',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeQuery {
@@ -62,6 +65,7 @@ exports[`AST Fixtures legacy-fixtures types typeof-this AST Alignment - AST 1`]
},
},
],
+- declare: false,
kind: 'let',
range: [73, 95],
@@ -75,9 +79,12 @@ exports[`AST Fixtures legacy-fixtures types typeof-this AST Alignment - AST 1`]
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSTypeQuery {
@@ -98,7 +105,9 @@ exports[`AST Fixtures legacy-fixtures types typeof-this AST Alignment - AST 1`]
},
right: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'foo',
+- optional: false,
range: [117, 120],
loc: {
@@ -143,6 +152,7 @@ exports[`AST Fixtures legacy-fixtures types typeof-this AST Alignment - AST 1`]
},
},
],
+- declare: false,
kind: 'let',
range: [96, 121],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot
index da18ddbed86a..7b4638ac81ad 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeQuery {
@@ -20,7 +23,9 @@ Program {
type: "TSQualifiedName",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "y",
+ optional: false,
range: [87, 88],
loc: {
@@ -30,7 +35,9 @@ Program {
},
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "z",
+ optional: false,
range: [89, 90],
loc: {
@@ -45,14 +52,16 @@ Program {
end: { column: 17, line: 3 },
},
},
- typeParameters: TSTypeParameterInstantiation {
+ typeArguments: TSTypeParameterInstantiation {
type: "TSTypeParameterInstantiation",
params: [
TSTypeReference {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "w",
+ optional: false,
range: [91, 92],
loc: {
@@ -105,6 +114,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 94],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
index 1ad2b5d62c40..4ff83eed65fd 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,139 @@
exports[`AST Fixtures legacy-fixtures types typeof-with-type-parameters AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeQuery {
+ type: 'TSTypeQuery',
+ exprName: TSQualifiedName {
+ type: 'TSQualifiedName',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'y',
+- optional: false,
+
+ range: [87, 88],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'z',
+- optional: false,
+
+ range: [89, 90],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [87, 90],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+- typeArguments: TSTypeParameterInstantiation {
++ typeParameters: TSTypeParameterInstantiation {
+ type: 'TSTypeParameterInstantiation',
+ params: Array [
+ TSTypeReference {
+ type: 'TSTypeReference',
+ typeName: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'w',
+- optional: false,
+
+ range: [91, 92],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+
+ range: [91, 92],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ ],
+
+ range: [90, 93],
+ loc: {
+ start: { column: 17, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [80, 93],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [78, 93],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [77, 93],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 93],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 94],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 21, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 95],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/1-TSESTree-AST.shot
index 31eaebb2e2da..fddee09790b2 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "x",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSTypeQuery {
@@ -20,7 +23,9 @@ Program {
type: "TSQualifiedName",
left: Identifier {
type: "Identifier",
+ decorators: [],
name: "y",
+ optional: false,
range: [87, 88],
loc: {
@@ -30,7 +35,9 @@ Program {
},
right: Identifier {
type: "Identifier",
+ decorators: [],
name: "z",
+ optional: false,
range: [89, 90],
loc: {
@@ -75,6 +82,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 91],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/5-AST-Alignment-AST.shot
index 27f2e96b44e8..9626fdabc89e 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,106 @@
exports[`AST Fixtures legacy-fixtures types typeof AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ VariableDeclaration {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'x',
+- optional: false,
+ typeAnnotation: TSTypeAnnotation {
+ type: 'TSTypeAnnotation',
+ typeAnnotation: TSTypeQuery {
+ type: 'TSTypeQuery',
+ exprName: TSQualifiedName {
+ type: 'TSQualifiedName',
+ left: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'y',
+- optional: false,
+
+ range: [87, 88],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'z',
+- optional: false,
+
+ range: [89, 90],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [87, 90],
+ loc: {
+ start: { column: 14, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [80, 90],
+ loc: {
+ start: { column: 7, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [78, 90],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+
+ range: [77, 90],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ init: null,
+
+ range: [77, 90],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'let',
+
+ range: [73, 91],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 18, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 92],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot
index 0adf4ef0127a..f15ca890604e 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/1-TSESTree-AST.shot
@@ -9,9 +9,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "union",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnionType {
@@ -75,6 +78,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [73, 110],
@@ -88,9 +92,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "intersection",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSIntersectionType {
@@ -145,6 +152,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [111, 145],
@@ -158,9 +166,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "precedence1",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnionType {
@@ -235,6 +246,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [146, 191],
@@ -248,9 +260,12 @@ Program {
declarations: [
VariableDeclarator {
type: "VariableDeclarator",
+ definite: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "precedence2",
+ optional: false,
typeAnnotation: TSTypeAnnotation {
type: "TSTypeAnnotation",
typeAnnotation: TSUnionType {
@@ -325,6 +340,7 @@ Program {
},
},
],
+ declare: false,
kind: "let",
range: [192, 237],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot
index ab9ae31400d4..f06a5479ddf6 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/5-AST-Alignment-AST.shot
@@ -13,9 +13,12 @@ exports[`AST Fixtures legacy-fixtures types union-intersection AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'union',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSUnionType {
@@ -79,6 +82,7 @@ exports[`AST Fixtures legacy-fixtures types union-intersection AST Alignment - A
},
},
],
+- declare: false,
kind: 'let',
range: [73, 110],
@@ -92,9 +96,12 @@ exports[`AST Fixtures legacy-fixtures types union-intersection AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'intersection',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSIntersectionType {
@@ -149,6 +156,7 @@ exports[`AST Fixtures legacy-fixtures types union-intersection AST Alignment - A
},
},
],
+- declare: false,
kind: 'let',
range: [111, 145],
@@ -162,9 +170,12 @@ exports[`AST Fixtures legacy-fixtures types union-intersection AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'precedence1',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSUnionType {
@@ -268,6 +279,7 @@ exports[`AST Fixtures legacy-fixtures types union-intersection AST Alignment - A
},
},
],
+- declare: false,
kind: 'let',
range: [146, 191],
@@ -281,9 +293,12 @@ exports[`AST Fixtures legacy-fixtures types union-intersection AST Alignment - A
declarations: Array [
VariableDeclarator {
type: 'VariableDeclarator',
+- definite: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'precedence2',
+- optional: false,
typeAnnotation: TSTypeAnnotation {
type: 'TSTypeAnnotation',
typeAnnotation: TSUnionType {
@@ -387,6 +402,7 @@ exports[`AST Fixtures legacy-fixtures types union-intersection AST Alignment - A
},
},
],
+- declare: false,
kind: 'let',
range: [192, 237],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/1-TSESTree-AST.shot
index 4798d7da0453..13a4dc558819 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/1-TSESTree-AST.shot
@@ -6,9 +6,12 @@ Program {
body: [
TSTypeAliasDeclaration {
type: "TSTypeAliasDeclaration",
+ declare: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "Foo",
+ optional: false,
range: [78, 81],
loc: {
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/5-AST-Alignment-AST.shot
index 9bf8457567f4..2a439c04296c 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-type/snapshots/5-AST-Alignment-AST.shot
@@ -2,5 +2,70 @@
exports[`AST Fixtures legacy-fixtures types union-type AST Alignment - AST 1`] = `
"Snapshot Diff:
-Compared values have no visual difference."
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+- declare: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'Foo',
+- optional: false,
+
+ range: [78, 81],
+ loc: {
+ start: { column: 5, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ typeAnnotation: TSIntersectionType {
+ type: 'TSIntersectionType',
+ types: Array [
+ TSStringKeyword {
+ type: 'TSStringKeyword',
+
+ range: [84, 90],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ TSNumberKeyword {
+ type: 'TSNumberKeyword',
+
+ range: [93, 99],
+ loc: {
+ start: { column: 20, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+ ],
+
+ range: [84, 99],
+ loc: {
+ start: { column: 11, line: 3 },
+ end: { column: 26, line: 3 },
+ },
+ },
+
+ range: [73, 100],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 27, line: 3 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [73, 101],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 0, line: 4 },
+ },
+ }"
`;
diff --git a/packages/ast-spec/src/parameter/ArrayPattern/spec.ts b/packages/ast-spec/src/parameter/ArrayPattern/spec.ts
index 420a93278731..9fd684b8044c 100644
--- a/packages/ast-spec/src/parameter/ArrayPattern/spec.ts
+++ b/packages/ast-spec/src/parameter/ArrayPattern/spec.ts
@@ -7,7 +7,7 @@ import type { DestructuringPattern } from '../../unions/DestructuringPattern';
export interface ArrayPattern extends BaseNode {
type: AST_NODE_TYPES.ArrayPattern;
elements: (DestructuringPattern | null)[];
- typeAnnotation?: TSTypeAnnotation;
- optional?: boolean;
- decorators?: Decorator[];
+ typeAnnotation: TSTypeAnnotation | undefined;
+ optional: boolean;
+ decorators: Decorator[];
}
diff --git a/packages/ast-spec/src/parameter/AssignmentPattern/spec.ts b/packages/ast-spec/src/parameter/AssignmentPattern/spec.ts
index ee558c2167c2..208a44e82984 100644
--- a/packages/ast-spec/src/parameter/AssignmentPattern/spec.ts
+++ b/packages/ast-spec/src/parameter/AssignmentPattern/spec.ts
@@ -9,7 +9,7 @@ export interface AssignmentPattern extends BaseNode {
type: AST_NODE_TYPES.AssignmentPattern;
left: BindingName;
right: Expression;
- typeAnnotation?: TSTypeAnnotation;
- optional?: boolean;
- decorators?: Decorator[];
+ typeAnnotation: TSTypeAnnotation | undefined;
+ optional: boolean;
+ decorators: Decorator[];
}
diff --git a/packages/ast-spec/src/parameter/ObjectPattern/spec.ts b/packages/ast-spec/src/parameter/ObjectPattern/spec.ts
index 12c89878794e..76c53798a4d7 100644
--- a/packages/ast-spec/src/parameter/ObjectPattern/spec.ts
+++ b/packages/ast-spec/src/parameter/ObjectPattern/spec.ts
@@ -8,7 +8,7 @@ import type { RestElement } from '../RestElement/spec';
export interface ObjectPattern extends BaseNode {
type: AST_NODE_TYPES.ObjectPattern;
properties: (Property | RestElement)[];
- typeAnnotation?: TSTypeAnnotation;
- optional?: boolean;
- decorators?: Decorator[];
+ typeAnnotation: TSTypeAnnotation | undefined;
+ optional: boolean;
+ decorators: Decorator[];
}
diff --git a/packages/ast-spec/src/parameter/RestElement/spec.ts b/packages/ast-spec/src/parameter/RestElement/spec.ts
index 006f5e48ba3b..59f077988649 100644
--- a/packages/ast-spec/src/parameter/RestElement/spec.ts
+++ b/packages/ast-spec/src/parameter/RestElement/spec.ts
@@ -8,8 +8,8 @@ import type { AssignmentPattern } from '../AssignmentPattern/spec';
export interface RestElement extends BaseNode {
type: AST_NODE_TYPES.RestElement;
argument: DestructuringPattern;
- typeAnnotation?: TSTypeAnnotation;
- optional?: boolean;
- value?: AssignmentPattern;
- decorators?: Decorator[];
+ typeAnnotation: TSTypeAnnotation | undefined;
+ optional: boolean;
+ value: AssignmentPattern | undefined;
+ decorators: Decorator[];
}
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/fixture.ts b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/fixture.ts
new file mode 100644
index 000000000000..15fcc76d927a
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/fixture.ts
@@ -0,0 +1 @@
+function foo(override parameter) {}
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..10b3877c585a
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures parameter TSParameterProperty _error_ override-function-parameter Babel - Error 1`] = `[SyntaxError: A parameter property is only allowed in a constructor implementation. (1:13)]`;
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..622f9f761c14
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,8 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures parameter TSParameterProperty _error_ override-function-parameter TSESTree - Error 1`] = `
+"TSError
+> 1 | function foo(override parameter) {}
+ | ^^^^^^^^ A parameter property is only allowed in a constructor implementation.
+ 2 |"
+`;
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..fdd638615229
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures parameter TSParameterProperty _error_ override-function-parameter Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..10b3877c585a
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures parameter TSParameterProperty _error_ override-function-parameter Babel - Error 1`] = `[SyntaxError: A parameter property is only allowed in a constructor implementation. (1:13)]`;
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..2ed033795ab9
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures parameter TSParameterProperty _error_ override-function-parameter Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/fixture.ts b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/fixture.ts
new file mode 100644
index 000000000000..4a03af843662
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ method(override parameter) {}
+}
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..63ae30ee6f59
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures parameter TSParameterProperty _error_ override-method-parameter Babel - Error 1`] = `[SyntaxError: A parameter property is only allowed in a constructor implementation. (2:9)]`;
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..20c1175484ef
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures parameter TSParameterProperty _error_ override-method-parameter TSESTree - Error 1`] = `
+"TSError
+ 1 | class Foo {
+> 2 | method(override parameter) {}
+ | ^^^^^^^^ A parameter property is only allowed in a constructor implementation.
+ 3 | }
+ 4 |"
+`;
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..500c7d90879c
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures parameter TSParameterProperty _error_ override-method-parameter Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..63ae30ee6f59
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures parameter TSParameterProperty _error_ override-method-parameter Babel - Error 1`] = `[SyntaxError: A parameter property is only allowed in a constructor implementation. (2:9)]`;
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..8865ee198d97
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures parameter TSParameterProperty _error_ override-method-parameter Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/spec.ts b/packages/ast-spec/src/parameter/TSParameterProperty/spec.ts
index 0cf3c4a911d0..56b5f5595292 100644
--- a/packages/ast-spec/src/parameter/TSParameterProperty/spec.ts
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/spec.ts
@@ -8,11 +8,10 @@ import type { RestElement } from '../RestElement/spec';
export interface TSParameterProperty extends BaseNode {
type: AST_NODE_TYPES.TSParameterProperty;
- accessibility?: Accessibility;
- readonly?: boolean;
- static?: boolean;
- export?: boolean;
- override?: boolean;
+ accessibility: Accessibility | undefined;
+ readonly: boolean;
+ static: boolean;
+ override: boolean;
parameter: AssignmentPattern | BindingName | RestElement;
- decorators?: Decorator[];
+ decorators: Decorator[];
}
diff --git a/packages/ast-spec/src/special/Program/spec.ts b/packages/ast-spec/src/special/Program/spec.ts
index 81d69e1e604d..e338dbf677ec 100644
--- a/packages/ast-spec/src/special/Program/spec.ts
+++ b/packages/ast-spec/src/special/Program/spec.ts
@@ -1,13 +1,13 @@
import type { AST_NODE_TYPES } from '../../ast-node-types';
-import type { BaseNode } from '../../base/BaseNode';
+import type { NodeOrTokenData } from '../../base/NodeOrTokenData';
import type { Comment } from '../../unions/Comment';
import type { ProgramStatement } from '../../unions/Statement';
import type { Token } from '../../unions/Token';
-export interface Program extends BaseNode {
+export interface Program extends NodeOrTokenData {
type: AST_NODE_TYPES.Program;
body: ProgramStatement[];
sourceType: 'module' | 'script';
- comments?: Comment[];
- tokens?: Token[];
+ comments: Comment[] | undefined;
+ tokens: Token[] | undefined;
}
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/1-TSESTree-AST.shot
index a6d847de1c2d..ef5668193aee 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/1-TSESTree-AST.shot
@@ -33,7 +33,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [17, 18],
loc: {
@@ -51,7 +53,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [7, 8],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
index a1609757d3c8..272b11db8f6b 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
@@ -37,7 +37,9 @@ exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends AST A
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [17, 18],
loc: {
@@ -55,7 +57,9 @@ exports[`AST Fixtures special TSTypeParameter arrow-const-modifier-extends AST A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [7, 8],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/1-TSESTree-AST.shot
index beab46e12b9e..73bffe1a3716 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/1-TSESTree-AST.shot
@@ -32,7 +32,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [7, 8],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/5-AST-Alignment-AST.shot
index 0fd5e92e286a..74a35f8fcd85 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/arrow-const-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -36,7 +36,9 @@ exports[`AST Fixtures special TSTypeParameter arrow-const-modifier AST Alignment
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [7, 8],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/1-TSESTree-AST.shot
index 4c7658d5f79b..07a3ebcc8fcb 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 22, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "E",
+ optional: false,
range: [6, 7],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 7, line: 1 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -36,7 +42,9 @@ Program {
in: true,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/5-AST-Alignment-AST.shot
index b8aa62a507ca..2a8f32cddbb4 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-in-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-in-modifier AST A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-in-modifier AST A
end: { column: 22, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'E',
+- optional: false,
range: [6, 7],
loc: {
@@ -30,6 +35,7 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-in-modifier AST A
end: { column: 7, line: 1 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -40,7 +46,9 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-in-modifier AST A
in: true,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [17, 18],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot
index 99c1b4bfa76d..dcd6e04ab45c 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 29, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "B",
+ optional: false,
range: [6, 7],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 7, line: 1 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -37,7 +43,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [24, 25],
loc: {
@@ -55,7 +63,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [14, 15],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
index 6b9faf086d69..09f4c2fef77a 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends
end: { column: 29, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'B',
+- optional: false,
range: [6, 7],
loc: {
@@ -30,6 +35,7 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends
end: { column: 7, line: 1 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -41,7 +47,9 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [24, 25],
loc: {
@@ -59,7 +67,9 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-extends
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [14, 15],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
index e4ea2237032a..894c1752a125 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 22, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "C",
+ optional: false,
range: [6, 7],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 7, line: 1 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -36,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [8, 9],
loc: {
@@ -58,7 +66,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
index 274981ae1255..7a64e239d884 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple
end: { column: 22, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'C',
+- optional: false,
range: [6, 7],
loc: {
@@ -30,6 +35,7 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple
end: { column: 7, line: 1 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -40,9 +46,10 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
-+ name: 'T',
-
+- optional: false,
+-
- range: [8, 9],
- loc: {
- start: { column: 8, line: 1 },
@@ -50,7 +57,8 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple
- },
- },
- out: false,
--
++ name: 'T',
+
range: [8, 9],
loc: {
start: { column: 8, line: 1 },
@@ -63,7 +71,9 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [17, 18],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/1-TSESTree-AST.shot
index 6a0bab05f37f..67a3d5754e1a 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 19, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "A",
+ optional: false,
range: [6, 7],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 7, line: 1 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -36,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [14, 15],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot
index 27b0483a19b8..d8b4d9eadeea 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier AST Alig
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier AST Alig
end: { column: 19, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'A',
+- optional: false,
range: [6, 7],
loc: {
@@ -30,6 +35,7 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier AST Alig
end: { column: 7, line: 1 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -40,7 +46,9 @@ exports[`AST Fixtures special TSTypeParameter class-decl-const-modifier AST Alig
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [14, 15],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/1-TSESTree-AST.shot
index 132ed8b6e376..124790f2fbca 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/1-TSESTree-AST.shot
@@ -6,6 +6,7 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -16,9 +17,13 @@ Program {
end: { column: 22, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "D",
+ optional: false,
range: [6, 7],
loc: {
@@ -26,6 +31,7 @@ Program {
end: { column: 7, line: 1 },
},
},
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -36,7 +42,9 @@ Program {
in: true,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/5-AST-Alignment-AST.shot
index f6ed4a29e37c..c8d0f76fe9d5 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -10,6 +10,7 @@ exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier AST A
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -20,9 +21,13 @@ exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier AST A
end: { column: 22, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'D',
+- optional: false,
range: [6, 7],
loc: {
@@ -30,6 +35,7 @@ exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier AST A
end: { column: 7, line: 1 },
},
},
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -40,7 +46,9 @@ exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier AST A
in: true,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [17, 18],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot
index 2ae40e1f3f44..9d3bd6eaa128 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot
@@ -8,6 +8,7 @@ Program {
type: "ExpressionStatement",
expression: ClassExpression {
type: "ClassExpression",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,7 +19,10 @@ Program {
end: { column: 22, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: null,
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -29,7 +33,9 @@ Program {
in: true,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot
index d212dd9308fd..32a31c4e8e40 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -12,6 +12,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier AST A
type: 'ExpressionStatement',
expression: ClassExpression {
type: 'ClassExpression',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -22,7 +23,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier AST A
end: { column: 22, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: null,
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -33,7 +37,9 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier AST A
in: true,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [17, 18],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot
index 9c4dee68d2bc..125a353ad2f2 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot
@@ -8,6 +8,7 @@ Program {
type: "ExpressionStatement",
expression: ClassExpression {
type: "ClassExpression",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,7 +19,10 @@ Program {
end: { column: 29, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: null,
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -30,7 +34,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [24, 25],
loc: {
@@ -48,7 +54,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [14, 15],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
index 3d17a9cdd495..076a347f025f 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
@@ -12,6 +12,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends
type: 'ExpressionStatement',
expression: ClassExpression {
type: 'ClassExpression',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -22,7 +23,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends
end: { column: 29, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: null,
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -34,7 +38,9 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [24, 25],
loc: {
@@ -52,7 +58,9 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [14, 15],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
index 183080d0ea2a..a8c6cf44d81a 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
@@ -8,6 +8,7 @@ Program {
type: "ExpressionStatement",
expression: ClassExpression {
type: "ClassExpression",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,7 +19,10 @@ Program {
end: { column: 22, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: null,
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -29,7 +33,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [8, 9],
loc: {
@@ -51,7 +57,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
index b6d1dee5b192..8ff0271450e5 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
@@ -12,6 +12,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple
type: 'ExpressionStatement',
expression: ClassExpression {
type: 'ClassExpression',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -22,7 +23,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple
end: { column: 22, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: null,
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -33,9 +37,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
-+ name: 'T',
-
+- optional: false,
+-
- range: [8, 9],
- loc: {
- start: { column: 8, line: 1 },
@@ -43,7 +48,8 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple
- },
- },
- out: false,
--
++ name: 'T',
+
range: [8, 9],
loc: {
start: { column: 8, line: 1 },
@@ -56,7 +62,9 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [17, 18],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot
index 97670b76950a..ffc7d16c1be6 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot
@@ -8,6 +8,7 @@ Program {
type: "ExpressionStatement",
expression: ClassExpression {
type: "ClassExpression",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,7 +19,10 @@ Program {
end: { column: 19, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: null,
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -29,7 +33,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [14, 15],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot
index 2363475fdb49..05e22d460f7e 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -12,6 +12,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier AST Alig
type: 'ExpressionStatement',
expression: ClassExpression {
type: 'ClassExpression',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -22,7 +23,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier AST Alig
end: { column: 19, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: null,
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -33,7 +37,9 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier AST Alig
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [14, 15],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot
index fa67e5d5be07..5a7a38bb6cb9 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot
@@ -8,6 +8,7 @@ Program {
type: "ExpressionStatement",
expression: ClassExpression {
type: "ClassExpression",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [],
@@ -18,7 +19,10 @@ Program {
end: { column: 22, line: 1 },
},
},
+ declare: false,
+ decorators: [],
id: null,
+ implements: [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: "TSTypeParameterDeclaration",
@@ -29,7 +33,9 @@ Program {
in: true,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot
index f3f3121a24c6..e92dc3b1d949 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -12,6 +12,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier AST A
type: 'ExpressionStatement',
expression: ClassExpression {
type: 'ClassExpression',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [],
@@ -22,7 +23,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier AST A
end: { column: 22, line: 1 },
},
},
+- declare: false,
+- decorators: Array [],
id: null,
+- implements: Array [],
superClass: null,
typeParameters: TSTypeParameterDeclaration {
type: 'TSTypeParameterDeclaration',
@@ -33,7 +37,9 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier AST A
in: true,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [17, 18],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/1-TSESTree-AST.shot
index 11f14029939d..4b1dc68aa05b 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/1-TSESTree-AST.shot
@@ -12,7 +12,9 @@ Program {
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "d",
+ optional: false,
range: [17, 18],
loc: {
@@ -30,7 +32,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [25, 26],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/5-AST-Alignment-AST.shot
index 15e908f2a614..a77f9f4551d4 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/declare-func-const-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -16,7 +16,9 @@ exports[`AST Fixtures special TSTypeParameter declare-func-const-modifier AST Al
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'd',
+- optional: false,
range: [17, 18],
loc: {
@@ -34,7 +36,9 @@ exports[`AST Fixtures special TSTypeParameter declare-func-const-modifier AST Al
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [25, 26],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot
index 5572b5335c89..edd2373c7cd0 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 34, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "b",
+ optional: false,
range: [9, 10],
loc: {
@@ -40,7 +43,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [27, 28],
loc: {
@@ -58,7 +63,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
index 737f0d3abc77..f8731ecd9373 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
@@ -21,11 +21,14 @@ exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-extends A
end: { column: 34, line: 1 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'b',
+- optional: false,
range: [9, 10],
loc: {
@@ -44,7 +47,9 @@ exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-extends A
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [27, 28],
loc: {
@@ -62,7 +67,9 @@ exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-extends A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [17, 18],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
index 71d3cd47f020..1f5ca163794a 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 27, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "c",
+ optional: false,
range: [9, 10],
loc: {
@@ -39,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [11, 12],
loc: {
@@ -61,7 +66,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [20, 21],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
index eba1adb09f47..49e154acacc0 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
@@ -21,11 +21,14 @@ exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-multiple
end: { column: 27, line: 1 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'c',
+- optional: false,
range: [9, 10],
loc: {
@@ -43,9 +46,10 @@ exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
-+ name: 'T',
-
+- optional: false,
+-
- range: [11, 12],
- loc: {
- start: { column: 11, line: 1 },
@@ -53,7 +57,8 @@ exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-multiple
- },
- },
- out: false,
--
++ name: 'T',
+
range: [11, 12],
loc: {
start: { column: 11, line: 1 },
@@ -66,7 +71,9 @@ exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [20, 21],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/1-TSESTree-AST.shot
index 439f20b8d924..56a976debdb7 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/1-TSESTree-AST.shot
@@ -17,11 +17,14 @@ Program {
end: { column: 24, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "a",
+ optional: false,
range: [9, 10],
loc: {
@@ -39,7 +42,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot
index 71ee0e188f1b..2bc3d071c6d7 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-decl-const-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -21,11 +21,14 @@ exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier AST Align
end: { column: 24, line: 1 },
},
},
+- declare: false,
expression: false,
generator: false,
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'a',
+- optional: false,
range: [9, 10],
loc: {
@@ -43,7 +46,9 @@ exports[`AST Fixtures special TSTypeParameter func-decl-const-modifier AST Align
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [17, 18],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot
index 4687caca30c2..d22b0f6d6f9f 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot
@@ -19,6 +19,7 @@ Program {
end: { column: 34, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -33,7 +34,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [27, 28],
loc: {
@@ -51,7 +54,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
index 64cbd211b5da..874eddf90507 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
@@ -23,6 +23,7 @@ exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-extends A
end: { column: 34, line: 1 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -37,7 +38,9 @@ exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-extends A
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [27, 28],
loc: {
@@ -55,7 +58,9 @@ exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-extends A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [17, 18],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
index 981d3e4bfbc5..2af61b6a3d08 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
@@ -19,6 +19,7 @@ Program {
end: { column: 27, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -32,7 +33,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [11, 12],
loc: {
@@ -54,7 +57,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [20, 21],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
index 2a50d483de22..4c17ab31e052 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
@@ -23,6 +23,7 @@ exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-multiple
end: { column: 27, line: 1 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -36,9 +37,10 @@ exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
-+ name: 'T',
-
+- optional: false,
+-
- range: [11, 12],
- loc: {
- start: { column: 11, line: 1 },
@@ -46,7 +48,8 @@ exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-multiple
- },
- },
- out: false,
--
++ name: 'T',
+
range: [11, 12],
loc: {
start: { column: 11, line: 1 },
@@ -59,7 +62,9 @@ exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [20, 21],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/1-TSESTree-AST.shot
index 249dc8e42534..812a9a584fd8 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/1-TSESTree-AST.shot
@@ -19,6 +19,7 @@ Program {
end: { column: 24, line: 1 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -32,7 +33,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [17, 18],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot
index a5476c5645ad..6846f0270b8e 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/func-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -23,6 +23,7 @@ exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier AST Align
end: { column: 24, line: 1 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -36,7 +37,9 @@ exports[`AST Fixtures special TSTypeParameter func-expr-const-modifier AST Align
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [17, 18],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/1-TSESTree-AST.shot
index 21c5d81390de..5a0302a6b4de 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 26, line: 1 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "M",
+ optional: false,
range: [10, 11],
loc: {
@@ -35,7 +39,9 @@ Program {
in: true,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [21, 22],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
index 4add40cf5d13..d5e84b269a20 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures special TSTypeParameter interface-const-in-modifier-multip
end: { column: 26, line: 1 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'M',
+- optional: false,
range: [10, 11],
loc: {
@@ -39,7 +43,9 @@ exports[`AST Fixtures special TSTypeParameter interface-const-in-modifier-multip
in: true,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [21, 22],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/1-TSESTree-AST.shot
index eb7f3b8a5886..dc82e1e46384 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 33, line: 1 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "J",
+ optional: false,
range: [10, 11],
loc: {
@@ -36,7 +40,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [28, 29],
loc: {
@@ -54,7 +60,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [18, 19],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
index 47c6ccd25b6e..623b81b8b4d7 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures special TSTypeParameter interface-const-modifier-extends A
end: { column: 33, line: 1 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'J',
+- optional: false,
range: [10, 11],
loc: {
@@ -40,7 +44,9 @@ exports[`AST Fixtures special TSTypeParameter interface-const-modifier-extends A
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [28, 29],
loc: {
@@ -58,7 +64,9 @@ exports[`AST Fixtures special TSTypeParameter interface-const-modifier-extends A
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [18, 19],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
index 341ae78b2525..b1d7a768004c 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 26, line: 1 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "I",
+ optional: false,
range: [10, 11],
loc: {
@@ -35,7 +39,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [12, 13],
loc: {
@@ -57,7 +63,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [21, 22],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
index 80b85b253f04..90fa3b6e9a22 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures special TSTypeParameter interface-const-modifier-multiple
end: { column: 26, line: 1 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'I',
+- optional: false,
range: [10, 11],
loc: {
@@ -39,9 +43,10 @@ exports[`AST Fixtures special TSTypeParameter interface-const-modifier-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
-+ name: 'T',
-
+- optional: false,
+-
- range: [12, 13],
- loc: {
- start: { column: 12, line: 1 },
@@ -49,7 +54,8 @@ exports[`AST Fixtures special TSTypeParameter interface-const-modifier-multiple
- },
- },
- out: false,
--
++ name: 'T',
+
range: [12, 13],
loc: {
start: { column: 12, line: 1 },
@@ -62,7 +68,9 @@ exports[`AST Fixtures special TSTypeParameter interface-const-modifier-multiple
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [21, 22],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/1-TSESTree-AST.shot
index 65601c74de47..12c0c5b4e402 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 23, line: 1 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "I",
+ optional: false,
range: [10, 11],
loc: {
@@ -35,7 +39,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [18, 19],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/5-AST-Alignment-AST.shot
index f24056fd5d6a..6a5035aefdf4 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-const-modifier/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures special TSTypeParameter interface-const-modifier AST Align
end: { column: 23, line: 1 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'I',
+- optional: false,
range: [10, 11],
loc: {
@@ -39,7 +43,9 @@ exports[`AST Fixtures special TSTypeParameter interface-const-modifier AST Align
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [18, 19],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
index 2971baddac51..cc71f3fee6e8 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/1-TSESTree-AST.shot
@@ -16,9 +16,13 @@ Program {
end: { column: 26, line: 1 },
},
},
+ declare: false,
+ extends: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "L",
+ optional: false,
range: [10, 11],
loc: {
@@ -35,7 +39,9 @@ Program {
in: true,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [21, 22],
loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
index 3579f6bbe03b..832132ccc640 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot
@@ -20,9 +20,13 @@ exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multip
end: { column: 26, line: 1 },
},
},
+- declare: false,
+- extends: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'L',
+- optional: false,
range: [10, 11],
loc: {
@@ -39,7 +43,9 @@ exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multip
in: true,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [21, 22],
- loc: {
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/1-TSESTree-AST.shot
index 6b8bb7862af7..147fb616c0c5 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/1-TSESTree-AST.shot
@@ -6,15 +6,19 @@ Program {
body: [
ClassDeclaration {
type: "ClassDeclaration",
+ abstract: false,
body: ClassBody {
type: "ClassBody",
body: [
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "method",
+ optional: false,
range: [12, 18],
loc: {
@@ -23,6 +27,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -38,6 +43,7 @@ Program {
end: { column: 22, line: 2 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -51,7 +57,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [25, 26],
loc: {
@@ -92,9 +100,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "method",
+ optional: false,
range: [35, 41],
loc: {
@@ -103,6 +114,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -118,6 +130,7 @@ Program {
end: { column: 32, line: 3 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -132,7 +145,9 @@ Program {
type: "TSTypeReference",
typeName: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [58, 59],
loc: {
@@ -150,7 +165,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [48, 49],
loc: {
@@ -191,9 +208,12 @@ Program {
MethodDefinition {
type: "MethodDefinition",
computed: false,
+ decorators: [],
key: Identifier {
type: "Identifier",
+ decorators: [],
name: "method",
+ optional: false,
range: [68, 74],
loc: {
@@ -202,6 +222,7 @@ Program {
},
},
kind: "method",
+ optional: false,
override: false,
static: false,
value: FunctionExpression {
@@ -217,6 +238,7 @@ Program {
end: { column: 25, line: 4 },
},
},
+ declare: false,
expression: false,
generator: false,
id: null,
@@ -230,7 +252,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "T",
+ optional: false,
range: [75, 76],
loc: {
@@ -252,7 +276,9 @@ Program {
in: false,
name: Identifier {
type: "Identifier",
+ decorators: [],
name: "U",
+ optional: false,
range: [84, 85],
loc: {
@@ -298,9 +324,13 @@ Program {
end: { column: 1, line: 5 },
},
},
+ declare: false,
+ decorators: [],
id: Identifier {
type: "Identifier",
+ decorators: [],
name: "_",
+ optional: false,
range: [6, 7],
loc: {
@@ -308,6 +338,7 @@ Program {
end: { column: 7, line: 1 },
},
},
+ implements: [],
superClass: null,
range: [0, 93],
diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/5-AST-Alignment-AST.shot
index 14bbb7928aa3..bc2c908f0833 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/method-const-modifiers/snapshots/5-AST-Alignment-AST.shot
@@ -10,15 +10,19 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
body: Array [
ClassDeclaration {
type: 'ClassDeclaration',
+- abstract: false,
body: ClassBody {
type: 'ClassBody',
body: Array [
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'method',
+- optional: false,
range: [12, 18],
loc: {
@@ -27,6 +31,7 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -42,6 +47,7 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
end: { column: 22, line: 2 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -55,8 +61,11 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
--
+- optional: false,
++ name: 'T',
+
- range: [25, 26],
- loc: {
- start: { column: 15, line: 2 },
@@ -64,8 +73,7 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
- },
- },
- out: false,
-+ name: 'T',
-
+-
range: [19, 26],
loc: {
start: { column: 9, line: 2 },
@@ -99,9 +107,12 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'method',
+- optional: false,
range: [35, 41],
loc: {
@@ -110,6 +121,7 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -125,6 +137,7 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
end: { column: 32, line: 3 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -139,7 +152,9 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
type: 'TSTypeReference',
typeName: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'U',
+- optional: false,
range: [58, 59],
loc: {
@@ -157,7 +172,9 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
+- optional: false,
-
- range: [48, 49],
- loc: {
@@ -201,9 +218,12 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
MethodDefinition {
type: 'MethodDefinition',
computed: false,
+- decorators: Array [],
key: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: 'method',
+- optional: false,
range: [68, 74],
loc: {
@@ -212,6 +232,7 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
},
},
kind: 'method',
+- optional: false,
- override: false,
static: false,
value: FunctionExpression {
@@ -227,6 +248,7 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
end: { column: 25, line: 4 },
},
},
+- declare: false,
expression: false,
generator: false,
id: null,
@@ -240,8 +262,11 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'T',
--
+- optional: false,
++ name: 'T',
+
- range: [75, 76],
- loc: {
- start: { column: 9, line: 4 },
@@ -249,8 +274,7 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
- },
- },
- out: false,
-+ name: 'T',
-
+-
range: [75, 76],
loc: {
start: { column: 9, line: 4 },
@@ -263,7 +287,9 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
- in: false,
- name: Identifier {
- type: 'Identifier',
+- decorators: Array [],
- name: 'U',
+- optional: false,
-
- range: [84, 85],
- loc: {
@@ -312,9 +338,13 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
end: { column: 1, line: 5 },
},
},
+- declare: false,
+- decorators: Array [],
id: Identifier {
type: 'Identifier',
+- decorators: Array [],
name: '_',
+- optional: false,
range: [6, 7],
loc: {
@@ -322,6 +352,7 @@ exports[`AST Fixtures special TSTypeParameter method-const-modifiers AST Alignme
end: { column: 7, line: 1 },
},
},
+- implements: Array [],
superClass: null,
range: [0, 93],
diff --git a/packages/ast-spec/src/special/TSTypeParameter/spec.ts b/packages/ast-spec/src/special/TSTypeParameter/spec.ts
index 1d0bc76f127d..a1295bfa7a93 100644
--- a/packages/ast-spec/src/special/TSTypeParameter/spec.ts
+++ b/packages/ast-spec/src/special/TSTypeParameter/spec.ts
@@ -6,8 +6,8 @@ import type { TypeNode } from '../../unions/TypeNode';
export interface TSTypeParameter extends BaseNode {
type: AST_NODE_TYPES.TSTypeParameter;
name: Identifier;
- constraint?: TypeNode;
- default?: TypeNode;
+ constraint: TypeNode | undefined;
+ default: TypeNode | undefined;
in: boolean;
out: boolean;
const: boolean;
diff --git a/packages/ast-spec/src/special/VariableDeclarator/spec.ts b/packages/ast-spec/src/special/VariableDeclarator/spec.ts
index 619c6a57d5dc..50f129faf583 100644
--- a/packages/ast-spec/src/special/VariableDeclarator/spec.ts
+++ b/packages/ast-spec/src/special/VariableDeclarator/spec.ts
@@ -7,5 +7,5 @@ export interface VariableDeclarator extends BaseNode {
type: AST_NODE_TYPES.VariableDeclarator;
id: BindingName;
init: Expression | null;
- definite?: boolean;
+ definite: boolean;
}
diff --git a/packages/ast-spec/src/statement/ExpressionStatement/spec.ts b/packages/ast-spec/src/statement/ExpressionStatement/spec.ts
index f5fd336a9604..9ae5cd1f31d3 100644
--- a/packages/ast-spec/src/statement/ExpressionStatement/spec.ts
+++ b/packages/ast-spec/src/statement/ExpressionStatement/spec.ts
@@ -5,5 +5,5 @@ import type { Expression } from '../../unions/Expression';
export interface ExpressionStatement extends BaseNode {
type: AST_NODE_TYPES.ExpressionStatement;
expression: Expression;
- directive?: string;
+ directive: string | undefined;
}
diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts
new file mode 100644
index 000000000000..e1a5a7980c33
--- /dev/null
+++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/fixture.ts
@@ -0,0 +1,3 @@
+{
+ throw
+}
diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..f723750f0eee
--- /dev/null
+++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Babel - Error 1`] = `[SyntaxError: Illegal newline after throw. (2:9)]`;
diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..cf149c8bdc2d
--- /dev/null
+++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures statement ThrowStatement _error_ missing-argument TSESTree - Error 1`] = `
+"TSError
+ 1 | {
+> 2 | throw
+ | ^^^^^ A throw statement must throw an expression.
+ 3 | }
+ 4 |"
+`;
diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..79c7461a8974
--- /dev/null
+++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..f723750f0eee
--- /dev/null
+++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Babel - Error 1`] = `[SyntaxError: Illegal newline after throw. (2:9)]`;
diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..51974790455c
--- /dev/null
+++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures statement ThrowStatement _error_ missing-argument Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/type/TSImportType/spec.ts b/packages/ast-spec/src/type/TSImportType/spec.ts
index b2eea1a78e01..3eb30235d9b0 100644
--- a/packages/ast-spec/src/type/TSImportType/spec.ts
+++ b/packages/ast-spec/src/type/TSImportType/spec.ts
@@ -6,8 +6,10 @@ import type { TypeNode } from '../../unions/TypeNode';
export interface TSImportType extends BaseNode {
type: AST_NODE_TYPES.TSImportType;
- isTypeOf: boolean;
- parameter: TypeNode;
+ argument: TypeNode;
qualifier: EntityName | null;
+ typeArguments: TSTypeParameterInstantiation | null;
+
+ /** @deprecated Use {@link `typeArguments`} instead. */
typeParameters: TSTypeParameterInstantiation | null;
}
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/fixture.ts b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/fixture.ts
new file mode 100644
index 000000000000..0f620d4925ec
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/fixture.ts
@@ -0,0 +1,4 @@
+type Mapped = {
+ member: member;
+ [key in keyof O]: number;
+};
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..a18ec232c74e
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures type TSMappedType _error_ looks-like-mapped-type-but-with-members Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "]" (3:16)]`;
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..3ddaaa553ab1
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,11 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures type TSMappedType _error_ looks-like-mapped-type-but-with-members TSESTree - Error 1`] = `
+"TSError
+ 1 | type Mapped = {
+ 2 | member: member;
+> 3 | [key in keyof O]: number;
+ | ^ ']' expected.
+ 4 | };
+ 5 |"
+`;
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..be7ee0f9c846
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures type TSMappedType _error_ looks-like-mapped-type-but-with-members Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..a18ec232c74e
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures type TSMappedType _error_ looks-like-mapped-type-but-with-members Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "]" (3:16)]`;
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..be7ee0f9c846
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/looks-like-mapped-type-but-with-members/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures type TSMappedType _error_ looks-like-mapped-type-but-with-members Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/fixture.ts b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/fixture.ts
new file mode 100644
index 000000000000..2067882f9e22
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/fixture.ts
@@ -0,0 +1,4 @@
+type Mapped = {
+ [key in keyof O]: number;
+ member: member;
+};
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..bfe056cd7872
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures type TSMappedType _error_ with-member Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "}" (3:2)]`;
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..6ace2444c887
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,11 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures type TSMappedType _error_ with-member TSESTree - Error 1`] = `
+"TSError
+ 1 | type Mapped = {
+ 2 | [key in keyof O]: number;
+> 3 | member: member;
+ | ^^^^^^^^^^^^^^^ A mapped type may not declare properties or methods.
+ 4 | };
+ 5 |"
+`;
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..42d0ee954c56
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures type TSMappedType _error_ with-member Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..bfe056cd7872
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/2-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures type TSMappedType _error_ with-member Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "}" (3:2)]`;
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..26b439120085
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures type TSMappedType _error_ with-member Error Alignment 1`] = `"Both errored"`;
diff --git a/packages/ast-spec/src/type/TSMappedType/spec.ts b/packages/ast-spec/src/type/TSMappedType/spec.ts
index db5abd4063a1..8b81c4f77bb6 100644
--- a/packages/ast-spec/src/type/TSMappedType/spec.ts
+++ b/packages/ast-spec/src/type/TSMappedType/spec.ts
@@ -6,8 +6,8 @@ import type { TypeNode } from '../../unions/TypeNode';
export interface TSMappedType extends BaseNode {
type: AST_NODE_TYPES.TSMappedType;
typeParameter: TSTypeParameter;
- readonly?: boolean | '-' | '+';
- optional?: boolean | '-' | '+';
- typeAnnotation?: TypeNode;
+ readonly: boolean | '-' | '+' | undefined;
+ optional: boolean | '-' | '+' | undefined;
+ typeAnnotation: TypeNode | undefined;
nameType: TypeNode | null;
}
diff --git a/packages/ast-spec/src/type/TSTypeOperator/spec.ts b/packages/ast-spec/src/type/TSTypeOperator/spec.ts
index c83b8721eed9..f6d530c084f0 100644
--- a/packages/ast-spec/src/type/TSTypeOperator/spec.ts
+++ b/packages/ast-spec/src/type/TSTypeOperator/spec.ts
@@ -5,5 +5,5 @@ import type { TypeNode } from '../../unions/TypeNode';
export interface TSTypeOperator extends BaseNode {
type: AST_NODE_TYPES.TSTypeOperator;
operator: 'keyof' | 'readonly' | 'unique';
- typeAnnotation?: TypeNode;
+ typeAnnotation: TypeNode | undefined;
}
diff --git a/packages/ast-spec/src/type/TSTypeQuery/spec.ts b/packages/ast-spec/src/type/TSTypeQuery/spec.ts
index 634c307ad2ca..b6ec9fdf6ec2 100644
--- a/packages/ast-spec/src/type/TSTypeQuery/spec.ts
+++ b/packages/ast-spec/src/type/TSTypeQuery/spec.ts
@@ -2,9 +2,13 @@ import type { AST_NODE_TYPES } from '../../ast-node-types';
import type { BaseNode } from '../../base/BaseNode';
import type { TSTypeParameterInstantiation } from '../../special/spec';
import type { EntityName } from '../../unions/EntityName';
+import type { TSImportType } from '../TSImportType/spec';
export interface TSTypeQuery extends BaseNode {
type: AST_NODE_TYPES.TSTypeQuery;
- exprName: EntityName;
- typeParameters?: TSTypeParameterInstantiation;
+ exprName: EntityName | TSImportType;
+ typeArguments: TSTypeParameterInstantiation | undefined;
+
+ /** @deprecated Use {@link `typeArguments`} instead. */
+ typeParameters: TSTypeParameterInstantiation | undefined;
}
diff --git a/packages/ast-spec/src/type/TSTypeReference/spec.ts b/packages/ast-spec/src/type/TSTypeReference/spec.ts
index 9d88fe7f6b4f..c7b5b340b2f4 100644
--- a/packages/ast-spec/src/type/TSTypeReference/spec.ts
+++ b/packages/ast-spec/src/type/TSTypeReference/spec.ts
@@ -5,6 +5,10 @@ import type { EntityName } from '../../unions/EntityName';
export interface TSTypeReference extends BaseNode {
type: AST_NODE_TYPES.TSTypeReference;
+ typeArguments: TSTypeParameterInstantiation | undefined;
+
+ /** @deprecated Use {@link `typeArguments`} instead. */
+ typeParameters: TSTypeParameterInstantiation | undefined;
+
typeName: EntityName;
- typeParameters?: TSTypeParameterInstantiation;
}
diff --git a/packages/ast-spec/src/unions/ExportDeclaration.ts b/packages/ast-spec/src/unions/ExportDeclaration.ts
index b78996d14053..b3a25fd38113 100644
--- a/packages/ast-spec/src/unions/ExportDeclaration.ts
+++ b/packages/ast-spec/src/unions/ExportDeclaration.ts
@@ -8,6 +8,7 @@ import type {
} from '../declaration/FunctionDeclaration/spec';
import type { TSDeclareFunction } from '../declaration/TSDeclareFunction/spec';
import type { TSEnumDeclaration } from '../declaration/TSEnumDeclaration/spec';
+import type { TSImportEqualsDeclaration } from '../declaration/TSImportEqualsDeclaration/spec';
import type { TSInterfaceDeclaration } from '../declaration/TSInterfaceDeclaration/spec';
import type { TSModuleDeclaration } from '../declaration/TSModuleDeclaration/spec';
import type { TSTypeAliasDeclaration } from '../declaration/TSTypeAliasDeclaration/spec';
@@ -37,6 +38,7 @@ export type NamedExportDeclarations =
| FunctionDeclarationWithOptionalName
| TSDeclareFunction
| TSEnumDeclaration
+ | TSImportEqualsDeclaration
| TSInterfaceDeclaration
| TSModuleDeclaration
| TSTypeAliasDeclaration
diff --git a/packages/ast-spec/src/unions/Modifier.ts b/packages/ast-spec/src/unions/Modifier.ts
deleted file mode 100644
index f2501e6585cb..000000000000
--- a/packages/ast-spec/src/unions/Modifier.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import type { TSAbstractKeyword } from '../type/TSAbstractKeyword/spec';
-import type { TSAsyncKeyword } from '../type/TSAsyncKeyword/spec';
-import type { TSPrivateKeyword } from '../type/TSPrivateKeyword/spec';
-import type { TSProtectedKeyword } from '../type/TSProtectedKeyword/spec';
-import type { TSPublicKeyword } from '../type/TSPublicKeyword/spec';
-import type { TSReadonlyKeyword } from '../type/TSReadonlyKeyword/spec';
-import type { TSStaticKeyword } from '../type/TSStaticKeyword/spec';
-
-export type Modifier =
- | TSAbstractKeyword
- | TSAsyncKeyword
- | TSPrivateKeyword
- | TSProtectedKeyword
- | TSPublicKeyword
- | TSReadonlyKeyword
- | TSStaticKeyword;
diff --git a/packages/ast-spec/tests/BinaryOperatorToText.type-test.ts b/packages/ast-spec/tests/BinaryOperatorToText.type-test.ts
new file mode 100644
index 000000000000..95f993b9e4df
--- /dev/null
+++ b/packages/ast-spec/tests/BinaryOperatorToText.type-test.ts
@@ -0,0 +1,20 @@
+import type {
+ AssignmentOperator,
+ BinaryOperator,
+ SyntaxKind,
+} from 'typescript';
+
+import type { BinaryOperatorToText } from '../src';
+
+type BinaryOperatorWithoutInvalidTypes = Exclude<
+ BinaryOperator,
+ | AssignmentOperator // --> AssignmentExpression
+ | SyntaxKind.CommaToken // -> SequenceExpression
+ | SyntaxKind.QuestionQuestionToken // -> LogicalExpression
+>;
+type _Test = {
+ readonly [T in BinaryOperatorWithoutInvalidTypes]: BinaryOperatorToText[T];
+ // If there are any BinaryOperator members that don't have a corresponding
+ // BinaryOperatorToText, then this line will error with "Type 'T' cannot
+ // be used to index type 'BinaryOperatorToText'."
+};
diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot
index 87667f4b5dbc..67a51cd0dd1f 100644
--- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot
+++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot
@@ -2,29 +2,79 @@
exports[`AST Fixtures List fixtures with AST differences 1`] = `
[
+ "declaration/ClassDeclaration/fixtures/abstract/fixture.ts",
+ "declaration/ClassDeclaration/fixtures/declare/fixture.ts",
+ "declaration/ClassDeclaration/fixtures/decorator-many/fixture.ts",
+ "declaration/ClassDeclaration/fixtures/decorator-one/fixture.ts",
+ "declaration/ClassDeclaration/fixtures/empty/fixture.ts",
+ "declaration/ClassDeclaration/fixtures/extends-literal/fixture.ts",
+ "declaration/ClassDeclaration/fixtures/extends-type-param/fixture.ts",
+ "declaration/ClassDeclaration/fixtures/extends/fixture.ts",
"declaration/ClassDeclaration/fixtures/implements-many/fixture.ts",
"declaration/ClassDeclaration/fixtures/implements-one/fixture.ts",
"declaration/ClassDeclaration/fixtures/type-param/fixture.ts",
"declaration/ClassDeclaration/fixtures/type-parameters-extends-type-param/fixture.ts",
"declaration/ClassDeclaration/fixtures/with-member-one/fixture.ts",
+ "declaration/ExportAllDeclaration/fixtures/assertion/fixture.ts",
"declaration/ExportAllDeclaration/fixtures/kind-type/fixture.ts",
+ "declaration/ExportAllDeclaration/fixtures/named/fixture.ts",
"declaration/ExportAllDeclaration/fixtures/type-kind/fixture.ts",
+ "declaration/ExportDefaultDeclaration/fixtures/anonymous-class/fixture.ts",
+ "declaration/ExportDefaultDeclaration/fixtures/anonymous-function/fixture.ts",
+ "declaration/ExportDefaultDeclaration/fixtures/class-expression/fixture.ts",
+ "declaration/ExportDefaultDeclaration/fixtures/class/fixture.ts",
+ "declaration/ExportDefaultDeclaration/fixtures/function/fixture.ts",
+ "declaration/ExportDefaultDeclaration/fixtures/identifier/fixture.ts",
+ "declaration/ExportDefaultDeclaration/fixtures/interface/fixture.ts",
"declaration/ExportNamedDeclaration/fixtures/aliased/fixture.ts",
+ "declaration/ExportNamedDeclaration/fixtures/class/fixture.ts",
"declaration/ExportNamedDeclaration/fixtures/declare-function/fixture.ts",
+ "declaration/ExportNamedDeclaration/fixtures/enum/fixture.ts",
+ "declaration/ExportNamedDeclaration/fixtures/function-declaration/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/namespace/fixture.ts",
"declaration/ExportNamedDeclaration/fixtures/type-alias/fixture.ts",
+ "declaration/ExportNamedDeclaration/fixtures/variable-declaration/fixture.ts",
+ "declaration/FunctionDeclaration/fixtures/async/fixture.ts",
+ "declaration/FunctionDeclaration/fixtures/empty/fixture.ts",
+ "declaration/FunctionDeclaration/fixtures/generator/fixture.ts",
+ "declaration/FunctionDeclaration/fixtures/param-many/fixture.ts",
+ "declaration/FunctionDeclaration/fixtures/param-one/fixture.ts",
+ "declaration/FunctionDeclaration/fixtures/returnType/fixture.ts",
"declaration/FunctionDeclaration/fixtures/type-param-many/fixture.ts",
"declaration/FunctionDeclaration/fixtures/type-param-one/fixture.ts",
+ "declaration/ImportDeclaration/fixtures/assertion/fixture.ts",
+ "declaration/ImportDeclaration/fixtures/default-and-named-many/fixture.ts",
+ "declaration/ImportDeclaration/fixtures/default-and-named-none/fixture.ts",
+ "declaration/ImportDeclaration/fixtures/default-and-named-one/fixture.ts",
+ "declaration/ImportDeclaration/fixtures/default-and-namespace/fixture.ts",
+ "declaration/ImportDeclaration/fixtures/default/fixture.ts",
+ "declaration/ImportDeclaration/fixtures/named-many/fixture.ts",
+ "declaration/ImportDeclaration/fixtures/named-one/fixture.ts",
+ "declaration/TSDeclareFunction/fixtures/empty/fixture.ts",
+ "declaration/TSDeclareFunction/fixtures/generator/fixture.ts",
+ "declaration/TSDeclareFunction/fixtures/param-many/fixture.ts",
+ "declaration/TSDeclareFunction/fixtures/param-one/fixture.ts",
+ "declaration/TSDeclareFunction/fixtures/returnType/fixture.ts",
"declaration/TSDeclareFunction/fixtures/type-param-many/fixture.ts",
"declaration/TSDeclareFunction/fixtures/type-param-one/fixture.ts",
+ "declaration/TSDeclareFunction/fixtures/without-declare/fixture.ts",
+ "declaration/TSEnumDeclaration/fixtures/const/fixture.ts",
+ "declaration/TSEnumDeclaration/fixtures/declare/fixture.ts",
+ "declaration/TSEnumDeclaration/fixtures/empty/fixture.ts",
+ "declaration/TSEnumDeclaration/fixtures/with-member-one/fixture.ts",
+ "declaration/TSImportEqualsDeclaration/fixtures/entity-name-many/fixture.ts",
+ "declaration/TSImportEqualsDeclaration/fixtures/entity-name-one/fixture.ts",
"declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/fixture.ts",
+ "declaration/TSInterfaceDeclaration/fixtures/declare/fixture.ts",
+ "declaration/TSInterfaceDeclaration/fixtures/empty/fixture.ts",
"declaration/TSInterfaceDeclaration/fixtures/extends-many/fixture.ts",
"declaration/TSInterfaceDeclaration/fixtures/extends-one/fixture.ts",
"declaration/TSInterfaceDeclaration/fixtures/type-param-many/fixture.ts",
"declaration/TSInterfaceDeclaration/fixtures/type-param-one/fixture.ts",
+ "declaration/TSInterfaceDeclaration/fixtures/with-member-one/fixture.ts",
"declaration/TSModuleDeclaration/fixtures/global/fixture.ts",
"declaration/TSModuleDeclaration/fixtures/module-declare-no-body/fixture.ts",
"declaration/TSModuleDeclaration/fixtures/module-declare/fixture.ts",
@@ -34,14 +84,27 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = `
"declaration/TSModuleDeclaration/fixtures/namespace-declare/fixture.ts",
"declaration/TSModuleDeclaration/fixtures/namespace-id-identifier/fixture.ts",
"declaration/TSModuleDeclaration/fixtures/namespace-id-qualified-name/fixture.ts",
+ "declaration/TSModuleDeclaration/fixtures/namespace-nested-once/fixture.ts",
+ "declaration/TSModuleDeclaration/fixtures/namespace-nested-twice/fixture.ts",
+ "declaration/TSNamespaceExportDeclaration/fixtures/valid/fixture.ts",
+ "declaration/TSTypeAliasDeclaration/fixtures/declare/fixture.ts",
"declaration/TSTypeAliasDeclaration/fixtures/type-param-many/fixture.ts",
"declaration/TSTypeAliasDeclaration/fixtures/type-param-one/fixture.ts",
+ "declaration/TSTypeAliasDeclaration/fixtures/valid/fixture.ts",
+ "declaration/VariableDeclaration/fixtures/const-with-value/fixture.ts",
+ "declaration/VariableDeclaration/fixtures/const-without-value/fixture.ts",
+ "declaration/VariableDeclaration/fixtures/declare/fixture.ts",
+ "declaration/VariableDeclaration/fixtures/let-with-value/fixture.ts",
+ "declaration/VariableDeclaration/fixtures/let-without-value/fixture.ts",
+ "declaration/VariableDeclaration/fixtures/multiple-declarations/fixture.ts",
+ "declaration/VariableDeclaration/fixtures/var-with-value/fixture.ts",
+ "declaration/VariableDeclaration/fixtures/var-without-value/fixture.ts",
"element/AccessorProperty/fixtures/key-computed-complex/fixture.ts",
"element/AccessorProperty/fixtures/key-computed-number/fixture.ts",
"element/AccessorProperty/fixtures/key-computed-string/fixture.ts",
+ "element/AccessorProperty/fixtures/key-number/fixture.ts",
"element/AccessorProperty/fixtures/key-private/fixture.ts",
"element/AccessorProperty/fixtures/key-string/fixture.ts",
- "element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture.ts",
"element/AccessorProperty/fixtures/modifier-abstract/fixture.ts",
"element/AccessorProperty/fixtures/modifier-declare/fixture.ts",
"element/AccessorProperty/fixtures/modifier-override/fixture.ts",
@@ -55,23 +118,47 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = `
"element/AccessorProperty/fixtures/with-annotation-no-value/fixture.ts",
"element/AccessorProperty/fixtures/with-annotation-with-value/fixture.ts",
"expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture.ts",
+ "expression/TSSatisfiesExpression/fixtures/chained-satisfies/fixture.ts",
+ "expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/fixture.ts",
+ "expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/fixture.ts",
+ "expression/TSSatisfiesExpression/fixtures/identifier-keyword/fixture.ts",
+ "expression/TSSatisfiesExpression/fixtures/identifier-object-type/fixture.ts",
+ "expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/fixture.ts",
+ "expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/fixture.ts",
+ "expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/fixture.ts",
+ "expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts",
+ "expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts",
"jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx",
+ "jsx/JSXNamespacedName/fixtures/component/fixture.tsx",
"legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-instance-member/fixture.ts",
"legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-factory-static-member/fixture.ts",
"legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-instance-member/fixture.ts",
"legacy-fixtures/accessor-decorators/fixtures/accessor-decorator-static-member/fixture.ts",
"legacy-fixtures/babylon-convergence/fixtures/type-parameter-whitespace-loc/fixture.ts",
"legacy-fixtures/babylon-convergence/fixtures/type-parameters/fixture.ts",
- "legacy-fixtures/basics/fixtures/abstract-class-with-abstract-constructor/fixture.ts",
"legacy-fixtures/basics/fixtures/abstract-class-with-abstract-method/fixture.ts",
"legacy-fixtures/basics/fixtures/abstract-class-with-abstract-properties/fixture.ts",
"legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts",
"legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts",
"legacy-fixtures/basics/fixtures/abstract-class-with-optional-method/fixture.ts",
"legacy-fixtures/basics/fixtures/abstract-class-with-override-method/fixture.ts",
+ "legacy-fixtures/basics/fixtures/angle-bracket-type-assertion-arrow-function/fixture.ts",
+ "legacy-fixtures/basics/fixtures/angle-bracket-type-assertion/fixture.ts",
+ "legacy-fixtures/basics/fixtures/arrow-function-with-optional-parameter/fixture.ts",
"legacy-fixtures/basics/fixtures/arrow-function-with-type-parameters/fixture.ts",
+ "legacy-fixtures/basics/fixtures/async-function-expression/fixture.ts",
+ "legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture.ts",
"legacy-fixtures/basics/fixtures/call-signatures-with-generics/fixture.ts",
"legacy-fixtures/basics/fixtures/call-signatures/fixture.ts",
+ "legacy-fixtures/basics/fixtures/cast-as-expression/fixture.ts",
+ "legacy-fixtures/basics/fixtures/cast-as-multi-assign/fixture.ts",
+ "legacy-fixtures/basics/fixtures/cast-as-multi/fixture.ts",
+ "legacy-fixtures/basics/fixtures/cast-as-operator/fixture.ts",
+ "legacy-fixtures/basics/fixtures/cast-as-simple/fixture.ts",
+ "legacy-fixtures/basics/fixtures/catch-clause-with-annotation/fixture.ts",
+ "legacy-fixtures/basics/fixtures/catch-clause-with-invalid-annotation/fixture.ts",
+ "legacy-fixtures/basics/fixtures/class-multi-line-keyword-abstract/fixture.ts",
+ "legacy-fixtures/basics/fixtures/class-multi-line-keyword-declare/fixture.ts",
"legacy-fixtures/basics/fixtures/class-private-identifier-field-with-annotation/fixture.ts",
"legacy-fixtures/basics/fixtures/class-private-identifier-readonly-field/fixture.ts",
"legacy-fixtures/basics/fixtures/class-static-blocks/fixture.ts",
@@ -98,6 +185,7 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = `
"legacy-fixtures/basics/fixtures/class-with-optional-methods/fixture.ts",
"legacy-fixtures/basics/fixtures/class-with-optional-properties/fixture.ts",
"legacy-fixtures/basics/fixtures/class-with-optional-property-undefined/fixture.ts",
+ "legacy-fixtures/basics/fixtures/class-with-override-method/fixture.ts",
"legacy-fixtures/basics/fixtures/class-with-override-property/fixture.ts",
"legacy-fixtures/basics/fixtures/class-with-private-optional-property/fixture.ts",
"legacy-fixtures/basics/fixtures/class-with-private-parameter-properties/fixture.ts",
@@ -110,9 +198,18 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = `
"legacy-fixtures/basics/fixtures/class-with-type-parameter-default/fixture.ts",
"legacy-fixtures/basics/fixtures/class-with-type-parameter-underscore/fixture.ts",
"legacy-fixtures/basics/fixtures/class-with-type-parameter/fixture.ts",
+ "legacy-fixtures/basics/fixtures/const-enum/fixture.ts",
"legacy-fixtures/basics/fixtures/declare-class-with-optional-method/fixture.ts",
+ "legacy-fixtures/basics/fixtures/declare-function/fixture.ts",
+ "legacy-fixtures/basics/fixtures/destructuring-assignment-nested/fixture.ts",
+ "legacy-fixtures/basics/fixtures/destructuring-assignment-object/fixture.ts",
+ "legacy-fixtures/basics/fixtures/destructuring-assignment-property/fixture.ts",
+ "legacy-fixtures/basics/fixtures/destructuring-assignment/fixture.ts",
"legacy-fixtures/basics/fixtures/directive-in-module/fixture.ts",
"legacy-fixtures/basics/fixtures/directive-in-namespace/fixture.ts",
+ "legacy-fixtures/basics/fixtures/dynamic-import-with-import-assertions/fixture.ts",
+ "legacy-fixtures/basics/fixtures/export-all-with-import-assertions/fixture.ts",
+ "legacy-fixtures/basics/fixtures/export-as-namespace/fixture.ts",
"legacy-fixtures/basics/fixtures/export-assignment/fixture.ts",
"legacy-fixtures/basics/fixtures/export-declare-const-named-enum/fixture.ts",
"legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture.ts",
@@ -121,23 +218,35 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = `
"legacy-fixtures/basics/fixtures/export-default-interface/fixture.ts",
"legacy-fixtures/basics/fixtures/export-named-class-with-generic/fixture.ts",
"legacy-fixtures/basics/fixtures/export-named-class-with-multiple-generics/fixture.ts",
+ "legacy-fixtures/basics/fixtures/export-named-enum/fixture.ts",
+ "legacy-fixtures/basics/fixtures/export-star-as-ns-from/fixture.ts",
"legacy-fixtures/basics/fixtures/export-type-as/fixture.ts",
"legacy-fixtures/basics/fixtures/export-type-from-as/fixture.ts",
"legacy-fixtures/basics/fixtures/export-type-from/fixture.ts",
"legacy-fixtures/basics/fixtures/export-type-star-from/fixture.ts",
"legacy-fixtures/basics/fixtures/export-type/fixture.ts",
"legacy-fixtures/basics/fixtures/function-anonymus-with-type-parameters/fixture.ts",
+ "legacy-fixtures/basics/fixtures/function-anynomus-with-return-type/fixture.ts",
+ "legacy-fixtures/basics/fixtures/function-overloads/fixture.ts",
+ "legacy-fixtures/basics/fixtures/function-with-await/fixture.ts",
+ "legacy-fixtures/basics/fixtures/function-with-object-type-with-optional-properties/fixture.ts",
+ "legacy-fixtures/basics/fixtures/function-with-object-type-without-annotation/fixture.ts",
"legacy-fixtures/basics/fixtures/function-with-type-parameters-that-have-comments/fixture.ts",
"legacy-fixtures/basics/fixtures/function-with-type-parameters-with-constraint/fixture.ts",
"legacy-fixtures/basics/fixtures/function-with-type-parameters/fixture.ts",
+ "legacy-fixtures/basics/fixtures/function-with-types-assignation/fixture.ts",
+ "legacy-fixtures/basics/fixtures/function-with-types/fixture.ts",
+ "legacy-fixtures/basics/fixtures/global-this/fixture.ts",
"legacy-fixtures/basics/fixtures/import-equal-declaration/fixture.ts",
"legacy-fixtures/basics/fixtures/import-equal-type-declaration/fixture.ts",
"legacy-fixtures/basics/fixtures/import-export-equal-declaration/fixture.ts",
"legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/fixture.ts",
"legacy-fixtures/basics/fixtures/import-type-default/fixture.ts",
+ "legacy-fixtures/basics/fixtures/import-type-empty/fixture.ts",
"legacy-fixtures/basics/fixtures/import-type-named-as/fixture.ts",
"legacy-fixtures/basics/fixtures/import-type-named/fixture.ts",
"legacy-fixtures/basics/fixtures/import-type-star-as-ns/fixture.ts",
+ "legacy-fixtures/basics/fixtures/import-with-import-assertions/fixture.ts",
"legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture.ts",
"legacy-fixtures/basics/fixtures/interface-extends/fixture.ts",
"legacy-fixtures/basics/fixtures/interface-type-parameters/fixture.ts",
@@ -148,35 +257,98 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = `
"legacy-fixtures/basics/fixtures/interface-with-jsdoc/fixture.ts",
"legacy-fixtures/basics/fixtures/interface-with-method/fixture.ts",
"legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture.ts",
+ "legacy-fixtures/basics/fixtures/interface-without-type-annotation/fixture.ts",
"legacy-fixtures/basics/fixtures/intrinsic-keyword/fixture.ts",
+ "legacy-fixtures/basics/fixtures/keyof-operator/fixture.ts",
"legacy-fixtures/basics/fixtures/keyword-variables/fixture.ts",
+ "legacy-fixtures/basics/fixtures/nested-type-arguments/fixture.ts",
+ "legacy-fixtures/basics/fixtures/never-type-param/fixture.ts",
+ "legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture.ts",
+ "legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture.ts",
+ "legacy-fixtures/basics/fixtures/nullish-coalescing/fixture.ts",
"legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture.ts",
"legacy-fixtures/basics/fixtures/object-with-typed-methods/fixture.ts",
+ "legacy-fixtures/basics/fixtures/optional-chain-call-with-non-null-assertion/fixture.ts",
+ "legacy-fixtures/basics/fixtures/optional-chain-call-with-parens/fixture.ts",
+ "legacy-fixtures/basics/fixtures/optional-chain-call/fixture.ts",
+ "legacy-fixtures/basics/fixtures/optional-chain-element-access-with-non-null-assertion/fixture.ts",
+ "legacy-fixtures/basics/fixtures/optional-chain-element-access-with-parens/fixture.ts",
+ "legacy-fixtures/basics/fixtures/optional-chain-element-access/fixture.ts",
+ "legacy-fixtures/basics/fixtures/optional-chain-with-non-null-assertion/fixture.ts",
+ "legacy-fixtures/basics/fixtures/optional-chain-with-parens/fixture.ts",
+ "legacy-fixtures/basics/fixtures/optional-chain/fixture.ts",
"legacy-fixtures/basics/fixtures/private-fields-in-in/fixture.ts",
+ "legacy-fixtures/basics/fixtures/readonly-arrays/fixture.ts",
+ "legacy-fixtures/basics/fixtures/readonly-tuples/fixture.ts",
+ "legacy-fixtures/basics/fixtures/short-circuiting-assignment-and-and/fixture.ts",
+ "legacy-fixtures/basics/fixtures/short-circuiting-assignment-or-or/fixture.ts",
+ "legacy-fixtures/basics/fixtures/short-circuiting-assignment-question-question/fixture.ts",
+ "legacy-fixtures/basics/fixtures/symbol-type-param/fixture.ts",
"legacy-fixtures/basics/fixtures/type-alias-declaration-export-function-type/fixture.ts",
"legacy-fixtures/basics/fixtures/type-alias-declaration-export-object-type/fixture.ts",
"legacy-fixtures/basics/fixtures/type-alias-declaration-export/fixture.ts",
"legacy-fixtures/basics/fixtures/type-alias-declaration-with-constrained-type-parameter/fixture.ts",
"legacy-fixtures/basics/fixtures/type-alias-declaration/fixture.ts",
+ "legacy-fixtures/basics/fixtures/type-alias-object-without-annotation/fixture.ts",
+ "legacy-fixtures/basics/fixtures/type-assertion-in-arrow-function/fixture.ts",
+ "legacy-fixtures/basics/fixtures/type-assertion-in-function/fixture.ts",
"legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts",
"legacy-fixtures/basics/fixtures/type-assertion-in-method/fixture.ts",
+ "legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-arrow-function/fixture.ts",
+ "legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-function/fixture.ts",
"legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts",
"legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-method/fixture.ts",
+ "legacy-fixtures/basics/fixtures/type-guard-in-arrow-function/fixture.ts",
+ "legacy-fixtures/basics/fixtures/type-guard-in-function/fixture.ts",
"legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts",
"legacy-fixtures/basics/fixtures/type-guard-in-method/fixture.ts",
"legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/fixture.ts",
"legacy-fixtures/basics/fixtures/type-import-type/fixture.ts",
+ "legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture.ts",
+ "legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture.ts",
"legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts",
"legacy-fixtures/basics/fixtures/type-parameters-comments/fixture.ts",
"legacy-fixtures/basics/fixtures/type-reference-comments/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-bigint/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-boolean/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-false/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-never/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-null/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-number/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-object/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-string/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-symbol/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-true/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-undefined/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-unknown/fixture.ts",
+ "legacy-fixtures/basics/fixtures/typed-keyword-void/fixture.ts",
"legacy-fixtures/basics/fixtures/typed-method-signature/fixture.ts",
"legacy-fixtures/basics/fixtures/typed-this/fixture.ts",
"legacy-fixtures/basics/fixtures/union-intersection/fixture.ts",
+ "legacy-fixtures/basics/fixtures/unique-symbol/fixture.ts",
+ "legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture.ts",
+ "legacy-fixtures/basics/fixtures/var-with-dotted-type/fixture.ts",
+ "legacy-fixtures/basics/fixtures/var-with-type/fixture.ts",
+ "legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/fixture.ts",
+ "legacy-fixtures/class-decorators/fixtures/class-decorator-factory/fixture.ts",
+ "legacy-fixtures/class-decorators/fixtures/class-decorator/fixture.ts",
"legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture.ts",
"legacy-fixtures/class-decorators/fixtures/export-default-class-decorator/fixture.ts",
"legacy-fixtures/class-decorators/fixtures/export-named-class-decorator/fixture.ts",
+ "legacy-fixtures/comments/fixtures/type-assertion-regression-test/fixture.ts",
+ "legacy-fixtures/declare/fixtures/abstract-class/fixture.ts",
+ "legacy-fixtures/declare/fixtures/class/fixture.ts",
+ "legacy-fixtures/declare/fixtures/enum/fixture.ts",
+ "legacy-fixtures/declare/fixtures/function/fixture.ts",
+ "legacy-fixtures/declare/fixtures/interface/fixture.ts",
"legacy-fixtures/declare/fixtures/module/fixture.ts",
"legacy-fixtures/declare/fixtures/namespace/fixture.ts",
+ "legacy-fixtures/declare/fixtures/type-alias/fixture.ts",
+ "legacy-fixtures/declare/fixtures/variable/fixture.ts",
+ "legacy-fixtures/expressions/fixtures/call-expression-type-arguments/fixture.ts",
+ "legacy-fixtures/expressions/fixtures/new-expression-type-arguments/fixture.ts",
+ "legacy-fixtures/expressions/fixtures/optional-call-expression-type-arguments/fixture.ts",
+ "legacy-fixtures/expressions/fixtures/tagged-template-expression-type-arguments/fixture.ts",
"legacy-fixtures/method-decorators/fixtures/method-decorator-factory-instance-member/fixture.ts",
"legacy-fixtures/method-decorators/fixtures/method-decorator-factory-static-member/fixture.ts",
"legacy-fixtures/method-decorators/fixtures/method-decorator-instance-member/fixture.ts",
@@ -197,10 +369,13 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = `
"legacy-fixtures/property-decorators/fixtures/property-decorator-factory-static-member/fixture.ts",
"legacy-fixtures/property-decorators/fixtures/property-decorator-instance-member/fixture.ts",
"legacy-fixtures/property-decorators/fixtures/property-decorator-static-member/fixture.ts",
+ "legacy-fixtures/types/fixtures/array-type/fixture.ts",
"legacy-fixtures/types/fixtures/conditional-infer-nested/fixture.ts",
"legacy-fixtures/types/fixtures/conditional-infer-simple/fixture.ts",
"legacy-fixtures/types/fixtures/conditional-infer-with-constraint/fixture.ts",
"legacy-fixtures/types/fixtures/conditional-infer/fixture.ts",
+ "legacy-fixtures/types/fixtures/conditional-with-null/fixture.ts",
+ "legacy-fixtures/types/fixtures/conditional/fixture.ts",
"legacy-fixtures/types/fixtures/constructor-abstract/fixture.ts",
"legacy-fixtures/types/fixtures/constructor-empty/fixture.ts",
"legacy-fixtures/types/fixtures/constructor-generic/fixture.ts",
@@ -214,8 +389,15 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = `
"legacy-fixtures/types/fixtures/function-with-rest/fixture.ts",
"legacy-fixtures/types/fixtures/function-with-this/fixture.ts",
"legacy-fixtures/types/fixtures/function/fixture.ts",
+ "legacy-fixtures/types/fixtures/index-signature-readonly/fixture.ts",
+ "legacy-fixtures/types/fixtures/index-signature-without-type/fixture.ts",
+ "legacy-fixtures/types/fixtures/index-signature/fixture.ts",
+ "legacy-fixtures/types/fixtures/indexed/fixture.ts",
"legacy-fixtures/types/fixtures/interface-with-accessors/fixture.ts",
"legacy-fixtures/types/fixtures/intersection-type/fixture.ts",
+ "legacy-fixtures/types/fixtures/literal-number-negative/fixture.ts",
+ "legacy-fixtures/types/fixtures/literal-number/fixture.ts",
+ "legacy-fixtures/types/fixtures/literal-string/fixture.ts",
"legacy-fixtures/types/fixtures/mapped-named-type/fixture.ts",
"legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture.ts",
"legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture.ts",
@@ -228,14 +410,32 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = `
"legacy-fixtures/types/fixtures/optional-variance-in-out/fixture.ts",
"legacy-fixtures/types/fixtures/optional-variance-in/fixture.ts",
"legacy-fixtures/types/fixtures/optional-variance-out/fixture.ts",
+ "legacy-fixtures/types/fixtures/parenthesized-type/fixture.ts",
+ "legacy-fixtures/types/fixtures/reference-generic-nested/fixture.ts",
+ "legacy-fixtures/types/fixtures/reference-generic/fixture.ts",
+ "legacy-fixtures/types/fixtures/reference/fixture.ts",
+ "legacy-fixtures/types/fixtures/template-literal-type-1/fixture.ts",
"legacy-fixtures/types/fixtures/template-literal-type-2/fixture.ts",
"legacy-fixtures/types/fixtures/template-literal-type-3/fixture.ts",
"legacy-fixtures/types/fixtures/template-literal-type-4/fixture.ts",
"legacy-fixtures/types/fixtures/this-type-expanded/fixture.ts",
"legacy-fixtures/types/fixtures/this-type/fixture.ts",
+ "legacy-fixtures/types/fixtures/tuple-empty/fixture.ts",
+ "legacy-fixtures/types/fixtures/tuple-named-optional/fixture.ts",
+ "legacy-fixtures/types/fixtures/tuple-named-rest/fixture.ts",
+ "legacy-fixtures/types/fixtures/tuple-named-type/fixture.ts",
+ "legacy-fixtures/types/fixtures/tuple-named/fixture.ts",
"legacy-fixtures/types/fixtures/tuple-optional/fixture.ts",
+ "legacy-fixtures/types/fixtures/tuple-rest/fixture.ts",
+ "legacy-fixtures/types/fixtures/tuple-type/fixture.ts",
+ "legacy-fixtures/types/fixtures/tuple/fixture.ts",
+ "legacy-fixtures/types/fixtures/type-literal/fixture.ts",
+ "legacy-fixtures/types/fixtures/type-operator/fixture.ts",
"legacy-fixtures/types/fixtures/typeof-this/fixture.ts",
+ "legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture.ts",
+ "legacy-fixtures/types/fixtures/typeof/fixture.ts",
"legacy-fixtures/types/fixtures/union-intersection/fixture.ts",
+ "legacy-fixtures/types/fixtures/union-type/fixture.ts",
"special/TSTypeParameter/fixtures/arrow-const-modifier-extends/fixture.ts",
"special/TSTypeParameter/fixtures/arrow-const-modifier/fixture.ts",
"special/TSTypeParameter/fixtures/class-decl-const-in-modifier/fixture.ts",
diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot
index 0d7386813397..3baa5a85efca 100644
--- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot
+++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot
@@ -6,7 +6,6 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = `
"declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts",
"declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/fixture.ts",
"declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture.ts",
- "declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture.ts",
"declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts",
"declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture.ts",
"declaration/TSDeclareFunction/fixtures/_error_/async/fixture.ts",
@@ -18,17 +17,10 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = `
"declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture.ts",
"declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/fixture.ts",
"declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture.ts",
- "declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/fixture.ts",
"element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts",
- "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/fixture.ts",
- "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/fixture.ts",
- "legacy-fixtures/basics/fixtures/_error_/abstract-interface/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/await-without-async-function/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts",
- "legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/fixture.ts",
- "legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/fixture.ts",
- "legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture.ts",
@@ -36,17 +28,8 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = `
"legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts",
- "legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts",
@@ -56,38 +39,18 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = `
"legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/fixture.ts",
"legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts",
"legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts",
],
"TSESTree errored but Babel didn't": [
"declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts",
"declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts",
+ "element/AccessorProperty/fixtures/_error_/modifier-abstract-accessor-with-value/fixture.ts",
+ "legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-constructor/fixture.ts",
"legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/fixture.ts",
],
}
diff --git a/packages/ast-spec/tests/fixtures.test.ts b/packages/ast-spec/tests/fixtures.test.ts
index df482078559a..6462d4ab03a6 100644
--- a/packages/ast-spec/tests/fixtures.test.ts
+++ b/packages/ast-spec/tests/fixtures.test.ts
@@ -12,6 +12,7 @@ import type {
} from './util/parsers/parser-types';
import { ParserResponseType } from './util/parsers/parser-types';
import { parseTSESTree } from './util/parsers/typescript-estree';
+import { serializeError } from './util/serialize-error';
import { diffHasChanges, snapshotDiff } from './util/snapshot-diff';
const PACKAGE_ROOT = path.resolve(__dirname, '..');
@@ -38,10 +39,18 @@ const fixturesWithErrorDifferences = {
} as const;
const VALID_FIXTURES: readonly string[] = glob.sync(
- `${SRC_DIR}/**/fixtures/*/fixture.{ts,tsx}`,
+ `**/fixtures/*/fixture.{ts,tsx}`,
+ {
+ cwd: SRC_DIR,
+ absolute: true,
+ },
);
const ERROR_FIXTURES: readonly string[] = glob.sync(
- `${SRC_DIR}/**/fixtures/_error_/*/fixture.{ts,tsx}`,
+ `**/fixtures/_error_/*/fixture.{ts,tsx}`,
+ {
+ cwd: SRC_DIR,
+ absolute: true,
+ },
);
const FIXTURES: readonly Fixture[] = [...VALID_FIXTURES, ...ERROR_FIXTURES].map(
@@ -66,7 +75,7 @@ const FIXTURES: readonly Fixture[] = [...VALID_FIXTURES, ...ERROR_FIXTURES].map(
isError: absolute.includes('/_error_/'),
isJSX: ext.endsWith('x'),
name,
- relative: path.relative(SRC_DIR, absolute),
+ relative: path.relative(SRC_DIR, absolute).replace(/\\/g, '/'),
segments,
snapshotFiles: {
success: {
@@ -163,7 +172,9 @@ function nestDescribe(fixture: Fixture, segments = fixture.segments): void {
}
it('TSESTree - Error', () => {
- expect(tsestreeParsed.error).toMatchSpecificSnapshot(
+ expect(
+ serializeError(tsestreeParsed.error, contents),
+ ).toMatchSpecificSnapshot(
fixture.snapshotFiles.error.tsestree(snapshotCounter++),
);
});
diff --git a/packages/ast-spec/tests/util/parsers/parser-types.ts b/packages/ast-spec/tests/util/parsers/parser-types.ts
index 4538d8ed4a9f..496ba192236b 100644
--- a/packages/ast-spec/tests/util/parsers/parser-types.ts
+++ b/packages/ast-spec/tests/util/parsers/parser-types.ts
@@ -45,4 +45,4 @@ export interface ParserResponseError {
readonly type: ParserResponseType.Error;
readonly error: unknown;
}
-export type ParserResponse = ParserResponseSuccess | ParserResponseError;
+export type ParserResponse = ParserResponseError | ParserResponseSuccess;
diff --git a/packages/ast-spec/tests/util/parsers/typescript-estree-import.ts b/packages/ast-spec/tests/util/parsers/typescript-estree-import.ts
index c04f3d12ae23..a517c0eed319 100644
--- a/packages/ast-spec/tests/util/parsers/typescript-estree-import.ts
+++ b/packages/ast-spec/tests/util/parsers/typescript-estree-import.ts
@@ -13,6 +13,5 @@
* This should be the only place in the package that we import from typescript-estree.
*/
-// 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 } from '@typescript-eslint/typescript-estree';
+// eslint-disable-next-line no-restricted-imports -- the only safe and valid import from typescript-estree in this package
+export { parse, TSError } from '@typescript-eslint/typescript-estree';
diff --git a/packages/ast-spec/tests/util/parsers/typescript-estree.ts b/packages/ast-spec/tests/util/parsers/typescript-estree.ts
index 6cfe656f4bf9..e73330a2f576 100644
--- a/packages/ast-spec/tests/util/parsers/typescript-estree.ts
+++ b/packages/ast-spec/tests/util/parsers/typescript-estree.ts
@@ -8,10 +8,12 @@ export function parseTSESTree(
): ParserResponse {
try {
const result = parse(contents, {
+ allowInvalidAST: fixture.config.allowInvalidAST,
comment: false,
jsx: fixture.ext.endsWith('x'),
loc: true,
range: true,
+ suppressDeprecatedPropertyWarnings: true,
tokens: true,
});
const { tokens: _, comments: __, ...program } = result;
diff --git a/packages/ast-spec/tests/util/serialize-error.ts b/packages/ast-spec/tests/util/serialize-error.ts
new file mode 100644
index 000000000000..5906c6e0ee78
--- /dev/null
+++ b/packages/ast-spec/tests/util/serialize-error.ts
@@ -0,0 +1,28 @@
+import { codeFrameColumns } from '@babel/code-frame';
+
+import { TSError } from './parsers/typescript-estree-import';
+
+export function serializeError(error: unknown, contents: string): unknown {
+ if (!(error instanceof TSError)) {
+ return error;
+ }
+
+ const {
+ name,
+ message,
+ location: { start, end },
+ } = error;
+
+ return (
+ name +
+ '\n' +
+ codeFrameColumns(
+ contents,
+ {
+ start: { line: start.line, column: start.column + 1 },
+ end: { line: end.line, column: end.column + 1 },
+ },
+ { highlightCode: false, message },
+ )
+ );
+}
diff --git a/packages/ast-spec/typings/global.d.ts b/packages/ast-spec/typings/global.d.ts
index 4464c06fbcf7..7dd0713ea5d4 100644
--- a/packages/ast-spec/typings/global.d.ts
+++ b/packages/ast-spec/typings/global.d.ts
@@ -4,6 +4,12 @@
* This is a convenient property because it saves us from a lot of `../`!
*/
interface ASTFixtureConfig {
+ /**
+ * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript.
+ * This case only usually occurs when attempting to lint invalid code.
+ */
+ readonly allowInvalidAST?: boolean;
+
/**
* Specifies that we expect that babel doesn't yet support the code in this fixture, so we expect that it will error.
* This should not be used if we expect babel to throw for this feature due to a valid parser error!
diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md
index 3de59391a01a..4fc91a03b5fc 100644
--- a/packages/eslint-plugin-internal/CHANGELOG.md
+++ b/packages/eslint-plugin-internal/CHANGELOG.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [6.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.62.0...v6.0.0) (2023-07-10)
+
+
+### Features
+
+* add package.json exports for public packages ([#6458](https://github.com/typescript-eslint/typescript-eslint/issues/6458)) ([d676683](https://github.com/typescript-eslint/typescript-eslint/commit/d6766838a05259556029acaac57dc7839b68c592))
+* **eslint-plugin:** rework configs: recommended, strict, stylistic; -type-checked ([#5251](https://github.com/typescript-eslint/typescript-eslint/issues/5251)) ([5346b5b](https://github.com/typescript-eslint/typescript-eslint/commit/5346b5bbdbba81439ba761c282ba9cdcec7b45c8)), closes [#5036](https://github.com/typescript-eslint/typescript-eslint/issues/5036) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5889](https://github.com/typescript-eslint/typescript-eslint/issues/5889) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5883](https://github.com/typescript-eslint/typescript-eslint/issues/5883) [#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863) [#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381) [#5256](https://github.com/typescript-eslint/typescript-eslint/issues/5256) [#5399](https://github.com/typescript-eslint/typescript-eslint/issues/5399)
+* remove `RuleTester` in `/utils` in favour of the new `/rule-tester` package ([#6816](https://github.com/typescript-eslint/typescript-eslint/issues/6816)) ([c33f497](https://github.com/typescript-eslint/typescript-eslint/commit/c33f497ad8aec7c123c7374f7aff3e24025fe861))
+* **typescript-estree:** add type checker wrapper APIs to ParserServicesWithTypeInformation ([#6404](https://github.com/typescript-eslint/typescript-eslint/issues/6404)) ([62d5755](https://github.com/typescript-eslint/typescript-eslint/commit/62d57559564fb08512eafe03a2c1b167c4377601))
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+
+
+
+
# [5.62.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.61.0...v5.62.0) (2023-07-10)
**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json
index da875517f322..1dbfdbdddea8 100644
--- a/packages/eslint-plugin-internal/package.json
+++ b/packages/eslint-plugin-internal/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-internal",
- "version": "5.62.0",
+ "version": "6.0.0",
"private": true,
"main": "dist/index.js",
"scripts": {
@@ -14,9 +14,10 @@
},
"dependencies": {
"@types/prettier": "*",
- "@typescript-eslint/scope-manager": "5.62.0",
- "@typescript-eslint/type-utils": "5.62.0",
- "@typescript-eslint/utils": "5.62.0",
+ "@typescript-eslint/rule-tester": "6.0.0",
+ "@typescript-eslint/scope-manager": "6.0.0",
+ "@typescript-eslint/type-utils": "6.0.0",
+ "@typescript-eslint/utils": "6.0.0",
"prettier": "*"
}
}
diff --git a/packages/eslint-plugin-internal/project.json b/packages/eslint-plugin-internal/project.json
index 9bab48c84608..0aad8a17fa72 100644
--- a/packages/eslint-plugin-internal/project.json
+++ b/packages/eslint-plugin-internal/project.json
@@ -8,7 +8,10 @@
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
- "lintFilePatterns": ["packages/eslint-plugin-internal/**/*.ts"]
+ "lintFilePatterns": [
+ "packages/eslint-plugin-internal/**/*.{mts,cts,ts,tsx}"
+ ],
+ "ignorePath": ".eslintignore"
}
}
}
diff --git a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
index 0c671d8432fe..7b34aa0fd260 100644
--- a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
@@ -36,7 +36,7 @@ export default createRule({
docs: {
description:
"Enforce that rules don't use TS API properties with known bad type definitions",
- recommended: 'error',
+ recommended: 'recommended',
requiresTypeChecking: true,
},
fixable: 'code',
@@ -51,9 +51,7 @@ export default createRule({
},
defaultOptions: [],
create(context) {
- const { program, esTreeNodeToTSNodeMap } =
- ESLintUtils.getParserServices(context);
- const checker = program.getTypeChecker();
+ const services = ESLintUtils.getParserServices(context);
return {
'MemberExpression[computed = false]'(
@@ -65,15 +63,13 @@ export default createRule({
}
// make sure the type name matches
- const tsObjectNode = esTreeNodeToTSNodeMap.get(node.object);
- const objectType = checker.getTypeAtLocation(tsObjectNode);
+ const objectType = services.getTypeAtLocation(node.object);
const objectSymbol = objectType.getSymbol();
if (objectSymbol?.getName() !== banned.type) {
continue;
}
- const tsNode = esTreeNodeToTSNodeMap.get(node.property);
- const symbol = checker.getSymbolAtLocation(tsNode);
+ const symbol = services.getSymbolAtLocation(node.property);
const decls = symbol?.getDeclarations();
const isFromTs = decls?.some(decl =>
decl.getSourceFile().fileName.includes('/node_modules/typescript/'),
diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts
index fd7279c38231..8c4676a32ad9 100644
--- a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts
@@ -21,7 +21,7 @@ export default createRule({
docs: {
description:
"Enforce that packages rules don't do `import ts from 'typescript';`",
- recommended: 'error',
+ recommended: 'recommended',
},
fixable: 'code',
schema: [],
diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
index 28f7439472bf..758328efe21f 100644
--- a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
@@ -16,7 +16,7 @@ export default createRule({
type: 'problem',
docs: {
description: `Enforce that eslint-plugin rules don't require anything from ${TSESTREE_NAME} or ${TYPES_NAME}`,
- recommended: 'error',
+ recommended: 'recommended',
},
fixable: 'code',
schema: [],
diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
index 313a32eea5bb..be81846a116a 100644
--- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
+++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
@@ -67,7 +67,7 @@ function doIndent(line: string, indent: number): string {
return line;
}
-function getQuote(code: string): "'" | '"' | null {
+function getQuote(code: string): '"' | "'" | null {
const hasSingleQuote = code.includes("'");
const hasDoubleQuote = code.includes('"');
if (hasSingleQuote && hasDoubleQuote) {
@@ -95,12 +95,12 @@ type Options = [
type MessageIds =
| 'invalidFormatting'
| 'invalidFormattingErrorTest'
+ | 'prettierException'
| 'singleLineQuotes'
| 'templateLiteralEmptyEnds'
| 'templateLiteralLastLineIndent'
- | 'templateStringRequiresIndent'
| 'templateStringMinimumIndent'
- | 'prettierException';
+ | 'templateStringRequiresIndent';
export default createRule({
name: 'plugin-test-formatting',
@@ -108,7 +108,7 @@ export default createRule({
type: 'problem',
docs: {
description: `Enforce that eslint-plugin test snippets are correctly formatted`,
- recommended: 'error',
+ recommended: 'recommended',
requiresTypeChecking: true,
},
fixable: 'code',
@@ -148,9 +148,8 @@ export default createRule({
],
create(context, [{ formatWithPrettier }]) {
const sourceCode = context.getSourceCode();
- const { program, esTreeNodeToTSNodeMap } =
- ESLintUtils.getParserServices(context);
- const checker = program.getTypeChecker();
+ const services = ESLintUtils.getParserServices(context);
+ const checker = services.program.getTypeChecker();
const checkedObjects = new Set();
@@ -522,14 +521,14 @@ export default createRule({
const type = getContextualType(
checker,
- esTreeNodeToTSNodeMap.get(node),
+ services.esTreeNodeToTSNodeMap.get(node),
);
if (!type) {
return;
}
const typeString = checker.typeToString(type);
- if (/^RunTests\b/.test(typeString)) {
+ if (/^(TSESLint\.)?RunTests\b/.test(typeString)) {
checkedObjects.add(node);
for (const prop of node.properties) {
@@ -559,12 +558,12 @@ export default createRule({
return;
}
- if (/^ValidTestCase\b/.test(typeString)) {
+ if (/^(TSESLint\.)?ValidTestCase\b/.test(typeString)) {
checkInvalidTest(node);
return;
}
- if (/^InvalidTestCase\b/.test(typeString)) {
+ if (/^(TSESLint\.)?InvalidTestCase\b/.test(typeString)) {
checkInvalidTest(node);
for (const testProp of node.properties) {
if (
diff --git a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
index 4099e2f02be5..e042f328614e 100755
--- a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
+++ b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
@@ -13,7 +13,7 @@ export default createRule({
meta: {
type: 'problem',
docs: {
- recommended: 'error',
+ recommended: 'recommended',
description:
'Enforce consistent usage of `AST_NODE_TYPES`, `AST_TOKEN_TYPES` and `DefinitionType` enums',
},
diff --git a/packages/eslint-plugin-internal/tests/RuleTester.ts b/packages/eslint-plugin-internal/tests/RuleTester.ts
index 260e222194b0..f56f93ee81f4 100644
--- a/packages/eslint-plugin-internal/tests/RuleTester.ts
+++ b/packages/eslint-plugin-internal/tests/RuleTester.ts
@@ -1,10 +1,8 @@
-import { ESLintUtils } from '@typescript-eslint/utils';
import path from 'path';
function getFixturesRootDir(): string {
return path.join(__dirname, 'fixtures');
}
-const { batchedSingleLineTests, RuleTester } = ESLintUtils;
-
-export { RuleTester, batchedSingleLineTests, getFixturesRootDir };
+export { RuleTester } from '@typescript-eslint/rule-tester';
+export { getFixturesRootDir };
diff --git a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts
index b0b80f56cc35..5e75c5e2b7e5 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts
@@ -1,6 +1,8 @@
/* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */
+import { RuleTester } from '@typescript-eslint/rule-tester';
+
import rule from '../../src/rules/no-poorly-typed-ts-props';
-import { getFixturesRootDir, RuleTester } from '../RuleTester';
+import { getFixturesRootDir } from '../RuleTester';
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts
index 35d2f13d329c..45590e5012de 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts
@@ -1,5 +1,6 @@
+import { RuleTester } from '@typescript-eslint/rule-tester';
+
import rule from '../../src/rules/no-typescript-default-import';
-import { batchedSingleLineTests, RuleTester } from '../RuleTester';
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
@@ -16,30 +17,21 @@ ruleTester.run('no-typescript-default-import', rule, {
'import ts = foo;',
"import ts = require('nottypescript');",
],
- invalid: batchedSingleLineTests({
- code: `
-import ts from 'typescript';
-import ts, { SyntaxKind } from 'typescript';
-import ts = require('typescript');
- `,
- output: `
-import * as ts from 'typescript';
-import ts, { SyntaxKind } from 'typescript';
-import * as ts from 'typescript';
- `,
- errors: [
- {
- messageId: 'noTSDefaultImport',
- line: 2,
- },
- {
- messageId: 'noTSDefaultImport',
- line: 3,
- },
- {
- messageId: 'noTSDefaultImport',
- line: 4,
- },
- ],
- }),
+ invalid: [
+ {
+ code: "import ts from 'typescript';",
+ output: `import * as ts from 'typescript';`,
+ errors: [{ messageId: 'noTSDefaultImport' }],
+ },
+ {
+ code: "import ts, { SyntaxKind } from 'typescript';",
+ output: null,
+ errors: [{ messageId: 'noTSDefaultImport' }],
+ },
+ {
+ code: "import ts = require('typescript');",
+ output: `import * as ts from 'typescript';`,
+ errors: [{ messageId: 'noTSDefaultImport' }],
+ },
+ ],
});
diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
index 1cde420e3375..46eb2edabbe0 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
@@ -1,5 +1,6 @@
+import { RuleTester } from '@typescript-eslint/rule-tester';
+
import rule from '../../src/rules/no-typescript-estree-import';
-import { batchedSingleLineTests, RuleTester } from '../RuleTester';
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
@@ -14,48 +15,36 @@ ruleTester.run('no-typescript-estree-import', rule, {
"import foo from '@typescript-eslint/utils';",
"import * as foo from '@typescript-eslint/utils';",
],
- invalid: batchedSingleLineTests({
- code: `
-import { foo } from '@typescript-eslint/typescript-estree';
-import foo from '@typescript-eslint/typescript-estree';
-import * as foo from '@typescript-eslint/typescript-estree';
-import { foo } from '@typescript-eslint/types';
-import foo from '@typescript-eslint/types';
-import * as foo from '@typescript-eslint/types';
- `,
- output: `
-import { foo } from '@typescript-eslint/utils';
-import foo from '@typescript-eslint/utils';
-import * as foo from '@typescript-eslint/utils';
-import { foo } from '@typescript-eslint/utils';
-import foo from '@typescript-eslint/utils';
-import * as foo from '@typescript-eslint/utils';
- `,
- errors: [
- {
- messageId: 'dontImportPackage',
- line: 2,
- },
- {
- messageId: 'dontImportPackage',
- line: 3,
- },
- {
- messageId: 'dontImportPackage',
- line: 4,
- },
- {
- messageId: 'dontImportPackage',
- line: 5,
- },
- {
- messageId: 'dontImportPackage',
- line: 6,
- },
- {
- messageId: 'dontImportPackage',
- line: 7,
- },
- ],
- }),
+ invalid: [
+ {
+ code: "import { foo } from '@typescript-eslint/typescript-estree';",
+ output: "import { foo } from '@typescript-eslint/utils';",
+ errors: [{ messageId: 'dontImportPackage' }],
+ },
+ {
+ code: "import foo from '@typescript-eslint/typescript-estree';",
+ output: "import foo from '@typescript-eslint/utils';",
+ errors: [{ messageId: 'dontImportPackage' }],
+ },
+ {
+ code: "import * as foo from '@typescript-eslint/typescript-estree';",
+ output: "import * as foo from '@typescript-eslint/utils';",
+ errors: [{ messageId: 'dontImportPackage' }],
+ },
+ {
+ code: "import { foo } from '@typescript-eslint/types';",
+ output: "import { foo } from '@typescript-eslint/utils';",
+ errors: [{ messageId: 'dontImportPackage' }],
+ },
+ {
+ code: "import foo from '@typescript-eslint/types';",
+ output: "import foo from '@typescript-eslint/utils';",
+ errors: [{ messageId: 'dontImportPackage' }],
+ },
+ {
+ code: "import * as foo from '@typescript-eslint/types';",
+ output: "import * as foo from '@typescript-eslint/utils';",
+ errors: [{ messageId: 'dontImportPackage' }],
+ },
+ ],
});
diff --git a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts
index f5745996d382..f9dee0411aba 100644
--- a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts
@@ -1,5 +1,7 @@
+import { RuleTester } from '@typescript-eslint/rule-tester';
+
import rule from '../../src/rules/plugin-test-formatting';
-import { getFixturesRootDir, RuleTester } from '../RuleTester';
+import { getFixturesRootDir } from '../RuleTester';
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
diff --git a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
index ea162462ca6a..44f9f6118bac 100644
--- a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
@@ -1,8 +1,8 @@
+import { RuleTester } from '@typescript-eslint/rule-tester';
import { DefinitionType } from '@typescript-eslint/scope-manager';
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
import rule from '../../src/rules/prefer-ast-types-enum';
-import { batchedSingleLineTests, RuleTester } from '../RuleTester';
const ruleTester = new RuleTester({
parser: '@typescript-eslint/parser',
@@ -29,33 +29,42 @@ ruleTester.run('prefer-ast-types-enum', rule, {
}
`,
],
- invalid: batchedSingleLineTests({
- code: `
-node.type === 'Literal';
-node.type === 'Keyword';
-node.type === 'Parameter';
- `,
- output: `
-node.type === AST_NODE_TYPES.Literal;
-node.type === AST_TOKEN_TYPES.Keyword;
-node.type === DefinitionType.Parameter;
- `,
- errors: [
- {
- data: { enumName: 'AST_NODE_TYPES', literal: AST_NODE_TYPES.Literal },
- messageId: 'preferEnum',
- line: 2,
- },
- {
- data: { enumName: 'AST_TOKEN_TYPES', literal: AST_TOKEN_TYPES.Keyword },
- messageId: 'preferEnum',
- line: 3,
- },
- {
- data: { enumName: 'DefinitionType', literal: DefinitionType.Parameter },
- messageId: 'preferEnum',
- line: 4,
- },
- ],
- }),
+ invalid: [
+ {
+ code: "node.type === 'Literal';",
+ output: 'node.type === AST_NODE_TYPES.Literal;',
+ errors: [
+ {
+ data: { enumName: 'AST_NODE_TYPES', literal: AST_NODE_TYPES.Literal },
+ messageId: 'preferEnum',
+ },
+ ],
+ },
+ {
+ code: "node.type === 'Keyword';",
+ output: 'node.type === AST_TOKEN_TYPES.Keyword;',
+ errors: [
+ {
+ data: {
+ enumName: 'AST_TOKEN_TYPES',
+ literal: AST_TOKEN_TYPES.Keyword,
+ },
+ messageId: 'preferEnum',
+ },
+ ],
+ },
+ {
+ code: "node.type === 'Parameter';",
+ output: 'node.type === DefinitionType.Parameter;',
+ errors: [
+ {
+ data: {
+ enumName: 'DefinitionType',
+ literal: DefinitionType.Parameter,
+ },
+ messageId: 'preferEnum',
+ },
+ ],
+ },
+ ],
});
diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md
index 11b5e536c4e0..46def4348752 100644
--- a/packages/eslint-plugin-tslint/CHANGELOG.md
+++ b/packages/eslint-plugin-tslint/CHANGELOG.md
@@ -3,6 +3,42 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [6.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.62.0...v6.0.0) (2023-07-10)
+
+
+### Bug Fixes
+
+* update `exports` field in package.json files ([#6550](https://github.com/typescript-eslint/typescript-eslint/issues/6550)) ([53776c2](https://github.com/typescript-eslint/typescript-eslint/commit/53776c244f8bbdc852d57c7b313b0935e755ddc4))
+
+
+### chore
+
+* drop support for node v14.17, v17 ([#5971](https://github.com/typescript-eslint/typescript-eslint/issues/5971)) ([cc62015](https://github.com/typescript-eslint/typescript-eslint/commit/cc62015b8ae5f207912ff8988e2a0b3fe9a79243))
+
+
+### Features
+
+* add new package `rule-tester` ([#6777](https://github.com/typescript-eslint/typescript-eslint/issues/6777)) ([2ce1c1d](https://github.com/typescript-eslint/typescript-eslint/commit/2ce1c1d22c799a1ca027674fcb9b3a7ab0107428))
+* add package.json exports for public packages ([#6458](https://github.com/typescript-eslint/typescript-eslint/issues/6458)) ([d676683](https://github.com/typescript-eslint/typescript-eslint/commit/d6766838a05259556029acaac57dc7839b68c592))
+* drop support for ESLint v6 ([#5972](https://github.com/typescript-eslint/typescript-eslint/issues/5972)) ([bda806d](https://github.com/typescript-eslint/typescript-eslint/commit/bda806d78ee46133587d9383baff52d796a594e5))
+* drop support for node v12 ([#5918](https://github.com/typescript-eslint/typescript-eslint/issues/5918)) ([7e3fe9a](https://github.com/typescript-eslint/typescript-eslint/commit/7e3fe9a67abd394b0a114f2deb466edf5c9759ac))
+* drop support for node v14 and test against node v20 ([#7022](https://github.com/typescript-eslint/typescript-eslint/issues/7022)) ([e6235bf](https://github.com/typescript-eslint/typescript-eslint/commit/e6235bf61b781066653581b57b7cd976c9c4f905))
+* **eslint-plugin:** rework configs: recommended, strict, stylistic; -type-checked ([#5251](https://github.com/typescript-eslint/typescript-eslint/issues/5251)) ([5346b5b](https://github.com/typescript-eslint/typescript-eslint/commit/5346b5bbdbba81439ba761c282ba9cdcec7b45c8)), closes [#5036](https://github.com/typescript-eslint/typescript-eslint/issues/5036) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5889](https://github.com/typescript-eslint/typescript-eslint/issues/5889) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5883](https://github.com/typescript-eslint/typescript-eslint/issues/5883) [#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863) [#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381) [#5256](https://github.com/typescript-eslint/typescript-eslint/issues/5256) [#5399](https://github.com/typescript-eslint/typescript-eslint/issues/5399)
+* **typescript-estree:** add type checker wrapper APIs to ParserServicesWithTypeInformation ([#6404](https://github.com/typescript-eslint/typescript-eslint/issues/6404)) ([62d5755](https://github.com/typescript-eslint/typescript-eslint/commit/62d57559564fb08512eafe03a2c1b167c4377601))
+
+
+### BREAKING CHANGES
+
+* drop support for ESLint v6
+* drops support for node v17
+* drops support for node v12
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+
+
+
+
# [5.62.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.61.0...v5.62.0) (2023-07-10)
**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
diff --git a/packages/eslint-plugin-tslint/README.md b/packages/eslint-plugin-tslint/README.md
index a6bc3b8a1136..d02ff8797606 100644
--- a/packages/eslint-plugin-tslint/README.md
+++ b/packages/eslint-plugin-tslint/README.md
@@ -8,3 +8,5 @@
👉 See **https://typescript-eslint.io/packages/eslint-plugin-tslint** for documentation on this package.
> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code.
+
+
diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json
index 2789a2bc89e8..7d65ee3ff37f 100644
--- a/packages/eslint-plugin-tslint/package.json
+++ b/packages/eslint-plugin-tslint/package.json
@@ -1,24 +1,26 @@
{
"name": "@typescript-eslint/eslint-plugin-tslint",
- "version": "5.62.0",
+ "version": "6.0.0",
"main": "dist/index.js",
"typings": "src/index.ts",
"description": "ESLint plugin that wraps a TSLint configuration and lints the whole source using TSLint",
- "keywords": [
- "eslint",
- "eslintplugin",
- "eslint-plugin",
- "tslint"
- ],
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
"files": [
"dist",
"package.json",
"README.md",
"LICENSE"
],
+ "type": "commonjs",
+ "exports": {
+ ".": {
+ "types": "./dist/index.d.ts",
+ "default": "./dist/index.js"
+ },
+ "./package.json": "./package.json"
+ },
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
"repository": {
"type": "git",
"url": "https://github.com/typescript-eslint/typescript-eslint.git",
@@ -28,6 +30,12 @@
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"license": "MIT",
+ "keywords": [
+ "eslint",
+ "eslintplugin",
+ "eslint-plugin",
+ "tslint"
+ ],
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "tsc -b tsconfig.build.json --clean",
@@ -38,14 +46,19 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/utils": "5.62.0"
+ "@typescript-eslint/utils": "6.0.0"
},
"peerDependencies": {
- "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0",
+ "eslint": "^7.0.0 || ^8.0.0",
"tslint": "^5.0.0 || ^6.0.0",
"typescript": "*"
},
"devDependencies": {
- "@typescript-eslint/parser": "5.62.0"
+ "@types/lodash": "*",
+ "@typescript-eslint/parser": "6.0.0"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
}
}
diff --git a/packages/eslint-plugin-tslint/project.json b/packages/eslint-plugin-tslint/project.json
index 4aa7c89f3e32..b69d03550d01 100644
--- a/packages/eslint-plugin-tslint/project.json
+++ b/packages/eslint-plugin-tslint/project.json
@@ -8,7 +8,10 @@
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
- "lintFilePatterns": ["packages/eslint-plugin-tslint/**/*.ts"]
+ "lintFilePatterns": [
+ "packages/eslint-plugin-tslint/**/*.{mts,cts,ts,tsx}"
+ ],
+ "ignorePath": ".eslintignore"
}
}
}
diff --git a/packages/eslint-plugin-tslint/src/rules/config.ts b/packages/eslint-plugin-tslint/src/rules/config.ts
index dad8febccc03..e7918218a905 100644
--- a/packages/eslint-plugin-tslint/src/rules/config.ts
+++ b/packages/eslint-plugin-tslint/src/rules/config.ts
@@ -32,14 +32,14 @@ const createRule = ESLintUtils.RuleCreator(
);
export type RawRulesConfig = Record<
string,
- | null
- | undefined
- | boolean
| unknown[]
+ | boolean
| {
- severity?: RuleSeverity | 'warn' | 'none' | 'default';
+ severity?: RuleSeverity | 'default' | 'none' | 'warn';
options?: unknown;
}
+ | null
+ | undefined
>;
export type MessageIds = 'failure';
@@ -82,7 +82,6 @@ export default createRule({
docs: {
description:
'Wraps a TSLint configuration and lints the whole source using TSLint', // eslint-disable-line eslint-plugin/require-meta-docs-description
- recommended: false,
},
fixable: 'code',
type: 'problem',
@@ -121,8 +120,8 @@ export default createRule({
) {
const fileName = context.getFilename();
const sourceCode = context.getSourceCode().text;
- const parserServices = ESLintUtils.getParserServices(context);
- const program = parserServices.program;
+ const services = ESLintUtils.getParserServices(context);
+ const program = services.program;
/**
* Create an instance of TSLint
diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/4.ts b/packages/eslint-plugin-tslint/tests/fixture-project/4.ts
deleted file mode 100644
index 1ca8bbace361..000000000000
--- a/packages/eslint-plugin-tslint/tests/fixture-project/4.ts
+++ /dev/null
@@ -1 +0,0 @@
-var foo = true // semicolon
diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/1.ts b/packages/eslint-plugin-tslint/tests/fixtures/fixture-project/1.ts
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/fixture-project/1.ts
rename to packages/eslint-plugin-tslint/tests/fixtures/fixture-project/1.ts
diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/2.ts b/packages/eslint-plugin-tslint/tests/fixtures/fixture-project/2.ts
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/fixture-project/2.ts
rename to packages/eslint-plugin-tslint/tests/fixtures/fixture-project/2.ts
diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/3.ts b/packages/eslint-plugin-tslint/tests/fixtures/fixture-project/3.ts
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/fixture-project/3.ts
rename to packages/eslint-plugin-tslint/tests/fixtures/fixture-project/3.ts
diff --git a/packages/eslint-plugin-tslint/tests/fixtures/fixture-project/4.ts b/packages/eslint-plugin-tslint/tests/fixtures/fixture-project/4.ts
new file mode 100644
index 000000000000..e1173e87a223
--- /dev/null
+++ b/packages/eslint-plugin-tslint/tests/fixtures/fixture-project/4.ts
@@ -0,0 +1 @@
+var foo = true; // semicolon
diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/5.ts b/packages/eslint-plugin-tslint/tests/fixtures/fixture-project/5.ts
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/fixture-project/5.ts
rename to packages/eslint-plugin-tslint/tests/fixtures/fixture-project/5.ts
diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/6.ts b/packages/eslint-plugin-tslint/tests/fixtures/fixture-project/6.ts
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/fixture-project/6.ts
rename to packages/eslint-plugin-tslint/tests/fixtures/fixture-project/6.ts
diff --git a/packages/eslint-plugin-tslint/tests/fixture-project/tsconfig.json b/packages/eslint-plugin-tslint/tests/fixtures/fixture-project/tsconfig.json
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/fixture-project/tsconfig.json
rename to packages/eslint-plugin-tslint/tests/fixtures/fixture-project/tsconfig.json
diff --git a/packages/eslint-plugin-tslint/tests/test-project/extra.ts b/packages/eslint-plugin-tslint/tests/fixtures/test-project/extra.ts
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/test-project/extra.ts
rename to packages/eslint-plugin-tslint/tests/fixtures/test-project/extra.ts
diff --git a/packages/eslint-plugin-tslint/tests/test-project/file-spec.ts b/packages/eslint-plugin-tslint/tests/fixtures/test-project/file-spec.ts
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/test-project/file-spec.ts
rename to packages/eslint-plugin-tslint/tests/fixtures/test-project/file-spec.ts
diff --git a/packages/eslint-plugin-tslint/tests/test-project/file.ts b/packages/eslint-plugin-tslint/tests/fixtures/test-project/file.ts
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/test-project/file.ts
rename to packages/eslint-plugin-tslint/tests/fixtures/test-project/file.ts
diff --git a/packages/eslint-plugin-tslint/tests/test-project/source.ts b/packages/eslint-plugin-tslint/tests/fixtures/test-project/source.ts
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/test-project/source.ts
rename to packages/eslint-plugin-tslint/tests/fixtures/test-project/source.ts
diff --git a/packages/eslint-plugin-tslint/tests/test-project/tsconfig-files.json b/packages/eslint-plugin-tslint/tests/fixtures/test-project/tsconfig-files.json
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/test-project/tsconfig-files.json
rename to packages/eslint-plugin-tslint/tests/fixtures/test-project/tsconfig-files.json
diff --git a/packages/eslint-plugin-tslint/tests/test-project/tsconfig.json b/packages/eslint-plugin-tslint/tests/fixtures/test-project/tsconfig.json
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/test-project/tsconfig.json
rename to packages/eslint-plugin-tslint/tests/fixtures/test-project/tsconfig.json
diff --git a/packages/eslint-plugin-tslint/tests/test-project/tslint.json b/packages/eslint-plugin-tslint/tests/fixtures/test-project/tslint.json
similarity index 100%
rename from packages/eslint-plugin-tslint/tests/test-project/tslint.json
rename to packages/eslint-plugin-tslint/tests/fixtures/test-project/tslint.json
diff --git a/packages/eslint-plugin-tslint/tests/test-tslint-rules-directory/alwaysFailRule.js b/packages/eslint-plugin-tslint/tests/fixtures/test-tslint-rules-directory/alwaysFailRule.js
similarity index 83%
rename from packages/eslint-plugin-tslint/tests/test-tslint-rules-directory/alwaysFailRule.js
rename to packages/eslint-plugin-tslint/tests/fixtures/test-tslint-rules-directory/alwaysFailRule.js
index 2d923f2e41f2..76537897f031 100644
--- a/packages/eslint-plugin-tslint/tests/test-tslint-rules-directory/alwaysFailRule.js
+++ b/packages/eslint-plugin-tslint/tests/fixtures/test-tslint-rules-directory/alwaysFailRule.js
@@ -1,10 +1,9 @@
-
const Lint = require('tslint');
class Rule extends Lint.Rules.AbstractRule {
apply(sourceFile) {
return this.applyWithWalker(
- new AlwaysFailWalker(sourceFile, this.getOptions())
+ new AlwaysFailWalker(sourceFile, this.getOptions()),
);
}
}
@@ -12,7 +11,7 @@ class Rule extends Lint.Rules.AbstractRule {
class AlwaysFailWalker extends Lint.RuleWalker {
visitSourceFile(node) {
this.addFailure(
- this.createFailure(node.getStart(), node.getWidth(), 'failure')
+ this.createFailure(node.getStart(), node.getWidth(), 'failure'),
);
}
}
diff --git a/packages/eslint-plugin-tslint/tests/index.spec.ts b/packages/eslint-plugin-tslint/tests/index.spec.ts
index 6c0d8cdf9941..238cc3185062 100644
--- a/packages/eslint-plugin-tslint/tests/index.spec.ts
+++ b/packages/eslint-plugin-tslint/tests/index.spec.ts
@@ -1,7 +1,10 @@
-import { TSESLint } from '@typescript-eslint/utils';
import * as parser from '@typescript-eslint/parser';
+import { TSESLint } from '@typescript-eslint/utils';
import { readFileSync } from 'fs';
-import rule, { Options } from '../src/rules/config';
+import path = require('path');
+
+import type { Options } from '../src/rules/config';
+import rule from '../src/rules/config';
const ruleTester = new TSESLint.RuleTester({
parserOptions: {
@@ -12,7 +15,7 @@ const ruleTester = new TSESLint.RuleTester({
* Project is needed to generate the parserServices
* within @typescript-eslint/parser
*/
- project: './tests/fixture-project/tsconfig.json',
+ project: './tests/fixtures/fixture-project/tsconfig.json',
warnOnUnsupportedTypeScriptVersion: false,
},
parser: require.resolve('@typescript-eslint/parser'),
@@ -34,7 +37,7 @@ const tslintRulesConfig: Options = [
*/
const tslintRulesDirectoryConfig: Options = [
{
- rulesDirectory: ['./tests/test-tslint-rules-directory'],
+ rulesDirectory: ['./tests/fixtures/test-tslint-rules-directory'],
rules: {
'always-fail': {
severity: 'error',
@@ -43,37 +46,44 @@ const tslintRulesDirectoryConfig: Options = [
},
];
+const TEST_PROJECT_PATH = path.resolve(
+ __dirname,
+ 'fixtures',
+ 'test-project',
+ 'tsconfig.json',
+);
+
ruleTester.run('tslint/config', rule, {
valid: [
{
code: 'var foo = true;',
options: tslintRulesConfig,
- filename: './tests/fixture-project/1.ts',
+ filename: './tests/fixtures/fixture-project/1.ts',
},
{
- filename: './tests/test-project/file-spec.ts',
- code: readFileSync('./tests/test-project/file-spec.ts', 'utf8').replace(
- /\n/g,
- ' ',
- ),
+ filename: './tests/fixtures/test-project/file-spec.ts',
+ code: readFileSync(
+ './tests/fixtures/test-project/file-spec.ts',
+ 'utf8',
+ ).replace(/\n/g, ' '),
parserOptions: {
- project: `${__dirname}/test-project/tsconfig.json`,
+ project: TEST_PROJECT_PATH,
},
options: tslintRulesConfig,
},
{
code: 'throw "should be ok because rule is not loaded";',
options: tslintRulesConfig,
- filename: './tests/fixture-project/2.ts',
+ filename: './tests/fixtures/fixture-project/2.ts',
},
],
invalid: [
{
- options: [{ lintFile: './tests/test-project/tslint.json' }],
+ options: [{ lintFile: './tests/fixtures/test-project/tslint.json' }],
code: 'throw "err" // no-string-throw',
output: 'throw new Error("err") // no-string-throw',
- filename: './tests/fixture-project/3.ts',
+ filename: './tests/fixtures/fixture-project/3.ts',
errors: [
{
messageId: 'failure',
@@ -89,7 +99,7 @@ ruleTester.run('tslint/config', rule, {
code: 'var foo = true // semicolon',
options: tslintRulesConfig,
output: 'var foo = true; // semicolon',
- filename: './tests/fixture-project/4.ts',
+ filename: './tests/fixtures/fixture-project/4.ts',
errors: [
{
messageId: 'failure',
@@ -105,8 +115,8 @@ ruleTester.run('tslint/config', rule, {
{
code: 'var foo = true // fail',
options: tslintRulesDirectoryConfig,
- output: 'var foo = true // fail',
- filename: './tests/fixture-project/5.ts',
+ output: null,
+ filename: './tests/fixtures/fixture-project/5.ts',
errors: [
{
messageId: 'failure',
@@ -120,18 +130,22 @@ ruleTester.run('tslint/config', rule, {
],
},
{
- filename: './tests/test-project/source.ts',
- code: readFileSync('./tests/test-project/source.ts', 'utf8').replace(
- /\n/g,
- ' ',
- ),
+ filename: './tests/fixtures/test-project/source.ts',
+ code: readFileSync(
+ './tests/fixtures/test-project/source.ts',
+ 'utf8',
+ ).replace(/\n/g, ' '),
parserOptions: {
- project: `${__dirname}/test-project/tsconfig.json`,
+ project: TEST_PROJECT_PATH,
},
options: [
{
rulesDirectory: [
- `${__dirname}/../../../node_modules/tslint/lib/rules`,
+ path.join(
+ path.dirname(require.resolve('tslint/package.json')),
+ 'lib',
+ 'rules',
+ ),
],
rules: { 'restrict-plus-operands': true },
},
@@ -173,7 +187,7 @@ describe('tslint/error', () => {
it('should error on default parser', () => {
testOutput('foo;', {
parserOptions: {
- project: `${__dirname}/test-project/tsconfig.json`,
+ project: TEST_PROJECT_PATH,
},
rules: {
'tslint/config': [2, tslintRulesConfig],
@@ -186,25 +200,33 @@ describe('tslint/error', () => {
jest.spyOn(console, 'warn').mockImplementation();
linter.defineRule('tslint/config', rule);
linter.defineParser('@typescript-eslint/parser', parser);
+
+ const filePath = path.resolve(
+ __dirname,
+ 'fixtures',
+ 'test-project',
+ 'extra.ts',
+ );
+
expect(() =>
linter.verify(
'foo;',
{
parserOptions: {
- project: `${__dirname}/test-project/tsconfig.json`,
+ project: TEST_PROJECT_PATH,
},
rules: {
'tslint/config': [2, {}],
},
parser: '@typescript-eslint/parser',
},
- `${__dirname}/test-project/extra.ts`,
+ filePath,
),
).not.toThrow();
expect(console.warn).toHaveBeenCalledWith(
expect.stringContaining(
- `Tried to lint ${__dirname}/test-project/extra.ts but found no valid, enabled rules for this file type and file path in the resolved configuration.`,
+ `Tried to lint ${filePath} but found no valid, enabled rules for this file type and file path in the resolved configuration.`,
),
);
jest.resetAllMocks();
diff --git a/packages/eslint-plugin-tslint/tsconfig.build.json b/packages/eslint-plugin-tslint/tsconfig.build.json
index ce8f56e72947..86650784975c 100644
--- a/packages/eslint-plugin-tslint/tsconfig.build.json
+++ b/packages/eslint-plugin-tslint/tsconfig.build.json
@@ -1,6 +1,10 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
+ // specifically disable declarations for the plugin
+ // see reasoning in packages/eslint-plugin/rules.d.ts
+ "declaration": false,
+ "declarationMap": false,
"outDir": "./dist",
"rootDir": "./src",
"resolveJsonModule": true
diff --git a/packages/eslint-plugin-tslint/tsconfig.json b/packages/eslint-plugin-tslint/tsconfig.json
index b2f22d5b95db..4ba17c6d60ab 100644
--- a/packages/eslint-plugin-tslint/tsconfig.json
+++ b/packages/eslint-plugin-tslint/tsconfig.json
@@ -5,6 +5,6 @@
"rootDir": "."
},
"include": ["src", "tests"],
- "exclude": ["tests/test-project", "tests/test-tslint-rules-directory"],
+ "exclude": ["tests/fixtures"],
"references": [{ "path": "../utils/tsconfig.build.json" }]
}
diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md
index ce7b0da5208b..6fc0bf0c1649 100644
--- a/packages/eslint-plugin/CHANGELOG.md
+++ b/packages/eslint-plugin/CHANGELOG.md
@@ -3,6 +3,77 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [6.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.62.0...v6.0.0) (2023-07-10)
+
+
+### Bug Fixes
+
+* bumped ts-api-utils to 0.0.39 ([#6497](https://github.com/typescript-eslint/typescript-eslint/issues/6497)) ([217c710](https://github.com/typescript-eslint/typescript-eslint/commit/217c710d99445994b9c8db7b9bee9b9cc63bc4cb))
+* correct handling of additionalProperties in object schemas ([#6939](https://github.com/typescript-eslint/typescript-eslint/issues/6939)) ([489c7a5](https://github.com/typescript-eslint/typescript-eslint/commit/489c7a50ae99ef66df152a68fd447f7e42a23558))
+* correct lint error after merge ([277fdb5](https://github.com/typescript-eslint/typescript-eslint/commit/277fdb5ac76bd761ae6f5d1052445dcff2e848a1))
+* **eslint-plugin:** [explicit-module-boundary-types] remove shouldTrackReferences option from schema ([#5399](https://github.com/typescript-eslint/typescript-eslint/issues/5399)) ([6d32734](https://github.com/typescript-eslint/typescript-eslint/commit/6d32734b1312f60ee7d12d4bb19fc1cf52e7f0a5))
+* **eslint-plugin:** allow parser@^6.0.0 ([#6630](https://github.com/typescript-eslint/typescript-eslint/issues/6630)) ([92908bd](https://github.com/typescript-eslint/typescript-eslint/commit/92908bdd9c102ff599da6a4791e8ad3e6d3dc593))
+* **eslint-plugin:** remove valid-typeof disable in eslint-recommended ([#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381)) ([b82df5e](https://github.com/typescript-eslint/typescript-eslint/commit/b82df5eaed437727566cde2b53410001505f1b13))
+* fix illegal decorator check ([#6723](https://github.com/typescript-eslint/typescript-eslint/issues/6723)) ([c456f8c](https://github.com/typescript-eslint/typescript-eslint/commit/c456f8cdef5a931c631bfbcfc84d8a25caaf019f))
+* rename typeParameters to typeArguments where needed ([#5384](https://github.com/typescript-eslint/typescript-eslint/issues/5384)) ([08d757b](https://github.com/typescript-eslint/typescript-eslint/commit/08d757b26b00d0accea010e61ec42b4f753f993e))
+* replace tsutils with ts-api-tools ([#6428](https://github.com/typescript-eslint/typescript-eslint/issues/6428)) ([79327b4](https://github.com/typescript-eslint/typescript-eslint/commit/79327b4999999cde3003901b40527af002c4906a))
+* **type-utils:** treat intrinsic types as if they are from lib and never match error types ([#6869](https://github.com/typescript-eslint/typescript-eslint/issues/6869)) ([ecb57de](https://github.com/typescript-eslint/typescript-eslint/commit/ecb57de5eb50511bed163f6e1b27e31b8577344e))
+* **typescript-estree:** account for namespace nesting in AST conversion ([#6272](https://github.com/typescript-eslint/typescript-eslint/issues/6272)) ([09e3877](https://github.com/typescript-eslint/typescript-eslint/commit/09e38776c63fea3328f71df36644ee11dd137cc1))
+* update `exports` field in package.json files ([#6550](https://github.com/typescript-eslint/typescript-eslint/issues/6550)) ([53776c2](https://github.com/typescript-eslint/typescript-eslint/commit/53776c244f8bbdc852d57c7b313b0935e755ddc4))
+
+
+### chore
+
+* drop support for node v14.17, v17 ([#5971](https://github.com/typescript-eslint/typescript-eslint/issues/5971)) ([cc62015](https://github.com/typescript-eslint/typescript-eslint/commit/cc62015b8ae5f207912ff8988e2a0b3fe9a79243))
+
+
+### Features
+
+* add new package `rule-tester` ([#6777](https://github.com/typescript-eslint/typescript-eslint/issues/6777)) ([2ce1c1d](https://github.com/typescript-eslint/typescript-eslint/commit/2ce1c1d22c799a1ca027674fcb9b3a7ab0107428))
+* add package.json exports for public packages ([#6458](https://github.com/typescript-eslint/typescript-eslint/issues/6458)) ([d676683](https://github.com/typescript-eslint/typescript-eslint/commit/d6766838a05259556029acaac57dc7839b68c592))
+* bump minimum supported TS version to 4.2.4 ([#5915](https://github.com/typescript-eslint/typescript-eslint/issues/5915)) ([a8e71d5](https://github.com/typescript-eslint/typescript-eslint/commit/a8e71d52169f32ab9e836ec96d980ba52deffe12))
+* bump ts-api-utils to v0.0.21 ([#6459](https://github.com/typescript-eslint/typescript-eslint/issues/6459)) ([3915661](https://github.com/typescript-eslint/typescript-eslint/commit/391566172dbc6013be79952fc68a588bf653fa8d))
+* bump ts-api-utils to v0.0.22 ([#6472](https://github.com/typescript-eslint/typescript-eslint/issues/6472)) ([b88cd23](https://github.com/typescript-eslint/typescript-eslint/commit/b88cd2332921efcca7ec5f4176f19779346d963b))
+* drop support for ESLint v6 ([#5972](https://github.com/typescript-eslint/typescript-eslint/issues/5972)) ([bda806d](https://github.com/typescript-eslint/typescript-eslint/commit/bda806d78ee46133587d9383baff52d796a594e5))
+* drop support for node v12 ([#5918](https://github.com/typescript-eslint/typescript-eslint/issues/5918)) ([7e3fe9a](https://github.com/typescript-eslint/typescript-eslint/commit/7e3fe9a67abd394b0a114f2deb466edf5c9759ac))
+* drop support for node v14 and test against node v20 ([#7022](https://github.com/typescript-eslint/typescript-eslint/issues/7022)) ([e6235bf](https://github.com/typescript-eslint/typescript-eslint/commit/e6235bf61b781066653581b57b7cd976c9c4f905))
+* **eslint-plugin:** [prefer-nullish-coalescing]: add support for assignment expressions ([#5234](https://github.com/typescript-eslint/typescript-eslint/issues/5234)) ([4bdbe67](https://github.com/typescript-eslint/typescript-eslint/commit/4bdbe67955fd591c25e58b13e674ba05bf5ed585))
+* **eslint-plugin:** [prefer-optional-chain] handle cases where the first operands are unrelated to the rest of the chain and add type info ([#6397](https://github.com/typescript-eslint/typescript-eslint/issues/6397)) ([02a37c4](https://github.com/typescript-eslint/typescript-eslint/commit/02a37c4c79d9b83998b7ee1376be43b06e12b3a0))
+* **eslint-plugin:** [prefer-readonly-parameter-types] added an optional type allowlist ([#4436](https://github.com/typescript-eslint/typescript-eslint/issues/4436)) ([c9427b7](https://github.com/typescript-eslint/typescript-eslint/commit/c9427b78b69f1a6a2453ef2df2be5bf96b7b00bc))
+* **eslint-plugin:** [restrict-plus-operands] change checkCompoundAssignments to skipCompoundAssignments ([#7027](https://github.com/typescript-eslint/typescript-eslint/issues/7027)) ([dc801d8](https://github.com/typescript-eslint/typescript-eslint/commit/dc801d892ecc1af678ff37166481f4b69186164c))
+* **eslint-plugin:** add config that disables type-aware linting ([#6470](https://github.com/typescript-eslint/typescript-eslint/issues/6470)) ([3b063cf](https://github.com/typescript-eslint/typescript-eslint/commit/3b063cfadce50985f8ec6d8f44f5b1cbd5c1ea57))
+* **eslint-plugin:** apply final v6 changes to configs ([#7110](https://github.com/typescript-eslint/typescript-eslint/issues/7110)) ([c13ce0b](https://github.com/typescript-eslint/typescript-eslint/commit/c13ce0b4f7a74a6d8fecf78d25ebd8181f7a9119))
+* **eslint-plugin:** deprecate no-type-alias ([#6229](https://github.com/typescript-eslint/typescript-eslint/issues/6229)) ([820bdf2](https://github.com/typescript-eslint/typescript-eslint/commit/820bdf2a3934d4186d51186693ced02df64a57ce))
+* **eslint-plugin:** final final config changes for v6 ([#7157](https://github.com/typescript-eslint/typescript-eslint/issues/7157)) ([e35c5c1](https://github.com/typescript-eslint/typescript-eslint/commit/e35c5c1c39f3d76b916ad1c1ac2c7bf05b379193))
+* **eslint-plugin:** rework configs: recommended, strict, stylistic; -type-checked ([#5251](https://github.com/typescript-eslint/typescript-eslint/issues/5251)) ([5346b5b](https://github.com/typescript-eslint/typescript-eslint/commit/5346b5bbdbba81439ba761c282ba9cdcec7b45c8)), closes [#5036](https://github.com/typescript-eslint/typescript-eslint/issues/5036) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5889](https://github.com/typescript-eslint/typescript-eslint/issues/5889) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5883](https://github.com/typescript-eslint/typescript-eslint/issues/5883) [#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863) [#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381) [#5256](https://github.com/typescript-eslint/typescript-eslint/issues/5256) [#5399](https://github.com/typescript-eslint/typescript-eslint/issues/5399)
+* fork json schema types for better compat with ESLint rule validation ([#6963](https://github.com/typescript-eslint/typescript-eslint/issues/6963)) ([a4967f2](https://github.com/typescript-eslint/typescript-eslint/commit/a4967f2e8cc7b0432d8dfe804772e60042c5384c))
+* improve rule schemas, add test to validate schemas, add tooling to generate schema types ([#6899](https://github.com/typescript-eslint/typescript-eslint/issues/6899)) ([acc1a43](https://github.com/typescript-eslint/typescript-eslint/commit/acc1a43e02a403ff74a54c28c2c495f00d0be038))
+* made BaseNode.parent non-optional ([#5252](https://github.com/typescript-eslint/typescript-eslint/issues/5252)) ([a4768f3](https://github.com/typescript-eslint/typescript-eslint/commit/a4768f38ef4943873c1e9443e8cd101a663ac3c0)), closes [#5036](https://github.com/typescript-eslint/typescript-eslint/issues/5036) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#3076](https://github.com/typescript-eslint/typescript-eslint/issues/3076) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5889](https://github.com/typescript-eslint/typescript-eslint/issues/5889) [#5834](https://github.com/typescript-eslint/typescript-eslint/issues/5834) [#5882](https://github.com/typescript-eslint/typescript-eslint/issues/5882) [#5864](https://github.com/typescript-eslint/typescript-eslint/issues/5864) [#5883](https://github.com/typescript-eslint/typescript-eslint/issues/5883) [#4863](https://github.com/typescript-eslint/typescript-eslint/issues/4863) [#5381](https://github.com/typescript-eslint/typescript-eslint/issues/5381) [#5256](https://github.com/typescript-eslint/typescript-eslint/issues/5256) [#5399](https://github.com/typescript-eslint/typescript-eslint/issues/5399)
+* remove `RuleTester` in `/utils` in favour of the new `/rule-tester` package ([#6816](https://github.com/typescript-eslint/typescript-eslint/issues/6816)) ([c33f497](https://github.com/typescript-eslint/typescript-eslint/commit/c33f497ad8aec7c123c7374f7aff3e24025fe861))
+* remove partial type-information program ([#6066](https://github.com/typescript-eslint/typescript-eslint/issues/6066)) ([7fc062a](https://github.com/typescript-eslint/typescript-eslint/commit/7fc062abc30a73093cd943c2cb808ae373fe12d9))
+* **typescript-estree:** add type checker wrapper APIs to ParserServicesWithTypeInformation ([#6404](https://github.com/typescript-eslint/typescript-eslint/issues/6404)) ([62d5755](https://github.com/typescript-eslint/typescript-eslint/commit/62d57559564fb08512eafe03a2c1b167c4377601))
+* **typescript-estree:** added allowInvalidAST option to not throw on invalid tokens ([#6247](https://github.com/typescript-eslint/typescript-eslint/issues/6247)) ([a3b177d](https://github.com/typescript-eslint/typescript-eslint/commit/a3b177d59adaf8ea76b205befc8b12d86447f1fb))
+* **typescript-estree:** check for illegal decorators on function declarations ([#6590](https://github.com/typescript-eslint/typescript-eslint/issues/6590)) ([1b39cfd](https://github.com/typescript-eslint/typescript-eslint/commit/1b39cfd307955deb8e407cf8dd3a6ca1ed1b8df6))
+* **typescript-estree:** check modifiers on every node ([#6615](https://github.com/typescript-eslint/typescript-eslint/issues/6615)) ([62d6230](https://github.com/typescript-eslint/typescript-eslint/commit/62d62304e16b553274a80d8ab2653543a22f2391))
+* **typescript-estree:** remove optionality from AST boolean properties ([#6274](https://github.com/typescript-eslint/typescript-eslint/issues/6274)) ([df131e2](https://github.com/typescript-eslint/typescript-eslint/commit/df131e258c93e5714c88c0373cfeb2e1e75afc75))
+* **typescript-estree:** throw errors for object methods without function bodies ([#6589](https://github.com/typescript-eslint/typescript-eslint/issues/6589)) ([1d78576](https://github.com/typescript-eslint/typescript-eslint/commit/1d78576d41323e35c2d2a2ecc92f6ee76ed61d57))
+* **typescript-estree:** throw errors when abstract property has initializer ([#6613](https://github.com/typescript-eslint/typescript-eslint/issues/6613)) ([dcdbc76](https://github.com/typescript-eslint/typescript-eslint/commit/dcdbc76d5418a383968d15e32d2eba7a9d2d7e79))
+
+
+### BREAKING CHANGES
+
+* **eslint-plugin:** Adds an additional class of checks to the rule
+* drop support for ESLint v6
+* drops support for node v17
+* Bumps the minimum supported range and removes handling for old versions
+* drops support for node v12
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+
+
+
+
# [5.62.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.61.0...v5.62.0) (2023-07-10)
diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md
index 9c98f8c7d4b6..3f894c883444 100644
--- a/packages/eslint-plugin/README.md
+++ b/packages/eslint-plugin/README.md
@@ -8,3 +8,5 @@ An ESLint plugin which provides lint rules for TypeScript codebases.
👉 See **https://typescript-eslint.io/getting-started** for our Getting Started docs.
> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code.
+
+
diff --git a/packages/eslint-plugin/docs/rules/comma-dangle.md b/packages/eslint-plugin/docs/rules/comma-dangle.md
index 1f11f9cf3acf..d25ec9e0ccbc 100644
--- a/packages/eslint-plugin/docs/rules/comma-dangle.md
+++ b/packages/eslint-plugin/docs/rules/comma-dangle.md
@@ -13,7 +13,7 @@ It adds support for TypeScript syntax.
See the [ESLint documentation](https://eslint.org/docs/rules/comma-dangle) for more details on the `comma-dangle` rule.
-## How to Use
+## Options
In addition to the options supported by the `comma-dangle` rule in ESLint core, the rule adds the following options:
diff --git a/packages/eslint-plugin/docs/rules/lines-around-comment.md b/packages/eslint-plugin/docs/rules/lines-around-comment.md
index 68d912ec0d1e..a3fbb5579d0e 100644
--- a/packages/eslint-plugin/docs/rules/lines-around-comment.md
+++ b/packages/eslint-plugin/docs/rules/lines-around-comment.md
@@ -11,17 +11,7 @@ description: 'Require empty lines around comments.'
This rule extends the base [`eslint/lines-around-comment`](https://eslint.org/docs/rules/lines-around-comment) rule.
It adds support for TypeScript syntax.
-See the [ESLint documentation](https://eslint.org/docs/rules/lines-around-comment) for more details on the `comma-dangle` rule.
-
-## Rule Changes
-
-```jsonc
-{
- // note you must disable the base rule as it can report incorrect errors
- "lines-around-comment": "off",
- "@typescript-eslint/lines-around-comment": ["error"]
-}
-```
+See the [ESLint documentation](https://eslint.org/docs/rules/lines-around-comment) for more details on the `lines-around-comment` rule.
## Options
diff --git a/packages/eslint-plugin/docs/rules/no-base-to-string.md b/packages/eslint-plugin/docs/rules/no-base-to-string.md
index 7409f5e134e2..a5493c7e50f3 100644
--- a/packages/eslint-plugin/docs/rules/no-base-to-string.md
+++ b/packages/eslint-plugin/docs/rules/no-base-to-string.md
@@ -29,7 +29,7 @@ value + '';
// Interpolation and manual .toString() calls too:
`Value: ${value}`;
-({}.toString());
+({}).toString();
```
### ✅ Correct
diff --git a/packages/eslint-plugin/docs/rules/no-duplicate-imports.md b/packages/eslint-plugin/docs/rules/no-duplicate-imports.md
index 5f523a7b0f4c..9bf40498092f 100644
--- a/packages/eslint-plugin/docs/rules/no-duplicate-imports.md
+++ b/packages/eslint-plugin/docs/rules/no-duplicate-imports.md
@@ -1,12 +1,10 @@
----
-description: 'Disallow duplicate imports.'
----
-
-> 🛑 This file is source code, not the primary documentation location! 🛑
->
-> See **https://typescript-eslint.io/rules/no-duplicate-imports** for documentation.
-
:::danger Deprecated
This rule has been deprecated in favour of the [`import/no-duplicates`](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-duplicates.md) rule.
+
:::
+
+
diff --git a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md
deleted file mode 100644
index ea75c9818902..000000000000
--- a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md
+++ /dev/null
@@ -1,73 +0,0 @@
----
-description: 'Disallow usage of the implicit `any` type in catch clauses.'
----
-
-> 🛑 This file is source code, not the primary documentation location! 🛑
->
-> See **https://typescript-eslint.io/rules/no-implicit-any-catch** for documentation.
-
-:::danger Deprecated
-
-This rule has been deprecated as TypeScript versions >=4 includes a `useUnknownInCatchVariables` compiler option with the same check.
-:::
-
-TypeScript 4.0 added support for adding an explicit `any` or `unknown` type annotation on a catch clause variable.
-
-By default, TypeScript will type a catch clause variable as `any`, so explicitly annotating it as `unknown` can add a lot of safety to your codebase.
-
-The `noImplicitAny` flag in TypeScript does not cover this for backwards compatibility reasons, however you can use `useUnknownInCatchVariables` (part of `strict`) instead of this rule.
-
-## DEPRECATED
-
-## Examples
-
-This rule requires an explicit type to be declared on a catch clause variable.
-
-
-
-### ❌ Incorrect
-
-```ts
-try {
- // ...
-} catch (e) {
- // ...
-}
-```
-
-### ✅ Correct
-
-
-
-
-```ts
-try {
- // ...
-} catch (e: unknown) {
- // ...
-}
-```
-
-
-
-## Options
-
-### `allowExplicitAny`
-
-The follow is is **_not_** considered a warning with `{ allowExplicitAny: true }`
-
-```ts
-try {
- // ...
-} catch (e: any) {
- // ...
-}
-```
-
-## When Not To Use It
-
-If you are not using TypeScript 4.0 (or greater), then you will not be able to use this rule, annotations on catch clauses is not supported.
-
-## Further Reading
-
-- [TypeScript 4.0 Release Notes](https://devblogs.microsoft.com/typescript/announcing-typescript-4-0/#unknown-on-catch)
diff --git a/packages/eslint-plugin/docs/rules/no-parameter-properties.md b/packages/eslint-plugin/docs/rules/no-parameter-properties.md
deleted file mode 100644
index 16a91864d590..000000000000
--- a/packages/eslint-plugin/docs/rules/no-parameter-properties.md
+++ /dev/null
@@ -1,406 +0,0 @@
----
-description: 'Disallow the use of parameter properties in class constructors.'
----
-
-> 🛑 This file is source code, not the primary documentation location! 🛑
->
-> See **https://typescript-eslint.io/rules/no-parameter-properties** for documentation.
-
-:::danger Deprecated
-
-This rule has been deprecated in favour of the equivalent, better named [`parameter-properties`](./parameter-properties.md) rule.
-:::
-
-Parameter properties can be confusing to those new to TypeScript as they are less explicit than other ways
-of declaring and initializing class members.
-
-## Examples
-
-This rule disallows the use of parameter properties in constructors, forcing the user to explicitly
-declare all properties in the class.
-
-## Options
-
-This rule, in its default state, does not require any argument and would completely disallow the use of parameter properties.
-If you would like to allow certain types of parameter properties then you may pass an object with the following options:
-
-- `allows`, an array containing one or more of the allowed modifiers. Valid values are:
- - `readonly`, allows **readonly** parameter properties.
- - `private`, allows **private** parameter properties.
- - `protected`, allows **protected** parameter properties.
- - `public`, allows **public** parameter properties.
- - `private readonly`, allows **private readonly** parameter properties.
- - `protected readonly`, allows **protected readonly** parameter properties.
- - `public readonly`, allows **public readonly** parameter properties.
-
-### default
-
-Examples of code for this rule with no options at all:
-
-
-
-#### ❌ Incorrect
-
-```ts
-class Foo {
- constructor(readonly name: string) {}
-}
-
-class Foo {
- constructor(private name: string) {}
-}
-
-class Foo {
- constructor(protected name: string) {}
-}
-
-class Foo {
- constructor(public name: string) {}
-}
-
-class Foo {
- constructor(private readonly name: string) {}
-}
-
-class Foo {
- constructor(protected readonly name: string) {}
-}
-
-class Foo {
- constructor(public readonly name: string) {}
-}
-```
-
-#### ✅ Correct
-
-```ts
-class Foo {
- constructor(name: string) {}
-}
-```
-
-### readonly
-
-Examples of code for the `{ "allows": ["readonly"] }` options:
-
-
-
-#### ❌ Incorrect
-
-```ts
-class Foo {
- constructor(private name: string) {}
-}
-
-class Foo {
- constructor(protected name: string) {}
-}
-
-class Foo {
- constructor(public name: string) {}
-}
-
-class Foo {
- constructor(private readonly name: string) {}
-}
-
-class Foo {
- constructor(protected readonly name: string) {}
-}
-
-class Foo {
- constructor(public readonly name: string) {}
-}
-```
-
-#### ✅ Correct
-
-```ts
-class Foo {
- constructor(name: string) {}
-}
-
-class Foo {
- constructor(readonly name: string) {}
-}
-```
-
-### private
-
-Examples of code for the `{ "allows": ["private"] }` options:
-
-
-
-#### ❌ Incorrect
-
-```ts
-class Foo {
- constructor(readonly name: string) {}
-}
-
-class Foo {
- constructor(protected name: string) {}
-}
-
-class Foo {
- constructor(public name: string) {}
-}
-
-class Foo {
- constructor(private readonly name: string) {}
-}
-
-class Foo {
- constructor(protected readonly name: string) {}
-}
-
-class Foo {
- constructor(public readonly name: string) {}
-}
-```
-
-#### ✅ Correct
-
-```ts
-class Foo {
- constructor(name: string) {}
-}
-
-class Foo {
- constructor(private name: string) {}
-}
-```
-
-### protected
-
-Examples of code for the `{ "allows": ["protected"] }` options:
-
-
-
-#### ❌ Incorrect
-
-```ts
-class Foo {
- constructor(readonly name: string) {}
-}
-
-class Foo {
- constructor(private name: string) {}
-}
-
-class Foo {
- constructor(public name: string) {}
-}
-
-class Foo {
- constructor(private readonly name: string) {}
-}
-
-class Foo {
- constructor(protected readonly name: string) {}
-}
-
-class Foo {
- constructor(public readonly name: string) {}
-}
-```
-
-#### ✅ Correct
-
-```ts
-class Foo {
- constructor(name: string) {}
-}
-
-class Foo {
- constructor(protected name: string) {}
-}
-```
-
-### public
-
-Examples of code for the `{ "allows": ["public"] }` options:
-
-
-
-#### ❌ Incorrect
-
-```ts
-class Foo {
- constructor(readonly name: string) {}
-}
-
-class Foo {
- constructor(private name: string) {}
-}
-
-class Foo {
- constructor(protected name: string) {}
-}
-
-class Foo {
- constructor(private readonly name: string) {}
-}
-
-class Foo {
- constructor(protected readonly name: string) {}
-}
-
-class Foo {
- constructor(public readonly name: string) {}
-}
-```
-
-#### ✅ Correct
-
-```ts
-class Foo {
- constructor(name: string) {}
-}
-
-class Foo {
- constructor(public name: string) {}
-}
-```
-
-### private readonly
-
-Examples of code for the `{ "allows": ["private readonly"] }` options:
-
-
-
-#### ❌ Incorrect
-
-```ts
-class Foo {
- constructor(readonly name: string) {}
-}
-
-class Foo {
- constructor(private name: string) {}
-}
-
-class Foo {
- constructor(protected name: string) {}
-}
-
-class Foo {
- constructor(public name: string) {}
-}
-
-class Foo {
- constructor(protected readonly name: string) {}
-}
-
-class Foo {
- constructor(public readonly name: string) {}
-}
-```
-
-#### ✅ Correct
-
-```ts
-class Foo {
- constructor(name: string) {}
-}
-
-class Foo {
- constructor(private readonly name: string) {}
-}
-```
-
-### protected readonly
-
-Examples of code for the `{ "allows": ["protected readonly"] }` options:
-
-
-
-#### ❌ Incorrect
-
-```ts
-class Foo {
- constructor(readonly name: string) {}
-}
-
-class Foo {
- constructor(private name: string) {}
-}
-
-class Foo {
- constructor(protected name: string) {}
-}
-
-class Foo {
- constructor(public name: string) {}
-}
-
-class Foo {
- constructor(private readonly name: string) {}
-}
-
-class Foo {
- constructor(public readonly name: string) {}
-}
-```
-
-#### ✅ Correct
-
-```ts
-class Foo {
- constructor(name: string) {}
-}
-
-class Foo {
- constructor(protected readonly name: string) {}
-}
-```
-
-### public readonly
-
-Examples of code for the `{ "allows": ["public readonly"] }` options:
-
-
-
-#### ❌ Incorrect
-
-```ts
-class Foo {
- constructor(readonly name: string) {}
-}
-
-class Foo {
- constructor(private name: string) {}
-}
-
-class Foo {
- constructor(protected name: string) {}
-}
-
-class Foo {
- constructor(public name: string) {}
-}
-
-class Foo {
- constructor(private readonly name: string) {}
-}
-
-class Foo {
- constructor(protected readonly name: string) {}
-}
-```
-
-#### ✅ Correct
-
-```ts
-class Foo {
- constructor(name: string) {}
-}
-
-class Foo {
- constructor(public readonly name: string) {}
-}
-```
-
-## When Not To Use It
-
-If you don't care about the using parameter properties in constructors, then you will not need this rule.
diff --git a/packages/eslint-plugin/docs/rules/no-type-alias.md b/packages/eslint-plugin/docs/rules/no-type-alias.md
index a9774ebdde1a..78bdf64c009d 100644
--- a/packages/eslint-plugin/docs/rules/no-type-alias.md
+++ b/packages/eslint-plugin/docs/rules/no-type-alias.md
@@ -6,6 +6,20 @@ description: 'Disallow type aliases.'
>
> See **https://typescript-eslint.io/rules/no-type-alias** for documentation.
+:::danger Deprecated
+
+This rule has been deprecated in favour of the [`@typescript-eslint/consistent-type-definitions`](./consistent-type-definitions.md) rule.
+TypeScript type aliases are a commonly necessary language feature; banning it altogether is oftentimes counterproductive.
+
+:::
+
+:::note
+
+If you want to ban certain classifications of type aliases, consider using [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax).
+See [Troubleshooting & FAQs](/linting/troubleshooting#how-can-i-ban-specific-language-feature).
+
+:::
+
In TypeScript, type aliases serve three purposes:
- Aliasing other types so that we can refer to them using a simpler name.
diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md b/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md
index 6931d46d1b36..f57058260739 100644
--- a/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md
+++ b/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md
@@ -22,6 +22,8 @@ fruit === 999; // No error
This rule flags when an enum typed value is compared to a non-enum `number`.
+## Examples
+
### ❌ Incorrect
@@ -70,6 +72,6 @@ vegetable === Vegetable.Asparagus;
-## When Not to Use It
+## When Not To Use It
If you don't mind number and/or literal string constants being compared against enums, you likely don't need this rule.
diff --git a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
index 146e96a19fa3..451f7dff1d45 100644
--- a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
+++ b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
@@ -1,5 +1,5 @@
---
-description: 'Enforce using the nullish coalescing operator instead of logical chaining.'
+description: 'Enforce using the nullish coalescing operator instead of logical assignments or chaining.'
---
> 🛑 This file is source code, not the primary documentation location! 🛑
@@ -9,7 +9,10 @@ description: 'Enforce using the nullish coalescing operator instead of logical c
The `??` nullish coalescing runtime operator allows providing a default value when dealing with `null` or `undefined`.
Because the nullish coalescing operator _only_ coalesces when the original value is `null` or `undefined`, it is much safer than relying upon logical OR operator chaining `||`, which coalesces on any _falsy_ value.
-This rule reports when an `||` operator can be safely replaced with a `??`.
+This rule reports when you can safely replace:
+
+- An `||` operator with `??`
+- An `||=` operator with `??=`
:::caution
This rule will not work as expected if [`strictNullChecks`](https://www.typescriptlang.org/tsconfig#strictNullChecks) is not enabled.
@@ -73,7 +76,10 @@ declare const b: string | null;
if (a || b) {
}
+if ((a ||= b)) {
+}
while (a || b) {}
+while ((a ||= b)) {}
do {} while (a || b);
for (let i = 0; a || b; i += 1) {}
a || b ? true : false;
@@ -87,7 +93,10 @@ declare const b: string | null;
if (a ?? b) {
}
+if ((a ??= b)) {
+}
while (a ?? b) {}
+while ((a ??= b)) {}
do {} while (a ?? b);
for (let i = 0; a ?? b; i += 1) {}
a ?? b ? true : false;
@@ -110,6 +119,7 @@ declare const c: string | null;
declare const d: string | null;
a || (b && c);
+a ||= b && c;
(a && b) || c || d;
a || (b && c) || d;
a || (b && c && d);
@@ -124,6 +134,7 @@ declare const c: string | null;
declare const d: string | null;
a ?? (b && c);
+a ??= b && c;
(a && b) ?? c ?? d;
a ?? (b && c) ?? d;
a ?? (b && c && d);
diff --git a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md
index 4a9ada8b08ff..6efb88b17ae5 100644
--- a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md
+++ b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md
@@ -57,13 +57,204 @@ foo?.a?.b?.c?.d?.e;
-:::note
-There are a few edge cases where this rule will false positive. Use your best judgement when evaluating reported errors.
-:::
+## Options
+
+In the context of the descriptions below a "loose boolean" operand is any operand that implicitly coerces the value to a boolean.
+Specifically the argument of the not operator (`!loose`) or a bare value in a logical expression (`loose && looser`).
+
+### `allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing`
+
+When this option is `true`, the rule will not provide an auto-fixer for cases where the return type of the expression would change. For example for the expression `!foo || foo.bar` the return type of the expression is `true | T`, however for the equivalent optional chain `foo?.bar` the return type of the expression is `undefined | T`. Thus changing the code from a logical expression to an optional chain expression has altered the type of the expression.
+
+In some cases this distinction _may_ matter - which is why these fixers are considered unsafe - they may break the build! For example in the following code:
+
+```ts
+declare const foo: { bar: boolean } | null | undefined;
+declare function acceptsBoolean(arg: boolean): void;
+
+// ✅ typechecks succesfully as the expression only returns `boolean`
+acceptsBoolean(foo != null && foo.bar);
+
+// ❌ typechecks UNSUCCESSFULLY as the expression returns `boolean | undefined`
+acceptsBoolean(foo != null && foo.bar);
+```
+
+This style of code isn't super common - which means having this option set to `true` _should_ be safe in most codebases. However we default it to `false` due to its unsafe nature. We have provided this option for convenience because it increases the autofix cases covered by the rule. If you set option to `true` the onus is entirely on you and your team to ensure that each fix is correct and safe and that it does not break the build.
+
+When this option is `false` unsafe cases will have suggestion fixers provided instead of auto-fixers - meaning you can manually apply the fix using your IDE tooling.
+
+### `checkAny`
+
+When this option is `true` the rule will check operands that are typed as `any` when inspecting "loose boolean" operands.
+
+
+
+#### ❌ Incorrect for `checkAny: true`
+
+```ts
+declare const thing: any;
+
+thing && thing.toString();
+```
+
+#### ✅ Correct for `checkAny: false`
+
+```ts
+declare const thing: any;
+
+thing && thing.toString();
+```
+
+
+
+### `checkUnknown`
+
+When this option is `true` the rule will check operands that are typed as `unknown` when inspecting "loose boolean" operands.
+
+
+
+#### ❌ Incorrect for `checkUnknown: true`
+
+```ts
+declare const thing: unknown;
+
+thing && thing.toString();
+```
+
+#### ✅ Correct for `checkUnknown: false`
+
+```ts
+declare const thing: unknown;
+
+thing && thing.toString();
+```
+
+
+
+### `checkString`
+
+When this option is `true` the rule will check operands that are typed as `string` when inspecting "loose boolean" operands.
+
+
+
+#### ❌ Incorrect for `checkString: true`
+
+```ts
+declare const thing: string;
+
+thing && thing.toString();
+```
+
+#### ✅ Correct for `checkString: false`
+
+```ts
+declare const thing: string;
+
+thing && thing.toString();
+```
+
+
+
+### `checkNumber`
+
+When this option is `true` the rule will check operands that are typed as `number` when inspecting "loose boolean" operands.
+
+
+
+#### ❌ Incorrect for `checkNumber: true`
+
+```ts
+declare const thing: number;
+
+thing && thing.toString();
+```
+
+#### ✅ Correct for `checkNumber: false`
+
+```ts
+declare const thing: number;
+
+thing && thing.toString();
+```
+
+
+
+### `checkBoolean`
+
+When this option is `true` the rule will check operands that are typed as `boolean` when inspecting "loose boolean" operands.
+
+
+
+#### ❌ Incorrect for `checkBoolean: true`
+
+```ts
+declare const thing: boolean;
+
+thing && thing.toString();
+```
+
+#### ✅ Correct for `checkBoolean: false`
+
+```ts
+declare const thing: boolean;
+
+thing && thing.toString();
+```
+
+
+
+### `checkBigInt`
+
+When this option is `true` the rule will check operands that are typed as `bigint` when inspecting "loose boolean" operands.
+
+
+
+#### ❌ Incorrect for `checkBigInt: true`
+
+```ts
+declare const thing: bigint;
+
+thing && thing.toString();
+```
+
+#### ✅ Correct for `checkBigInt: false`
+
+```ts
+declare const thing: bigint;
+
+thing && thing.toString();
+```
+
+
+
+### `requireNullish`
+
+When this option is `true` the rule will skip operands that are not typed with `null` and/or `undefined` when inspecting "loose boolean" operands.
+
+
+
+#### ❌ Incorrect for `requireNullish: true`
+
+```ts
+declare const thing1: string | null;
+thing1 && thing1.toString();
+```
+
+#### ✅ Correct for `requireNullish: true`
+
+```ts
+declare const thing1: string | null;
+thing1?.toString();
+
+declare const thing2: string;
+thing2 && thing2.toString();
+```
+
+
## When Not To Use It
-If you don't mind using more explicit `&&`s, you don't need this rule.
+If you don't mind using more explicit `&&`s/`||`s, you don't need this rule.
## Further Reading
diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md b/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md
index b1e912abe379..703b16fa3f00 100644
--- a/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md
+++ b/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md
@@ -129,6 +129,101 @@ interface Foo {
## Options
+### `allow`
+
+Some complex types cannot easily be made readonly, for example the `HTMLElement` type or the `JQueryStatic` type from `@types/jquery`. This option allows you to globally disable reporting of such types.
+
+Each item must be one of:
+
+- A type defined in a file (`{from: "file", name: "Foo", path: "src/foo-file.ts"}` with `path` being an optional path relative to the project root directory)
+- A type from the default library (`{from: "lib", name: "Foo"}`)
+- A type from a package (`{from: "package", name: "Foo", package: "foo-lib"}`, this also works for types defined in a typings package).
+
+Additionally, a type may be defined just as a simple string, which then matches the type independently of its origin.
+
+Examples of code for this rule with:
+
+```json
+{
+ "allow": [
+ "$",
+ { "source": "file", "name": "Foo" },
+ { "source": "lib", "name": "HTMLElement" },
+ { "from": "package", "name": "Bar", "package": "bar-lib" }
+ ]
+}
+```
+
+
+
+#### ❌ Incorrect
+
+```ts
+interface ThisIsMutable {
+ prop: string;
+}
+
+interface Wrapper {
+ sub: ThisIsMutable;
+}
+
+interface WrapperWithOther {
+ readonly sub: Foo;
+ otherProp: string;
+}
+
+function fn1(arg: ThisIsMutable) {} // Incorrect because ThisIsMutable is not readonly
+function fn2(arg: Wrapper) {} // Incorrect because Wrapper.sub is not readonly
+function fn3(arg: WrapperWithOther) {} // Incorrect because WrapperWithOther.otherProp is not readonly and not in the allowlist
+```
+
+```ts
+import { Foo } from 'some-lib';
+import { Bar } from 'incorrect-lib';
+
+interface HTMLElement {
+ prop: string;
+}
+
+function fn1(arg: Foo) {} // Incorrect because Foo is not a local type
+function fn2(arg: HTMLElement) {} // Incorrect because HTMLElement is not from the default library
+function fn3(arg: Bar) {} // Incorrect because Bar is not from "bar-lib"
+```
+
+#### ✅ Correct
+
+```ts
+interface Foo {
+ prop: string;
+}
+
+interface Wrapper {
+ readonly sub: Foo;
+ readonly otherProp: string;
+}
+
+function fn1(arg: Foo) {} // Works because Foo is allowed
+function fn2(arg: Wrapper) {} // Works even when Foo is nested somewhere in the type, with other properties still being checked
+```
+
+```ts
+import { Bar } from 'bar-lib';
+
+interface Foo {
+ prop: string;
+}
+
+function fn1(arg: Foo) {} // Works because Foo is a local type
+function fn2(arg: HTMLElement) {} // Works because HTMLElement is from the default library
+function fn3(arg: Bar) {} // Works because Bar is from "bar-lib"
+```
+
+```ts
+import { Foo } from './foo';
+
+function fn(arg: Foo) {} // Works because Foo is still a local type - it has to be in the same package
+```
+
### `checkParameterProperties`
This option allows you to enable or disable the checking of parameter properties.
diff --git a/packages/eslint-plugin/docs/rules/require-await.md b/packages/eslint-plugin/docs/rules/require-await.md
index f4ccd6fc21a8..dcc86305d254 100644
--- a/packages/eslint-plugin/docs/rules/require-await.md
+++ b/packages/eslint-plugin/docs/rules/require-await.md
@@ -20,5 +20,3 @@ async function returnsPromise1() {
const returnsPromise2 = () => returnsPromise1();
```
-
-## How to Use
diff --git a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md
index 7abf7dc38c37..9428ea115248 100644
--- a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md
+++ b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md
@@ -168,9 +168,9 @@ let fn = (a: number, b: RegExp) => a + b;
let fn = (a: string, b: RegExp) => a + b;
```
-### `checkCompoundAssignments`
+### `skipCompoundAssignments`
-Examples of code for this rule with `{ checkCompoundAssignments: true }`:
+Examples of code for this rule with `{ skipCompoundAssignments: true }`:
diff --git a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md
deleted file mode 100644
index edaa195df6b3..000000000000
--- a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md
+++ /dev/null
@@ -1,106 +0,0 @@
----
-description: 'Enforce members of a type union/intersection to be sorted alphabetically.'
----
-
-> 🛑 This file is source code, not the primary documentation location! 🛑
->
-> See **https://typescript-eslint.io/rules/sort-type-union-intersection-members** for documentation.
-
-:::danger Deprecated
-
-This rule has been renamed to [`sort-type-constituents`](./sort-type-constituents.md).
-:::
-
-Sorting union (`|`) and intersection (`&`) types can help:
-
-- keep your codebase standardized
-- find repeated types
-- reduce diff churn
-
-This rule reports on any types that aren't sorted alphabetically.
-
-> Types are sorted case-insensitively and treating numbers like a human would, falling back to character code sorting in case of ties.
-
-## Examples
-
-
-
-### ❌ Incorrect
-
-```ts
-type T1 = B | A;
-
-type T2 = { b: string } & { a: string };
-
-type T3 = [1, 2, 4] & [1, 2, 3];
-
-type T4 =
- | [1, 2, 4]
- | [1, 2, 3]
- | { b: string }
- | { a: string }
- | (() => void)
- | (() => string)
- | 'b'
- | 'a'
- | 'b'
- | 'a'
- | readonly string[]
- | readonly number[]
- | string[]
- | number[]
- | B
- | A
- | string
- | any;
-```
-
-### ✅ Correct
-
-```ts
-type T1 = A | B;
-
-type T2 = { a: string } & { b: string };
-
-type T3 = [1, 2, 3] & [1, 2, 4];
-
-type T4 =
- | any
- | string
- | A
- | B
- | number[]
- | string[]
- | readonly number[]
- | readonly string[]
- | 'a'
- | 'b'
- | 'a'
- | 'b'
- | (() => string)
- | (() => void)
- | { a: string }
- | { b: string }
- | [1, 2, 3]
- | [1, 2, 4];
-```
-
-## Options
-
-### `groupOrder`
-
-Each member of the type is placed into a group, and then the rule sorts alphabetically within each group.
-The ordering of groups is determined by this option.
-
-- `conditional` - Conditional types (`A extends B ? C : D`)
-- `function` - Function and constructor types (`() => void`, `new () => type`)
-- `import` - Import types (`import('path')`)
-- `intersection` - Intersection types (`A & B`)
-- `keyword` - Keyword types (`any`, `string`, etc)
-- `literal` - Literal types (`1`, `'b'`, `true`, etc)
-- `named` - Named types (`A`, `A['prop']`, `B[]`, `Array`)
-- `object` - Object types (`{ a: string }`, `{ [key: string]: number }`)
-- `operator` - Operator types (`keyof A`, `typeof B`, `readonly C[]`)
-- `tuple` - Tuple types (`[A, B, C]`)
-- `union` - Union types (`A | B`)
-- `nullish` - `null` and `undefined`
diff --git a/packages/eslint-plugin/docs/rules/triple-slash-reference.md b/packages/eslint-plugin/docs/rules/triple-slash-reference.md
index f48f7c98497b..af8fa6da5296 100644
--- a/packages/eslint-plugin/docs/rules/triple-slash-reference.md
+++ b/packages/eslint-plugin/docs/rules/triple-slash-reference.md
@@ -10,8 +10,6 @@ TypeScript's `///` triple-slash references are a way to indicate that types from
Use of triple-slash reference type directives is generally discouraged in favor of ECMAScript Module `import`s.
This rule reports on the use of `/// `, `/// `, or `/// ` directives.
-## Examples
-
## Options
With `{ "path": "never", "types": "never", "lib": "never" }` options set, the following will all be **incorrect** usage:
diff --git a/packages/eslint-plugin/docs/rules/type-annotation-spacing.md b/packages/eslint-plugin/docs/rules/type-annotation-spacing.md
index 36cfab06592f..090ddf5f9b97 100644
--- a/packages/eslint-plugin/docs/rules/type-annotation-spacing.md
+++ b/packages/eslint-plugin/docs/rules/type-annotation-spacing.md
@@ -39,10 +39,6 @@ type Foo = (string: name) =>string;
This rule aims to enforce specific spacing patterns around type annotations and function types in type literals.
-## Options
-
-Examples of code for this rule with no options at all:
-
### ❌ Incorrect
@@ -89,9 +85,13 @@ class Foo {
type Foo = () => {};
```
+## Options
+
### after
-Examples of code for this rule with `{ "before": false, "after": true }`:
+```json
+{ "before": false, "after": true }
+```
@@ -141,7 +141,9 @@ type Foo = ()=> {};
### before
-Examples of code for this rule with `{ "before": true, "after": true }` options:
+```json
+{ "before": true, "after": true }
+```
@@ -191,7 +193,13 @@ type Foo = () => {};
### overrides - colon
-Examples of code for this rule with `{ "before": false, "after": false, overrides: { colon: { before: true, after: true }} }` options:
+```json
+{
+ "before": false,
+ "after": false,
+ "overrides": { "colon": { "before": true, "after": true } }
+}
+```
@@ -245,7 +253,13 @@ type Foo = ()=>{};
### overrides - arrow
-Examples of code for this rule with `{ "before": false, "after": false, overrides: { arrow: { before: true, after: true }} }` options:
+```json
+{
+ "before": false,
+ "after": false,
+ "overrides": { "arrow": { "before": true, "after": true } }
+}
+```
diff --git a/packages/eslint-plugin/docs/rules/unified-signatures.md b/packages/eslint-plugin/docs/rules/unified-signatures.md
index 609eb3a7bb53..3ef37a6391a1 100644
--- a/packages/eslint-plugin/docs/rules/unified-signatures.md
+++ b/packages/eslint-plugin/docs/rules/unified-signatures.md
@@ -66,5 +66,3 @@ function f(a: string): void;
function f(a: number): void;
function f(b: string): void;
```
-
-## Options
diff --git a/packages/eslint-plugin/index.d.ts b/packages/eslint-plugin/index.d.ts
index 53a17f6fc333..7b4715f81f74 100644
--- a/packages/eslint-plugin/index.d.ts
+++ b/packages/eslint-plugin/index.d.ts
@@ -1,4 +1,9 @@
import type { TSESLint } from '@typescript-eslint/utils';
-export const rules: Record>;
-export const configs: Record;
+import type rules from './rules';
+
+declare const cjsExport: {
+ configs: Record;
+ rules: typeof rules;
+};
+export = cjsExport;
diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json
index 615dde088802..e55fb5258eab 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -1,16 +1,7 @@
{
"name": "@typescript-eslint/eslint-plugin",
- "version": "5.62.0",
+ "version": "6.0.0",
"description": "TypeScript plugin for ESLint",
- "keywords": [
- "eslint",
- "eslintplugin",
- "eslint-plugin",
- "typescript"
- ],
- "engines": {
- "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
- },
"files": [
"dist",
"docs",
@@ -19,6 +10,21 @@
"README.md",
"LICENSE"
],
+ "type": "commonjs",
+ "exports": {
+ ".": {
+ "types": "./index.d.ts",
+ "default": "./dist/index.js"
+ },
+ "./package.json": "./package.json",
+ "./use-at-your-own-risk/rules": {
+ "types": "./rules.d.ts",
+ "default": "./dist/rules/index.js"
+ }
+ },
+ "engines": {
+ "node": "^16.0.0 || >=18.0.0"
+ },
"repository": {
"type": "git",
"url": "https://github.com/typescript-eslint/typescript-eslint.git",
@@ -28,8 +34,12 @@
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"license": "MIT",
- "main": "dist/index.js",
- "types": "index.d.ts",
+ "keywords": [
+ "eslint",
+ "eslintplugin",
+ "eslint-plugin",
+ "typescript"
+ ],
"scripts": {
"build": "tsc -b tsconfig.build.json",
"check-docs": "jest tests/docs.test.ts --runTestsByPath --silent --runInBand",
@@ -37,42 +47,48 @@
"clean": "tsc -b tsconfig.build.json --clean",
"postclean": "rimraf dist && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
- "generate:breaking-changes": "yarn tsx tools/generate-breaking-changes.ts",
+ "generate:breaking-changes": "yarn tsx tools/generate-breaking-changes.mts",
"generate:configs": "yarn tsx tools/generate-configs.ts",
"lint": "nx lint",
"test": "jest --coverage",
+ "test-single": "jest --no-coverage",
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@eslint-community/regexpp": "^4.4.0",
- "@typescript-eslint/scope-manager": "5.62.0",
- "@typescript-eslint/type-utils": "5.62.0",
- "@typescript-eslint/utils": "5.62.0",
+ "@eslint-community/regexpp": "^4.5.0",
+ "@typescript-eslint/scope-manager": "6.0.0",
+ "@typescript-eslint/type-utils": "6.0.0",
+ "@typescript-eslint/utils": "6.0.0",
+ "@typescript-eslint/visitor-keys": "6.0.0",
"debug": "^4.3.4",
+ "grapheme-splitter": "^1.0.4",
"graphemer": "^1.4.0",
- "ignore": "^5.2.0",
+ "ignore": "^5.2.4",
+ "natural-compare": "^1.4.0",
"natural-compare-lite": "^1.4.0",
- "semver": "^7.3.7",
- "tsutils": "^3.21.0"
+ "semver": "^7.5.0",
+ "ts-api-utils": "^1.0.1"
},
"devDependencies": {
"@types/debug": "*",
- "@types/json-schema": "*",
"@types/marked": "*",
- "@types/natural-compare-lite": "^1.4.0",
+ "@types/natural-compare": "*",
"@types/prettier": "*",
+ "@typescript-eslint/rule-schema-to-typescript-types": "6.0.0",
+ "@typescript-eslint/rule-tester": "6.0.0",
"chalk": "^5.0.1",
- "cross-fetch": "^3.1.5",
+ "cross-fetch": "*",
+ "jest-specific-snapshot": "*",
"json-schema": "*",
- "markdown-table": "^3.0.2",
- "marked": "^4.0.15",
+ "markdown-table": "^3.0.3",
+ "marked": "^4.3.0",
"prettier": "*",
"title-case": "^3.0.3",
"typescript": "*"
},
"peerDependencies": {
- "@typescript-eslint/parser": "^5.0.0",
- "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0"
+ "@typescript-eslint/parser": "^6.0.0 || ^6.0.0-alpha",
+ "eslint": "^7.0.0 || ^8.0.0"
},
"peerDependenciesMeta": {
"typescript": {
diff --git a/packages/eslint-plugin/project.json b/packages/eslint-plugin/project.json
index af5479a4cd92..2b5c17d2ff5a 100644
--- a/packages/eslint-plugin/project.json
+++ b/packages/eslint-plugin/project.json
@@ -8,7 +8,8 @@
"executor": "@nx/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
- "lintFilePatterns": ["packages/eslint-plugin/**/*.ts"]
+ "lintFilePatterns": ["packages/eslint-plugin/**/*.{mts,cts,ts,tsx}"],
+ "ignorePath": ".eslintignore"
}
}
}
diff --git a/packages/eslint-plugin/rules.d.ts b/packages/eslint-plugin/rules.d.ts
new file mode 100644
index 000000000000..9a5272d205c3
--- /dev/null
+++ b/packages/eslint-plugin/rules.d.ts
@@ -0,0 +1,44 @@
+/*
+We purposely don't generate types for our plugin because TL;DR:
+1) there's no real reason that anyone should do a typed import of our rules,
+2) it would require us to change our code so there aren't as many inferred types
+
+This type declaration exists as a hacky way to add a type to the export for our
+internal packages that require it.
+
+*** Long reason ***
+
+When you turn on declaration files, TS requires all types to be "fully resolvable"
+without changes to the code.
+All of our lint rules `export default createRule(...)`, which means they all
+implicitly reference the `TSESLint.Rule` type for the export.
+
+TS wants to transpile each rule file to this `.d.ts` file:
+
+```ts
+import type { TSESLint } from '@typescript-eslint/utils';
+declare const _default: TSESLint.RuleModule;
+export default _default;
+```
+
+Because we don't import `TSESLint` in most files, it means that TS would have to
+insert a new import during the declaration emit to make this work.
+However TS wants to avoid adding new imports to the file because a new module
+could have type side-effects (like global augmentation) which could cause weird
+type side-effects in the decl file that wouldn't exist in source TS file.
+
+So TS errors on most of our rules with the following error:
+```
+The inferred type of 'default' cannot be named without a reference to
+'../../../../node_modules/@typescript-eslint/utils/src/ts-eslint/Rule'.
+This is likely not portable. A type annotation is necessary. ts(2742)
+```
+*/
+
+import type { RuleModule } from '@typescript-eslint/utils/ts-eslint';
+
+export interface TypeScriptESLintRules {
+ [ruleName: string]: RuleModule;
+}
+declare const rules: TypeScriptESLintRules;
+export = rules;
diff --git a/packages/eslint-plugin/src/configs/all.ts b/packages/eslint-plugin/src/configs/all.ts
index 777cf069827e..184a241a66fd 100644
--- a/packages/eslint-plugin/src/configs/all.ts
+++ b/packages/eslint-plugin/src/configs/all.ts
@@ -1,6 +1,9 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
-// YOU CAN REGENERATE IT USING yarn generate:configs
+// SEE https://typescript-eslint.io/linting/configs
+//
+// For developers working in the typescript-eslint monorepo:
+// You can regenerate it using `yarn generate:configs`
export = {
extends: ['./configs/base', './configs/eslint-recommended'],
@@ -105,7 +108,6 @@ export = {
'@typescript-eslint/no-this-alias': 'error',
'no-throw-literal': 'off',
'@typescript-eslint/no-throw-literal': 'error',
- '@typescript-eslint/no-type-alias': 'error',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
diff --git a/packages/eslint-plugin/src/configs/base.ts b/packages/eslint-plugin/src/configs/base.ts
index 528e00c77789..628ed42b760c 100644
--- a/packages/eslint-plugin/src/configs/base.ts
+++ b/packages/eslint-plugin/src/configs/base.ts
@@ -1,6 +1,9 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
-// YOU CAN REGENERATE IT USING yarn generate:configs
+// SEE https://typescript-eslint.io/linting/configs
+//
+// For developers working in the typescript-eslint monorepo:
+// You can regenerate it using `yarn generate:configs`
export = {
parser: '@typescript-eslint/parser',
diff --git a/packages/eslint-plugin/src/configs/disable-type-checked.ts b/packages/eslint-plugin/src/configs/disable-type-checked.ts
new file mode 100644
index 000000000000..38a7ffd079d8
--- /dev/null
+++ b/packages/eslint-plugin/src/configs/disable-type-checked.ts
@@ -0,0 +1,57 @@
+// THIS CODE WAS AUTOMATICALLY GENERATED
+// DO NOT EDIT THIS CODE BY HAND
+// SEE https://typescript-eslint.io/linting/configs
+//
+// For developers working in the typescript-eslint monorepo:
+// You can regenerate it using `yarn generate:configs`
+
+export = {
+ parserOptions: { project: null, program: null },
+ rules: {
+ '@typescript-eslint/await-thenable': 'off',
+ '@typescript-eslint/consistent-type-exports': 'off',
+ '@typescript-eslint/dot-notation': 'off',
+ '@typescript-eslint/naming-convention': 'off',
+ '@typescript-eslint/no-base-to-string': 'off',
+ '@typescript-eslint/no-confusing-void-expression': 'off',
+ '@typescript-eslint/no-duplicate-type-constituents': 'off',
+ '@typescript-eslint/no-floating-promises': 'off',
+ '@typescript-eslint/no-for-in-array': 'off',
+ '@typescript-eslint/no-implied-eval': 'off',
+ '@typescript-eslint/no-meaningless-void-operator': 'off',
+ '@typescript-eslint/no-misused-promises': 'off',
+ '@typescript-eslint/no-mixed-enums': 'off',
+ '@typescript-eslint/no-redundant-type-constituents': 'off',
+ '@typescript-eslint/no-throw-literal': 'off',
+ '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
+ '@typescript-eslint/no-unnecessary-condition': 'off',
+ '@typescript-eslint/no-unnecessary-qualifier': 'off',
+ '@typescript-eslint/no-unnecessary-type-arguments': 'off',
+ '@typescript-eslint/no-unnecessary-type-assertion': 'off',
+ '@typescript-eslint/no-unsafe-argument': 'off',
+ '@typescript-eslint/no-unsafe-assignment': 'off',
+ '@typescript-eslint/no-unsafe-call': 'off',
+ '@typescript-eslint/no-unsafe-enum-comparison': 'off',
+ '@typescript-eslint/no-unsafe-member-access': 'off',
+ '@typescript-eslint/no-unsafe-return': 'off',
+ '@typescript-eslint/non-nullable-type-assertion-style': 'off',
+ '@typescript-eslint/prefer-includes': 'off',
+ '@typescript-eslint/prefer-nullish-coalescing': 'off',
+ '@typescript-eslint/prefer-optional-chain': 'off',
+ '@typescript-eslint/prefer-readonly': 'off',
+ '@typescript-eslint/prefer-readonly-parameter-types': 'off',
+ '@typescript-eslint/prefer-reduce-type-parameter': 'off',
+ '@typescript-eslint/prefer-regexp-exec': 'off',
+ '@typescript-eslint/prefer-return-this-type': 'off',
+ '@typescript-eslint/prefer-string-starts-ends-with': 'off',
+ '@typescript-eslint/promise-function-async': 'off',
+ '@typescript-eslint/require-array-sort-compare': 'off',
+ '@typescript-eslint/require-await': 'off',
+ '@typescript-eslint/restrict-plus-operands': 'off',
+ '@typescript-eslint/restrict-template-expressions': 'off',
+ '@typescript-eslint/return-await': 'off',
+ '@typescript-eslint/strict-boolean-expressions': 'off',
+ '@typescript-eslint/switch-exhaustiveness-check': 'off',
+ '@typescript-eslint/unbound-method': 'off',
+ },
+};
diff --git a/packages/eslint-plugin/src/configs/eslint-recommended.ts b/packages/eslint-plugin/src/configs/eslint-recommended.ts
index af3c0050c011..d6e13341060f 100644
--- a/packages/eslint-plugin/src/configs/eslint-recommended.ts
+++ b/packages/eslint-plugin/src/configs/eslint-recommended.ts
@@ -28,7 +28,6 @@ export = {
'prefer-const': 'error', // ts provides better types with const
'prefer-rest-params': 'error', // ts provides better types with rest args over arguments
'prefer-spread': 'error', // ts transpiles spread to apply, so no need for manual apply
- 'valid-typeof': 'off', // ts(2367)
},
},
],
diff --git a/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts b/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts
deleted file mode 100644
index 369d33d6687e..000000000000
--- a/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-// THIS CODE WAS AUTOMATICALLY GENERATED
-// DO NOT EDIT THIS CODE BY HAND
-// YOU CAN REGENERATE IT USING yarn generate:configs
-
-export = {
- extends: ['./configs/base', './configs/eslint-recommended'],
- rules: {
- '@typescript-eslint/await-thenable': 'error',
- '@typescript-eslint/no-floating-promises': 'error',
- '@typescript-eslint/no-for-in-array': 'error',
- 'no-implied-eval': 'off',
- '@typescript-eslint/no-implied-eval': 'error',
- '@typescript-eslint/no-misused-promises': 'error',
- '@typescript-eslint/no-unnecessary-type-assertion': 'error',
- '@typescript-eslint/no-unsafe-argument': 'error',
- '@typescript-eslint/no-unsafe-assignment': 'error',
- '@typescript-eslint/no-unsafe-call': 'error',
- '@typescript-eslint/no-unsafe-member-access': 'error',
- '@typescript-eslint/no-unsafe-return': 'error',
- 'require-await': 'off',
- '@typescript-eslint/require-await': 'error',
- '@typescript-eslint/restrict-plus-operands': 'error',
- '@typescript-eslint/restrict-template-expressions': 'error',
- '@typescript-eslint/unbound-method': 'error',
- },
-};
diff --git a/packages/eslint-plugin/src/configs/recommended-type-checked.ts b/packages/eslint-plugin/src/configs/recommended-type-checked.ts
new file mode 100644
index 000000000000..ab0f50394612
--- /dev/null
+++ b/packages/eslint-plugin/src/configs/recommended-type-checked.ts
@@ -0,0 +1,53 @@
+// THIS CODE WAS AUTOMATICALLY GENERATED
+// DO NOT EDIT THIS CODE BY HAND
+// SEE https://typescript-eslint.io/linting/configs
+//
+// For developers working in the typescript-eslint monorepo:
+// You can regenerate it using `yarn generate:configs`
+
+export = {
+ extends: ['./configs/base', './configs/eslint-recommended'],
+ rules: {
+ '@typescript-eslint/await-thenable': 'error',
+ '@typescript-eslint/ban-ts-comment': 'error',
+ '@typescript-eslint/ban-types': 'error',
+ 'no-array-constructor': 'off',
+ '@typescript-eslint/no-array-constructor': 'error',
+ '@typescript-eslint/no-base-to-string': 'error',
+ '@typescript-eslint/no-duplicate-enum-values': 'error',
+ '@typescript-eslint/no-duplicate-type-constituents': 'error',
+ '@typescript-eslint/no-explicit-any': 'error',
+ '@typescript-eslint/no-extra-non-null-assertion': 'error',
+ '@typescript-eslint/no-floating-promises': 'error',
+ '@typescript-eslint/no-for-in-array': 'error',
+ 'no-implied-eval': 'off',
+ '@typescript-eslint/no-implied-eval': 'error',
+ 'no-loss-of-precision': 'off',
+ '@typescript-eslint/no-loss-of-precision': 'error',
+ '@typescript-eslint/no-misused-new': 'error',
+ '@typescript-eslint/no-misused-promises': 'error',
+ '@typescript-eslint/no-namespace': 'error',
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
+ '@typescript-eslint/no-redundant-type-constituents': 'error',
+ '@typescript-eslint/no-this-alias': 'error',
+ '@typescript-eslint/no-unnecessary-type-assertion': 'error',
+ '@typescript-eslint/no-unnecessary-type-constraint': 'error',
+ '@typescript-eslint/no-unsafe-argument': 'error',
+ '@typescript-eslint/no-unsafe-assignment': 'error',
+ '@typescript-eslint/no-unsafe-call': 'error',
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
+ '@typescript-eslint/no-unsafe-enum-comparison': 'error',
+ '@typescript-eslint/no-unsafe-member-access': 'error',
+ '@typescript-eslint/no-unsafe-return': 'error',
+ 'no-unused-vars': 'off',
+ '@typescript-eslint/no-unused-vars': 'error',
+ '@typescript-eslint/no-var-requires': 'error',
+ '@typescript-eslint/prefer-as-const': 'error',
+ 'require-await': 'off',
+ '@typescript-eslint/require-await': 'error',
+ '@typescript-eslint/restrict-plus-operands': 'error',
+ '@typescript-eslint/restrict-template-expressions': 'error',
+ '@typescript-eslint/triple-slash-reference': 'error',
+ '@typescript-eslint/unbound-method': 'error',
+ },
+};
diff --git a/packages/eslint-plugin/src/configs/recommended.ts b/packages/eslint-plugin/src/configs/recommended.ts
index 10b1d04581fb..d8654cd45e07 100644
--- a/packages/eslint-plugin/src/configs/recommended.ts
+++ b/packages/eslint-plugin/src/configs/recommended.ts
@@ -1,36 +1,32 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
-// YOU CAN REGENERATE IT USING yarn generate:configs
+// SEE https://typescript-eslint.io/linting/configs
+//
+// For developers working in the typescript-eslint monorepo:
+// You can regenerate it using `yarn generate:configs`
export = {
extends: ['./configs/base', './configs/eslint-recommended'],
rules: {
- '@typescript-eslint/adjacent-overload-signatures': 'error',
'@typescript-eslint/ban-ts-comment': 'error',
'@typescript-eslint/ban-types': 'error',
'no-array-constructor': 'off',
'@typescript-eslint/no-array-constructor': 'error',
- 'no-empty-function': 'off',
- '@typescript-eslint/no-empty-function': 'error',
- '@typescript-eslint/no-empty-interface': 'error',
- '@typescript-eslint/no-explicit-any': 'warn',
+ '@typescript-eslint/no-duplicate-enum-values': 'error',
+ '@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-extra-non-null-assertion': 'error',
- 'no-extra-semi': 'off',
- '@typescript-eslint/no-extra-semi': 'error',
- '@typescript-eslint/no-inferrable-types': 'error',
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',
'@typescript-eslint/no-misused-new': 'error',
'@typescript-eslint/no-namespace': 'error',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
- '@typescript-eslint/no-non-null-assertion': 'warn',
'@typescript-eslint/no-this-alias': 'error',
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
'no-unused-vars': 'off',
- '@typescript-eslint/no-unused-vars': 'warn',
+ '@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/prefer-as-const': 'error',
- '@typescript-eslint/prefer-namespace-keyword': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
},
};
diff --git a/packages/eslint-plugin/src/configs/strict-type-checked.ts b/packages/eslint-plugin/src/configs/strict-type-checked.ts
new file mode 100644
index 000000000000..dfba0b81c7fa
--- /dev/null
+++ b/packages/eslint-plugin/src/configs/strict-type-checked.ts
@@ -0,0 +1,74 @@
+// THIS CODE WAS AUTOMATICALLY GENERATED
+// DO NOT EDIT THIS CODE BY HAND
+// SEE https://typescript-eslint.io/linting/configs
+//
+// For developers working in the typescript-eslint monorepo:
+// You can regenerate it using `yarn generate:configs`
+
+export = {
+ extends: ['./configs/base', './configs/eslint-recommended'],
+ rules: {
+ '@typescript-eslint/await-thenable': 'error',
+ '@typescript-eslint/ban-ts-comment': 'error',
+ '@typescript-eslint/ban-types': 'error',
+ 'no-array-constructor': 'off',
+ '@typescript-eslint/no-array-constructor': 'error',
+ '@typescript-eslint/no-base-to-string': 'error',
+ '@typescript-eslint/no-confusing-void-expression': 'error',
+ '@typescript-eslint/no-duplicate-enum-values': 'error',
+ '@typescript-eslint/no-duplicate-type-constituents': 'error',
+ '@typescript-eslint/no-dynamic-delete': 'error',
+ '@typescript-eslint/no-explicit-any': 'error',
+ '@typescript-eslint/no-extra-non-null-assertion': 'error',
+ '@typescript-eslint/no-extraneous-class': 'error',
+ '@typescript-eslint/no-floating-promises': 'error',
+ '@typescript-eslint/no-for-in-array': 'error',
+ 'no-implied-eval': 'off',
+ '@typescript-eslint/no-implied-eval': 'error',
+ '@typescript-eslint/no-invalid-void-type': 'error',
+ 'no-loss-of-precision': 'off',
+ '@typescript-eslint/no-loss-of-precision': 'error',
+ '@typescript-eslint/no-meaningless-void-operator': 'error',
+ '@typescript-eslint/no-misused-new': 'error',
+ '@typescript-eslint/no-misused-promises': 'error',
+ '@typescript-eslint/no-mixed-enums': 'error',
+ '@typescript-eslint/no-namespace': 'error',
+ '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
+ '@typescript-eslint/no-non-null-assertion': 'error',
+ '@typescript-eslint/no-redundant-type-constituents': 'error',
+ '@typescript-eslint/no-this-alias': 'error',
+ 'no-throw-literal': 'off',
+ '@typescript-eslint/no-throw-literal': 'error',
+ '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'error',
+ '@typescript-eslint/no-unnecessary-condition': 'error',
+ '@typescript-eslint/no-unnecessary-type-arguments': 'error',
+ '@typescript-eslint/no-unnecessary-type-assertion': 'error',
+ '@typescript-eslint/no-unnecessary-type-constraint': 'error',
+ '@typescript-eslint/no-unsafe-argument': 'error',
+ '@typescript-eslint/no-unsafe-assignment': 'error',
+ '@typescript-eslint/no-unsafe-call': 'error',
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
+ '@typescript-eslint/no-unsafe-enum-comparison': 'error',
+ '@typescript-eslint/no-unsafe-member-access': 'error',
+ '@typescript-eslint/no-unsafe-return': 'error',
+ 'no-unused-vars': 'off',
+ '@typescript-eslint/no-unused-vars': 'error',
+ 'no-useless-constructor': 'off',
+ '@typescript-eslint/no-useless-constructor': 'error',
+ '@typescript-eslint/no-var-requires': 'error',
+ '@typescript-eslint/prefer-as-const': 'error',
+ '@typescript-eslint/prefer-includes': 'error',
+ '@typescript-eslint/prefer-literal-enum-member': 'error',
+ '@typescript-eslint/prefer-reduce-type-parameter': 'error',
+ '@typescript-eslint/prefer-return-this-type': 'error',
+ '@typescript-eslint/prefer-ts-expect-error': 'error',
+ 'require-await': 'off',
+ '@typescript-eslint/require-await': 'error',
+ '@typescript-eslint/restrict-plus-operands': 'error',
+ '@typescript-eslint/restrict-template-expressions': 'error',
+ '@typescript-eslint/triple-slash-reference': 'error',
+ '@typescript-eslint/unbound-method': 'error',
+ '@typescript-eslint/unified-signatures': 'error',
+ },
+};
diff --git a/packages/eslint-plugin/src/configs/strict.ts b/packages/eslint-plugin/src/configs/strict.ts
index 26b71c931b00..98553e52bf72 100644
--- a/packages/eslint-plugin/src/configs/strict.ts
+++ b/packages/eslint-plugin/src/configs/strict.ts
@@ -1,48 +1,42 @@
// THIS CODE WAS AUTOMATICALLY GENERATED
// DO NOT EDIT THIS CODE BY HAND
-// YOU CAN REGENERATE IT USING yarn generate:configs
+// SEE https://typescript-eslint.io/linting/configs
+//
+// For developers working in the typescript-eslint monorepo:
+// You can regenerate it using `yarn generate:configs`
export = {
extends: ['./configs/base', './configs/eslint-recommended'],
rules: {
- '@typescript-eslint/array-type': 'warn',
- '@typescript-eslint/ban-tslint-comment': 'warn',
- '@typescript-eslint/class-literal-property-style': 'warn',
- '@typescript-eslint/consistent-generic-constructors': 'warn',
- '@typescript-eslint/consistent-indexed-object-style': 'warn',
- '@typescript-eslint/consistent-type-assertions': 'warn',
- '@typescript-eslint/consistent-type-definitions': 'warn',
- 'dot-notation': 'off',
- '@typescript-eslint/dot-notation': 'warn',
- '@typescript-eslint/no-base-to-string': 'warn',
- '@typescript-eslint/no-confusing-non-null-assertion': 'warn',
- '@typescript-eslint/no-duplicate-enum-values': 'warn',
- '@typescript-eslint/no-dynamic-delete': 'warn',
- '@typescript-eslint/no-extraneous-class': 'warn',
- '@typescript-eslint/no-invalid-void-type': 'warn',
- '@typescript-eslint/no-meaningless-void-operator': 'warn',
- '@typescript-eslint/no-mixed-enums': 'warn',
- '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'warn',
- 'no-throw-literal': 'off',
- '@typescript-eslint/no-throw-literal': 'warn',
- '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn',
- '@typescript-eslint/no-unnecessary-condition': 'warn',
- '@typescript-eslint/no-unnecessary-type-arguments': 'warn',
- '@typescript-eslint/no-unsafe-declaration-merging': 'warn',
- '@typescript-eslint/no-unsafe-enum-comparison': 'warn',
+ '@typescript-eslint/ban-ts-comment': 'error',
+ '@typescript-eslint/ban-types': 'error',
+ 'no-array-constructor': 'off',
+ '@typescript-eslint/no-array-constructor': 'error',
+ '@typescript-eslint/no-duplicate-enum-values': 'error',
+ '@typescript-eslint/no-dynamic-delete': 'error',
+ '@typescript-eslint/no-explicit-any': 'error',
+ '@typescript-eslint/no-extra-non-null-assertion': 'error',
+ '@typescript-eslint/no-extraneous-class': 'error',
+ '@typescript-eslint/no-invalid-void-type': 'error',
+ 'no-loss-of-precision': 'off',
+ '@typescript-eslint/no-loss-of-precision': 'error',
+ '@typescript-eslint/no-misused-new': 'error',
+ '@typescript-eslint/no-namespace': 'error',
+ '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error',
+ '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
+ '@typescript-eslint/no-non-null-assertion': 'error',
+ '@typescript-eslint/no-this-alias': 'error',
+ '@typescript-eslint/no-unnecessary-type-constraint': 'error',
+ '@typescript-eslint/no-unsafe-declaration-merging': 'error',
+ 'no-unused-vars': 'off',
+ '@typescript-eslint/no-unused-vars': 'error',
'no-useless-constructor': 'off',
- '@typescript-eslint/no-useless-constructor': 'warn',
- '@typescript-eslint/non-nullable-type-assertion-style': 'warn',
- '@typescript-eslint/prefer-for-of': 'warn',
- '@typescript-eslint/prefer-function-type': 'warn',
- '@typescript-eslint/prefer-includes': 'warn',
- '@typescript-eslint/prefer-literal-enum-member': 'warn',
- '@typescript-eslint/prefer-nullish-coalescing': 'warn',
- '@typescript-eslint/prefer-optional-chain': 'warn',
- '@typescript-eslint/prefer-reduce-type-parameter': 'warn',
- '@typescript-eslint/prefer-return-this-type': 'warn',
- '@typescript-eslint/prefer-string-starts-ends-with': 'warn',
- '@typescript-eslint/prefer-ts-expect-error': 'warn',
- '@typescript-eslint/unified-signatures': 'warn',
+ '@typescript-eslint/no-useless-constructor': 'error',
+ '@typescript-eslint/no-var-requires': 'error',
+ '@typescript-eslint/prefer-as-const': 'error',
+ '@typescript-eslint/prefer-literal-enum-member': 'error',
+ '@typescript-eslint/prefer-ts-expect-error': 'error',
+ '@typescript-eslint/triple-slash-reference': 'error',
+ '@typescript-eslint/unified-signatures': 'error',
},
};
diff --git a/packages/eslint-plugin/src/configs/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/stylistic-type-checked.ts
new file mode 100644
index 000000000000..5c73ae3845b6
--- /dev/null
+++ b/packages/eslint-plugin/src/configs/stylistic-type-checked.ts
@@ -0,0 +1,34 @@
+// THIS CODE WAS AUTOMATICALLY GENERATED
+// DO NOT EDIT THIS CODE BY HAND
+// SEE https://typescript-eslint.io/linting/configs
+//
+// For developers working in the typescript-eslint monorepo:
+// You can regenerate it using `yarn generate:configs`
+
+export = {
+ extends: ['./configs/base', './configs/eslint-recommended'],
+ rules: {
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
+ '@typescript-eslint/array-type': 'error',
+ '@typescript-eslint/ban-tslint-comment': 'error',
+ '@typescript-eslint/class-literal-property-style': 'error',
+ '@typescript-eslint/consistent-generic-constructors': 'error',
+ '@typescript-eslint/consistent-indexed-object-style': 'error',
+ '@typescript-eslint/consistent-type-assertions': 'error',
+ '@typescript-eslint/consistent-type-definitions': 'error',
+ 'dot-notation': 'off',
+ '@typescript-eslint/dot-notation': 'error',
+ '@typescript-eslint/no-confusing-non-null-assertion': 'error',
+ 'no-empty-function': 'off',
+ '@typescript-eslint/no-empty-function': 'error',
+ '@typescript-eslint/no-empty-interface': 'error',
+ '@typescript-eslint/no-inferrable-types': 'error',
+ '@typescript-eslint/non-nullable-type-assertion-style': 'error',
+ '@typescript-eslint/prefer-for-of': 'error',
+ '@typescript-eslint/prefer-function-type': 'error',
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
+ '@typescript-eslint/prefer-nullish-coalescing': 'error',
+ '@typescript-eslint/prefer-optional-chain': 'error',
+ '@typescript-eslint/prefer-string-starts-ends-with': 'error',
+ },
+};
diff --git a/packages/eslint-plugin/src/configs/stylistic.ts b/packages/eslint-plugin/src/configs/stylistic.ts
new file mode 100644
index 000000000000..863a50eecda7
--- /dev/null
+++ b/packages/eslint-plugin/src/configs/stylistic.ts
@@ -0,0 +1,28 @@
+// THIS CODE WAS AUTOMATICALLY GENERATED
+// DO NOT EDIT THIS CODE BY HAND
+// SEE https://typescript-eslint.io/linting/configs
+//
+// For developers working in the typescript-eslint monorepo:
+// You can regenerate it using `yarn generate:configs`
+
+export = {
+ extends: ['./configs/base', './configs/eslint-recommended'],
+ rules: {
+ '@typescript-eslint/adjacent-overload-signatures': 'error',
+ '@typescript-eslint/array-type': 'error',
+ '@typescript-eslint/ban-tslint-comment': 'error',
+ '@typescript-eslint/class-literal-property-style': 'error',
+ '@typescript-eslint/consistent-generic-constructors': 'error',
+ '@typescript-eslint/consistent-indexed-object-style': 'error',
+ '@typescript-eslint/consistent-type-assertions': 'error',
+ '@typescript-eslint/consistent-type-definitions': 'error',
+ '@typescript-eslint/no-confusing-non-null-assertion': 'error',
+ 'no-empty-function': 'off',
+ '@typescript-eslint/no-empty-function': 'error',
+ '@typescript-eslint/no-empty-interface': 'error',
+ '@typescript-eslint/no-inferrable-types': 'error',
+ '@typescript-eslint/prefer-for-of': 'error',
+ '@typescript-eslint/prefer-function-type': 'error',
+ '@typescript-eslint/prefer-namespace-keyword': 'error',
+ },
+};
diff --git a/packages/eslint-plugin/src/index.ts b/packages/eslint-plugin/src/index.ts
index 03899ac43cbd..ece2bb0a20fc 100644
--- a/packages/eslint-plugin/src/index.ts
+++ b/packages/eslint-plugin/src/index.ts
@@ -1,19 +1,29 @@
import all from './configs/all';
import base from './configs/base';
+import disableTypeChecked from './configs/disable-type-checked';
import eslintRecommended from './configs/eslint-recommended';
import recommended from './configs/recommended';
-import recommendedRequiringTypeChecking from './configs/recommended-requiring-type-checking';
+import recommendedTypeChecked from './configs/recommended-type-checked';
import strict from './configs/strict';
+import strictTypeChecked from './configs/strict-type-checked';
+import stylistic from './configs/stylistic';
+import stylisticTypeChecked from './configs/stylistic-type-checked';
import rules from './rules';
export = {
- rules,
configs: {
all,
base,
- recommended,
+ 'disable-type-checked': disableTypeChecked,
'eslint-recommended': eslintRecommended,
- 'recommended-requiring-type-checking': recommendedRequiringTypeChecking,
+ recommended,
+ /** @deprecated - please use "recommended-type-checked" instead. */
+ 'recommended-requiring-type-checking': recommendedTypeChecked,
+ 'recommended-type-checked': recommendedTypeChecked,
strict,
+ 'strict-type-checked': strictTypeChecked,
+ stylistic,
+ 'stylistic-type-checked': stylisticTypeChecked,
},
+ rules,
};
diff --git a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts
index 498a9bf5ae1b..0534cc8ce0d1 100644
--- a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts
+++ b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts
@@ -4,12 +4,12 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
type RuleNode =
+ | TSESTree.BlockStatement
| TSESTree.ClassBody
| TSESTree.Program
- | TSESTree.TSModuleBlock
- | TSESTree.TSTypeLiteral
| TSESTree.TSInterfaceBody
- | TSESTree.BlockStatement;
+ | TSESTree.TSModuleBlock
+ | TSESTree.TSTypeLiteral;
type Member =
| TSESTree.ClassElement
| TSESTree.ProgramStatement
@@ -21,7 +21,7 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Require that function overload signatures be consecutive',
- recommended: 'error',
+ recommended: 'stylistic',
},
schema: [],
messages: {
diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts
index f353207e7d5d..cd4a1f89cb2f 100644
--- a/packages/eslint-plugin/src/rules/array-type.ts
+++ b/packages/eslint-plugin/src/rules/array-type.ts
@@ -32,14 +32,14 @@ function isSimpleType(node: TSESTree.Node): boolean {
node.typeName.type === AST_NODE_TYPES.Identifier &&
node.typeName.name === 'Array'
) {
- if (!node.typeParameters) {
+ if (!node.typeArguments) {
return true;
}
- if (node.typeParameters.params.length === 1) {
- return isSimpleType(node.typeParameters.params[0]);
+ if (node.typeArguments.params.length === 1) {
+ return isSimpleType(node.typeArguments.params[0]);
}
} else {
- if (node.typeParameters) {
+ if (node.typeArguments) {
return false;
}
return isSimpleType(node.typeName);
@@ -72,7 +72,7 @@ function typeNeedsParentheses(node: TSESTree.Node): boolean {
}
}
-export type OptionString = 'array' | 'generic' | 'array-simple';
+export type OptionString = 'array-simple' | 'array' | 'generic';
type Options = [
{
default: OptionString;
@@ -80,9 +80,9 @@ type Options = [
},
];
type MessageIds =
- | 'errorStringGeneric'
| 'errorStringArray'
| 'errorStringArraySimple'
+ | 'errorStringGeneric'
| 'errorStringGenericSimple';
export default util.createRule({
@@ -92,7 +92,7 @@ export default util.createRule({
docs: {
description:
'Require consistently using either `T[]` or `Array` for arrays',
- recommended: 'strict',
+ recommended: 'stylistic',
},
fixable: 'code',
messages: {
@@ -105,30 +105,29 @@ export default util.createRule({
errorStringGenericSimple:
"Array type using '{{readonlyPrefix}}{{type}}[]' is forbidden for non-simple types. Use '{{className}}<{{type}}>' instead.",
},
- schema: {
- $defs: {
- arrayOption: {
- enum: ['array', 'generic', 'array-simple'],
+ schema: [
+ {
+ $defs: {
+ arrayOption: {
+ type: 'string',
+ enum: ['array', 'generic', 'array-simple'],
+ },
},
- },
- prefixItems: [
- {
- properties: {
- default: {
- $ref: '#/$defs/arrayOption',
- description: 'The array type expected for mutable cases...',
- },
- readonly: {
- $ref: '#/$defs/arrayOption',
- description:
- 'The array type expected for readonly cases. If omitted, the value for `default` will be used.',
- },
+ additionalProperties: false,
+ properties: {
+ default: {
+ $ref: '#/items/0/$defs/arrayOption',
+ description: 'The array type expected for mutable cases.',
+ },
+ readonly: {
+ $ref: '#/items/0/$defs/arrayOption',
+ description:
+ 'The array type expected for readonly cases. If omitted, the value for `default` will be used.',
},
- type: 'object',
},
- ],
- type: 'array',
- },
+ type: 'object',
+ },
+ ],
},
defaultOptions: [
{
@@ -154,7 +153,6 @@ export default util.createRule({
return {
TSArrayType(node): void {
const isReadonly =
- node.parent &&
node.parent.type === AST_NODE_TYPES.TSTypeOperator &&
node.parent.operator === 'readonly';
@@ -171,7 +169,7 @@ export default util.createRule({
currentOption === 'generic'
? 'errorStringGeneric'
: 'errorStringGenericSimple';
- const errorNode = isReadonly ? node.parent! : node;
+ const errorNode = isReadonly ? node.parent : node;
context.report({
node: errorNode,
@@ -220,7 +218,7 @@ export default util.createRule({
}
const readonlyPrefix = isReadonlyArrayType ? 'readonly ' : '';
- const typeParams = node.typeParameters?.params;
+ const typeParams = node.typeArguments?.params;
const messageId =
currentOption === 'array'
? 'errorStringArray'
diff --git a/packages/eslint-plugin/src/rules/await-thenable.ts b/packages/eslint-plugin/src/rules/await-thenable.ts
index ab9f97da7c27..fca9fd83de00 100644
--- a/packages/eslint-plugin/src/rules/await-thenable.ts
+++ b/packages/eslint-plugin/src/rules/await-thenable.ts
@@ -1,4 +1,4 @@
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as util from '../util';
@@ -7,7 +7,7 @@ export default util.createRule({
meta: {
docs: {
description: 'Disallow awaiting a value that is not a Thenable',
- recommended: 'error',
+ recommended: 'recommended',
requiresTypeChecking: true,
},
messages: {
@@ -19,19 +19,19 @@ export default util.createRule({
defaultOptions: [],
create(context) {
- const parserServices = util.getParserServices(context);
- const checker = parserServices.program.getTypeChecker();
+ const services = util.getParserServices(context);
+ const checker = services.program.getTypeChecker();
return {
AwaitExpression(node): void {
- const originalNode = parserServices.esTreeNodeToTSNodeMap.get(node);
- const type = checker.getTypeAtLocation(originalNode.expression);
+ const type = services.getTypeAtLocation(node.argument);
+ if (util.isTypeAnyType(type) || util.isTypeUnknownType(type)) {
+ return;
+ }
+
+ const originalNode = services.esTreeNodeToTSNodeMap.get(node);
- if (
- !util.isTypeAnyType(type) &&
- !util.isTypeUnknownType(type) &&
- !tsutils.isThenableType(checker, originalNode.expression, type)
- ) {
+ if (!tsutils.isThenableType(checker, originalNode.expression, type)) {
context.report({
messageId: 'await',
node,
diff --git a/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/packages/eslint-plugin/src/rules/ban-ts-comment.ts
index 511a951280e7..7de0718bde6b 100644
--- a/packages/eslint-plugin/src/rules/ban-ts-comment.ts
+++ b/packages/eslint-plugin/src/rules/ban-ts-comment.ts
@@ -19,8 +19,8 @@ export const defaultMinimumDescriptionLength = 3;
type MessageIds =
| 'tsDirectiveComment'
- | 'tsDirectiveCommentRequiresDescription'
- | 'tsDirectiveCommentDescriptionNotMatchPattern';
+ | 'tsDirectiveCommentDescriptionNotMatchPattern'
+ | 'tsDirectiveCommentRequiresDescription';
export default util.createRule<[Options], MessageIds>({
name: 'ban-ts-comment',
@@ -29,7 +29,7 @@ export default util.createRule<[Options], MessageIds>({
docs: {
description:
'Disallow `@ts-` comments or require descriptions after directives',
- recommended: 'error',
+ recommended: 'recommended',
},
messages: {
tsDirectiveComment:
@@ -39,45 +39,43 @@ export default util.createRule<[Options], MessageIds>({
tsDirectiveCommentDescriptionNotMatchPattern:
'The description for the "@ts-{{directive}}" directive must match the {{format}} format.',
},
- schema: {
- $defs: {
- directiveConfigSchema: {
- oneOf: [
- {
- type: 'boolean',
- default: true,
- },
- {
- enum: ['allow-with-description'],
- },
- {
- type: 'object',
- properties: {
- descriptionFormat: { type: 'string' },
+ schema: [
+ {
+ $defs: {
+ directiveConfigSchema: {
+ oneOf: [
+ {
+ type: 'boolean',
+ default: true,
},
- },
- ],
+ {
+ type: 'string',
+ enum: ['allow-with-description'],
+ },
+ {
+ type: 'object',
+ additionalProperties: false,
+ properties: {
+ descriptionFormat: { type: 'string' },
+ },
+ },
+ ],
+ },
},
- },
- prefixItems: [
- {
- properties: {
- 'ts-expect-error': {
- $ref: '#/$defs/directiveConfigSchema',
- },
- 'ts-ignore': { $ref: '#/$defs/directiveConfigSchema' },
- 'ts-nocheck': { $ref: '#/$defs/directiveConfigSchema' },
- 'ts-check': { $ref: '#/$defs/directiveConfigSchema' },
- minimumDescriptionLength: {
- type: 'number',
- default: defaultMinimumDescriptionLength,
- },
+ properties: {
+ 'ts-expect-error': { $ref: '#/items/0/$defs/directiveConfigSchema' },
+ 'ts-ignore': { $ref: '#/items/0/$defs/directiveConfigSchema' },
+ 'ts-nocheck': { $ref: '#/items/0/$defs/directiveConfigSchema' },
+ 'ts-check': { $ref: '#/items/0/$defs/directiveConfigSchema' },
+ minimumDescriptionLength: {
+ type: 'number',
+ default: defaultMinimumDescriptionLength,
},
- additionalProperties: false,
},
- ],
- type: 'array',
- },
+ type: 'object',
+ additionalProperties: false,
+ },
+ ],
},
defaultOptions: [
{
diff --git a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
index 849fbcc911ef..4453649b717e 100644
--- a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
+++ b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts
@@ -9,7 +9,7 @@ const ENABLE_DISABLE_REGEX =
const toText = (
text: string,
- type: AST_TOKEN_TYPES.Line | AST_TOKEN_TYPES.Block,
+ type: AST_TOKEN_TYPES.Block | AST_TOKEN_TYPES.Line,
): string =>
type === AST_TOKEN_TYPES.Line
? ['//', text.trim()].join(' ')
@@ -21,7 +21,7 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow `// tslint:` comments',
- recommended: 'strict',
+ recommended: 'stylistic',
},
messages: {
commentDetected: 'tslint comment detected: "{{ text }}"',
diff --git a/packages/eslint-plugin/src/rules/ban-types.ts b/packages/eslint-plugin/src/rules/ban-types.ts
index 21a1d1c1403d..8352eff2f2d6 100644
--- a/packages/eslint-plugin/src/rules/ban-types.ts
+++ b/packages/eslint-plugin/src/rules/ban-types.ts
@@ -5,14 +5,14 @@ import * as util from '../util';
type Types = Record<
string,
- | null
- | false
+ | boolean
| string
| {
message: string;
fixWith?: string;
suggest?: readonly string[];
}
+ | null
>;
export type Options = [
@@ -35,9 +35,9 @@ function stringifyNode(
}
function getCustomMessage(
- bannedType: null | string | { message?: string; fixWith?: string },
+ bannedType: string | true | { message?: string; fixWith?: string } | null,
): string {
- if (bannedType == null) {
+ if (bannedType == null || bannedType === true) {
return '';
}
@@ -130,7 +130,7 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow certain types',
- recommended: 'error',
+ recommended: 'recommended',
},
fixable: 'code',
hasSuggestions: true,
@@ -140,28 +140,59 @@ export default util.createRule({
},
schema: [
{
+ $defs: {
+ banConfig: {
+ oneOf: [
+ {
+ type: 'null',
+ description: 'Bans the type with the default message',
+ },
+ {
+ type: 'boolean',
+ enum: [false],
+ description:
+ 'Un-bans the type (useful when paired with `extendDefaults`)',
+ },
+ {
+ type: 'boolean',
+ enum: [true],
+ description: 'Bans the type with the default message',
+ },
+ {
+ type: 'string',
+ description: 'Bans the type with a custom message',
+ },
+ {
+ type: 'object',
+ description: 'Bans a type',
+ properties: {
+ message: {
+ type: 'string',
+ description: 'Custom error message',
+ },
+ fixWith: {
+ type: 'string',
+ description:
+ 'Type to autofix replace with. Note that autofixers can be applied automatically - so you need to be careful with this option.',
+ },
+ suggest: {
+ type: 'array',
+ items: { type: 'string' },
+ description: 'Types to suggest replacing with.',
+ additionalItems: false,
+ },
+ },
+ additionalProperties: false,
+ },
+ ],
+ },
+ },
type: 'object',
properties: {
types: {
type: 'object',
additionalProperties: {
- oneOf: [
- { type: 'null' },
- { type: 'boolean' },
- { type: 'string' },
- {
- type: 'object',
- properties: {
- message: { type: 'string' },
- fixWith: { type: 'string' },
- suggest: {
- type: 'array',
- items: { type: 'string' },
- },
- },
- additionalProperties: false,
- },
- ],
+ $ref: '#/items/0/$defs/banConfig',
},
},
extendDefaults: {
@@ -256,7 +287,7 @@ export default util.createRule({
TSTypeReference(node): void {
checkBannedTypes(node.typeName);
- if (node.typeParameters) {
+ if (node.typeArguments) {
checkBannedTypes(node);
}
},
diff --git a/packages/eslint-plugin/src/rules/block-spacing.ts b/packages/eslint-plugin/src/rules/block-spacing.ts
index 745132978f77..8141a979cf04 100644
--- a/packages/eslint-plugin/src/rules/block-spacing.ts
+++ b/packages/eslint-plugin/src/rules/block-spacing.ts
@@ -16,7 +16,6 @@ export default util.createRule({
docs: {
description:
'Disallow or enforce spaces inside of blocks after opening block and before closing block',
- recommended: false,
extendsBaseRule: true,
},
fixable: 'whitespace',
diff --git a/packages/eslint-plugin/src/rules/brace-style.ts b/packages/eslint-plugin/src/rules/brace-style.ts
index 43d4ba63c3cf..2e471cb88532 100644
--- a/packages/eslint-plugin/src/rules/brace-style.ts
+++ b/packages/eslint-plugin/src/rules/brace-style.ts
@@ -18,7 +18,6 @@ export default createRule({
type: 'layout',
docs: {
description: 'Enforce consistent brace style for blocks',
- recommended: false,
extendsBaseRule: true,
},
messages: baseRule.meta.messages,
@@ -120,7 +119,7 @@ export default createRule({
return {
...rules,
'TSInterfaceBody, TSModuleBlock'(
- node: TSESTree.TSModuleBlock | TSESTree.TSInterfaceBody,
+ node: TSESTree.TSInterfaceBody | TSESTree.TSModuleBlock,
): void {
const openingCurly = sourceCode.getFirstToken(node)!;
const closingCurly = sourceCode.getLastToken(node)!;
diff --git a/packages/eslint-plugin/src/rules/class-literal-property-style.ts b/packages/eslint-plugin/src/rules/class-literal-property-style.ts
index d1eb4ae44703..bd9e0895e719 100644
--- a/packages/eslint-plugin/src/rules/class-literal-property-style.ts
+++ b/packages/eslint-plugin/src/rules/class-literal-property-style.ts
@@ -17,7 +17,7 @@ interface NodeWithModifiers {
const printNodeModifiers = (
node: NodeWithModifiers,
- final: 'readonly' | 'get',
+ final: 'get' | 'readonly',
): string =>
`${node.accessibility ?? ''}${
node.static ? ' static' : ''
@@ -47,7 +47,7 @@ export default util.createRule({
docs: {
description:
'Enforce that literals on classes are exposed in a consistent style',
- recommended: 'strict',
+ recommended: 'stylistic',
},
hasSuggestions: true,
messages: {
@@ -56,7 +56,12 @@ export default util.createRule({
preferGetterStyle: 'Literals should be exposed using getters.',
preferGetterStyleSuggestion: 'Replace the literals with getters.',
},
- schema: [{ enum: ['fields', 'getters'] }],
+ schema: [
+ {
+ type: 'string',
+ enum: ['fields', 'getters'],
+ },
+ ],
},
defaultOptions: ['fields'],
create(context, [style]) {
@@ -66,7 +71,7 @@ export default util.createRule({
if (
node.kind !== 'get' ||
!node.value.body ||
- !node.value.body.body.length
+ node.value.body.body.length === 0
) {
return;
}
diff --git a/packages/eslint-plugin/src/rules/comma-dangle.ts b/packages/eslint-plugin/src/rules/comma-dangle.ts
index 149218c4e7e5..a87e48ec082a 100644
--- a/packages/eslint-plugin/src/rules/comma-dangle.ts
+++ b/packages/eslint-plugin/src/rules/comma-dangle.ts
@@ -44,15 +44,16 @@ export default util.createRule({
type: 'layout',
docs: {
description: 'Require or disallow trailing commas',
- recommended: false,
extendsBaseRule: true,
},
schema: {
$defs: {
value: {
+ type: 'string',
enum: OPTION_VALUE_SCHEME,
},
valueWithIgnore: {
+ type: 'string',
enum: [...OPTION_VALUE_SCHEME, 'ignore'],
},
},
@@ -80,7 +81,7 @@ export default util.createRule({
],
},
],
- additionalProperties: false,
+ additionalItems: false,
},
fixable: 'code',
hasSuggestions: baseRule.meta.hasSuggestions,
@@ -97,7 +98,7 @@ export default util.createRule({
'always-multiline': forceCommaIfMultiline,
'only-multiline': allowCommaIfMultiline,
never: forbidComma,
- ignore: (): void => {},
+ ignore: undefined,
};
function last(nodes: TSESTree.Node[]): TSESTree.Node | null {
diff --git a/packages/eslint-plugin/src/rules/comma-spacing.ts b/packages/eslint-plugin/src/rules/comma-spacing.ts
index 19133a2039f0..9c6e64cfc5c8 100644
--- a/packages/eslint-plugin/src/rules/comma-spacing.ts
+++ b/packages/eslint-plugin/src/rules/comma-spacing.ts
@@ -16,7 +16,7 @@ type Options = [
after: boolean;
},
];
-type MessageIds = 'unexpected' | 'missing';
+type MessageIds = 'missing' | 'unexpected';
export default createRule({
name: 'comma-spacing',
@@ -24,7 +24,6 @@ export default createRule({
type: 'layout',
docs: {
description: 'Enforce consistent spacing before and after commas',
- recommended: false,
extendsBaseRule: true,
},
fixable: 'whitespace',
diff --git a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts
index dfcb5d4a63db..8719d0b5dc5d 100644
--- a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts
+++ b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts
@@ -3,8 +3,8 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import { createRule } from '../util';
-type MessageIds = 'preferTypeAnnotation' | 'preferConstructor';
-type Options = ['type-annotation' | 'constructor'];
+type MessageIds = 'preferConstructor' | 'preferTypeAnnotation';
+type Options = ['constructor' | 'type-annotation'];
export default createRule({
name: 'consistent-generic-constructors',
@@ -13,7 +13,7 @@ export default createRule({
docs: {
description:
'Enforce specifying generic type arguments on type annotation or constructor name of a constructor call',
- recommended: 'strict',
+ recommended: 'stylistic',
},
messages: {
preferTypeAnnotation:
@@ -24,6 +24,7 @@ export default createRule({
fixable: 'code',
schema: [
{
+ type: 'string',
enum: ['type-annotation', 'constructor'],
},
],
@@ -34,9 +35,9 @@ export default createRule({
return {
'VariableDeclarator,PropertyDefinition,:matches(FunctionDeclaration,FunctionExpression) > AssignmentPattern'(
node:
- | TSESTree.VariableDeclarator
+ | TSESTree.AssignmentPattern
| TSESTree.PropertyDefinition
- | TSESTree.AssignmentPattern,
+ | TSESTree.VariableDeclarator,
): void {
function getLHSRHS(): [
TSESTree.BindingName | TSESTree.PropertyDefinition,
@@ -74,17 +75,17 @@ export default createRule({
return;
}
if (mode === 'type-annotation') {
- if (!lhs && rhs.typeParameters) {
- const { typeParameters, callee } = rhs;
+ if (!lhs && rhs.typeArguments) {
+ const { typeArguments, callee } = rhs;
const typeAnnotation =
- sourceCode.getText(callee) + sourceCode.getText(typeParameters);
+ sourceCode.getText(callee) + sourceCode.getText(typeArguments);
context.report({
node,
messageId: 'preferTypeAnnotation',
fix(fixer) {
function getIDToAttachAnnotation():
- | TSESTree.Token
- | TSESTree.Node {
+ | TSESTree.Node
+ | TSESTree.Token {
if (node.type !== AST_NODE_TYPES.PropertyDefinition) {
return lhsName;
}
@@ -96,7 +97,7 @@ export default createRule({
return sourceCode.getTokenAfter(node.key)!;
}
return [
- fixer.remove(typeParameters),
+ fixer.remove(typeArguments),
fixer.insertTextAfter(
getIDToAttachAnnotation(),
': ' + typeAnnotation,
@@ -108,20 +109,20 @@ export default createRule({
return;
}
if (mode === 'constructor') {
- if (lhs?.typeParameters && !rhs.typeParameters) {
+ if (lhs?.typeArguments && !rhs.typeArguments) {
const hasParens =
sourceCode.getTokenAfter(rhs.callee)?.value === '(';
const extraComments = new Set(
- sourceCode.getCommentsInside(lhs.parent!),
+ sourceCode.getCommentsInside(lhs.parent),
);
sourceCode
- .getCommentsInside(lhs.typeParameters)
+ .getCommentsInside(lhs.typeArguments)
.forEach(c => extraComments.delete(c));
context.report({
node,
messageId: 'preferConstructor',
*fix(fixer) {
- yield fixer.remove(lhs.parent!);
+ yield fixer.remove(lhs.parent);
for (const comment of extraComments) {
yield fixer.insertTextAfter(
rhs.callee,
@@ -130,7 +131,7 @@ export default createRule({
}
yield fixer.insertTextAfter(
rhs.callee,
- sourceCode.getText(lhs.typeParameters),
+ sourceCode.getText(lhs.typeArguments),
);
if (!hasParens) {
yield fixer.insertTextAfter(rhs.callee, '()');
diff --git a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts
index 535692f3fa86..5aece3ea4802 100644
--- a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts
+++ b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts
@@ -3,8 +3,8 @@ import { AST_NODE_TYPES, ASTUtils } from '@typescript-eslint/utils';
import { createRule } from '../util';
-type MessageIds = 'preferRecord' | 'preferIndexSignature';
-type Options = ['record' | 'index-signature'];
+type MessageIds = 'preferIndexSignature' | 'preferRecord';
+type Options = ['index-signature' | 'record'];
export default createRule({
name: 'consistent-indexed-object-style',
@@ -12,7 +12,7 @@ export default createRule({
type: 'suggestion',
docs: {
description: 'Require or disallow the `Record` type',
- recommended: 'strict',
+ recommended: 'stylistic',
},
messages: {
preferRecord: 'A record is preferred over an index signature.',
@@ -21,6 +21,7 @@ export default createRule({
fixable: 'code',
schema: [
{
+ type: 'string',
enum: ['record', 'index-signature'],
},
],
@@ -31,7 +32,7 @@ export default createRule({
function checkMembers(
members: TSESTree.TypeElement[],
- node: TSESTree.TSTypeLiteral | TSESTree.TSInterfaceDeclaration,
+ node: TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeLiteral,
parentId: TSESTree.Identifier | undefined,
prefix: string,
postfix: string,
@@ -108,7 +109,7 @@ export default createRule({
return;
}
- const params = node.typeParameters?.params;
+ const params = node.typeArguments?.params;
if (params?.length !== 2) {
return;
}
@@ -132,8 +133,8 @@ export default createRule({
TSInterfaceDeclaration(node): void {
let genericTypes = '';
- if ((node.typeParameters?.params ?? []).length > 0) {
- genericTypes = `<${node.typeParameters?.params
+ if (node.typeParameters?.params?.length) {
+ genericTypes = `<${node.typeParameters.params
.map(p => sourceCode.getText(p))
.join(', ')}>`;
}
diff --git a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts
index 58403fe8a141..9903f15e19e4 100644
--- a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts
+++ b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts
@@ -4,22 +4,22 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
// intentionally mirroring the options
-type MessageIds =
- | 'as'
+export type MessageIds =
| 'angle-bracket'
+ | 'as'
| 'never'
- | 'unexpectedObjectTypeAssertion'
| 'replaceObjectTypeAssertionWithAnnotation'
- | 'replaceObjectTypeAssertionWithSatisfies';
+ | 'replaceObjectTypeAssertionWithSatisfies'
+ | 'unexpectedObjectTypeAssertion';
type OptUnion =
| {
- assertionStyle: 'as' | 'angle-bracket';
- objectLiteralTypeAssertions?: 'allow' | 'allow-as-parameter' | 'never';
+ assertionStyle: 'angle-bracket' | 'as';
+ objectLiteralTypeAssertions?: 'allow-as-parameter' | 'allow' | 'never';
}
| {
assertionStyle: 'never';
};
-type Options = [OptUnion];
+export type Options = readonly [OptUnion];
export default util.createRule({
name: 'consistent-type-assertions',
@@ -29,7 +29,7 @@ export default util.createRule({
hasSuggestions: true,
docs: {
description: 'Enforce consistent usage of type assertions',
- recommended: 'strict',
+ recommended: 'stylistic',
},
messages: {
as: "Use 'as {{cast}}' instead of '<{{cast}}>'.",
@@ -48,6 +48,7 @@ export default util.createRule({
type: 'object',
properties: {
assertionStyle: {
+ type: 'string',
enum: ['never'],
},
},
@@ -58,9 +59,11 @@ export default util.createRule({
type: 'object',
properties: {
assertionStyle: {
+ type: 'string',
enum: ['as', 'angle-bracket'],
},
objectLiteralTypeAssertions: {
+ type: 'string',
enum: ['allow', 'allow-as-parameter', 'never'],
},
},
@@ -114,7 +117,7 @@ export default util.createRule({
}
function reportIncorrectAssertionType(
- node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression,
+ node: TSESTree.TSAsExpression | TSESTree.TSTypeAssertion,
): void {
const messageId = options.assertionStyle;
@@ -165,7 +168,7 @@ export default util.createRule({
}
function checkExpression(
- node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression,
+ node: TSESTree.TSAsExpression | TSESTree.TSTypeAssertion,
): void {
if (
options.assertionStyle === 'never' ||
@@ -177,7 +180,6 @@ export default util.createRule({
if (
options.objectLiteralTypeAssertions === 'allow-as-parameter' &&
- node.parent &&
(node.parent.type === AST_NODE_TYPES.NewExpression ||
node.parent.type === AST_NODE_TYPES.CallExpression ||
node.parent.type === AST_NODE_TYPES.ThrowStatement ||
diff --git a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts
index fdf7ac947c6f..b504081ee4a1 100644
--- a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts
+++ b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts
@@ -10,7 +10,7 @@ export default util.createRule({
docs: {
description:
'Enforce type definitions to consistently use either `interface` or `type`',
- recommended: 'strict',
+ recommended: 'stylistic',
},
messages: {
interfaceOverType: 'Use an `interface` instead of a `type`.',
@@ -18,6 +18,7 @@ export default util.createRule({
},
schema: [
{
+ type: 'string',
enum: ['interface', 'type'],
},
],
diff --git a/packages/eslint-plugin/src/rules/consistent-type-exports.ts b/packages/eslint-plugin/src/rules/consistent-type-exports.ts
index 54364054690f..e65451ded1da 100644
--- a/packages/eslint-plugin/src/rules/consistent-type-exports.ts
+++ b/packages/eslint-plugin/src/rules/consistent-type-exports.ts
@@ -1,8 +1,4 @@
-import type {
- ParserServices,
- TSESLint,
- TSESTree,
-} from '@typescript-eslint/utils';
+import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import { SymbolFlags } from 'typescript';
@@ -29,9 +25,9 @@ interface ReportValueExport {
}
type MessageIds =
- | 'typeOverValue'
+ | 'multipleExportsAreTypes'
| 'singleExportIsType'
- | 'multipleExportsAreTypes';
+ | 'typeOverValue';
export default util.createRule({
name: 'consistent-type-exports',
@@ -39,7 +35,6 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Enforce consistent usage of type exports',
- recommended: false,
requiresTypeChecking: true,
},
messages: {
@@ -73,7 +68,29 @@ export default util.createRule({
create(context, [{ fixMixedExportsWithInlineTypeSpecifier }]) {
const sourceCode = context.getSourceCode();
const sourceExportsMap: { [key: string]: SourceExports } = {};
- const parserServices = util.getParserServices(context);
+ const services = util.getParserServices(context);
+
+ /**
+ * Helper for identifying if an export specifier resolves to a
+ * JavaScript value or a TypeScript type.
+ *
+ * @returns True/false if is a type or not, or undefined if the specifier
+ * can't be resolved.
+ */
+ function isSpecifierTypeBased(
+ specifier: TSESTree.ExportSpecifier,
+ ): boolean | undefined {
+ const checker = services.program.getTypeChecker();
+ const symbol = services.getSymbolAtLocation(specifier.exported);
+ const aliasedSymbol = checker.getAliasedSymbol(symbol!);
+
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
+ if (!aliasedSymbol || aliasedSymbol.escapedName === 'unknown') {
+ return undefined;
+ }
+
+ return !(aliasedSymbol.flags & SymbolFlags.Value);
+ }
return {
ExportNamedDeclaration(node: TSESTree.ExportNamedDeclaration): void {
@@ -112,7 +129,7 @@ export default util.createRule({
continue;
}
- const isTypeBased = isSpecifierTypeBased(parserServices, specifier);
+ const isTypeBased = isSpecifierTypeBased(specifier);
if (isTypeBased === true) {
typeBasedSpecifiers.push(specifier);
@@ -199,29 +216,6 @@ export default util.createRule({
},
});
-/**
- * Helper for identifying if an export specifier resolves to a
- * JavaScript value or a TypeScript type.
- *
- * @returns True/false if is a type or not, or undefined if the specifier
- * can't be resolved.
- */
-function isSpecifierTypeBased(
- parserServices: ParserServices,
- specifier: TSESTree.ExportSpecifier,
-): boolean | undefined {
- const checker = parserServices.program.getTypeChecker();
- const node = parserServices.esTreeNodeToTSNodeMap.get(specifier.exported);
- const symbol = checker.getSymbolAtLocation(node);
- const aliasedSymbol = checker.getAliasedSymbol(symbol!);
-
- if (!aliasedSymbol || aliasedSymbol.escapedName === 'unknown') {
- return undefined;
- }
-
- return !(aliasedSymbol.flags & SymbolFlags.Value);
-}
-
/**
* Inserts "type" into an export.
*
diff --git a/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/packages/eslint-plugin/src/rules/consistent-type-imports.ts
index 4c5cf771901d..dfa5e48ed652 100644
--- a/packages/eslint-plugin/src/rules/consistent-type-imports.ts
+++ b/packages/eslint-plugin/src/rules/consistent-type-imports.ts
@@ -3,8 +3,8 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
-type Prefer = 'type-imports' | 'no-type-imports';
-type FixStyle = 'separate-type-imports' | 'inline-type-imports';
+type Prefer = 'no-type-imports' | 'type-imports';
+type FixStyle = 'inline-type-imports' | 'separate-type-imports';
type Options = [
{
@@ -33,20 +33,19 @@ interface ReportValueImport {
}
type MessageIds =
- | 'typeOverValue'
- | 'someImportsAreOnlyTypes'
+ | 'aImportInDecoMeta'
| 'aImportIsOnlyTypes'
- | 'valueOverType'
| 'noImportTypeAnnotations'
+ | 'someImportsAreOnlyTypes'
| 'someImportsInDecoMeta'
- | 'aImportInDecoMeta';
+ | 'typeOverValue'
+ | 'valueOverType';
export default util.createRule({
name: 'consistent-type-imports',
meta: {
type: 'suggestion',
docs: {
description: 'Enforce consistent usage of type imports',
- recommended: false,
},
messages: {
typeOverValue:
@@ -66,12 +65,14 @@ export default util.createRule({
type: 'object',
properties: {
prefer: {
+ type: 'string',
enum: ['type-imports', 'no-type-imports'],
},
disallowTypeAnnotations: {
type: 'boolean',
},
fixStyle: {
+ type: 'string',
enum: ['separate-type-imports', 'inline-type-imports'],
},
},
diff --git a/packages/eslint-plugin/src/rules/default-param-last.ts b/packages/eslint-plugin/src/rules/default-param-last.ts
index ba9d5da7b4ec..e76ce14fa057 100644
--- a/packages/eslint-plugin/src/rules/default-param-last.ts
+++ b/packages/eslint-plugin/src/rules/default-param-last.ts
@@ -9,7 +9,6 @@ export default createRule({
type: 'suggestion',
docs: {
description: 'Enforce default parameters to be last',
- recommended: false,
extendsBaseRule: true,
},
schema: [],
diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts
index 9f0b0d1304bf..d79c8fcdb5eb 100644
--- a/packages/eslint-plugin/src/rules/dot-notation.ts
+++ b/packages/eslint-plugin/src/rules/dot-notation.ts
@@ -1,5 +1,5 @@
import type { TSESTree } from '@typescript-eslint/utils';
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as ts from 'typescript';
import type {
@@ -20,7 +20,7 @@ export default createRule({
type: 'suggestion',
docs: {
description: 'Enforce dot notation whenever possible',
- recommended: 'strict',
+ recommended: 'stylistic',
extendsBaseRule: true,
requiresTypeChecking: true,
},
@@ -67,9 +67,7 @@ export default createRule({
],
create(context, [options]) {
const rules = baseRule.create(context);
-
- const { program, esTreeNodeToTSNodeMap } = getParserServices(context);
- const typeChecker = program.getTypeChecker();
+ const services = getParserServices(context);
const allowPrivateClassPropertyAccess =
options.allowPrivateClassPropertyAccess;
@@ -78,8 +76,7 @@ export default createRule({
const allowIndexSignaturePropertyAccess =
(options.allowIndexSignaturePropertyAccess ?? false) ||
tsutils.isCompilerOptionEnabled(
- program.getCompilerOptions(),
- // @ts-expect-error - TS is refining the type to never for some reason
+ services.program.getCompilerOptions(),
'noPropertyAccessFromIndexSignature',
);
@@ -92,9 +89,7 @@ export default createRule({
node.computed
) {
// for perf reasons - only fetch symbols if we have to
- const propertySymbol = typeChecker.getSymbolAtLocation(
- esTreeNodeToTSNodeMap.get(node.property),
- );
+ const propertySymbol = services.getSymbolAtLocation(node.property);
const modifierKind = getModifiers(
propertySymbol?.getDeclarations()?.[0],
)?.[0].kind;
@@ -110,9 +105,7 @@ export default createRule({
propertySymbol === undefined &&
allowIndexSignaturePropertyAccess
) {
- const objectType = typeChecker.getTypeAtLocation(
- esTreeNodeToTSNodeMap.get(node.object),
- );
+ const objectType = services.getTypeAtLocation(node.object);
const indexType = objectType
.getNonNullableType()
.getStringIndexType();
diff --git a/packages/eslint-plugin/src/rules/enum-utils/shared.ts b/packages/eslint-plugin/src/rules/enum-utils/shared.ts
index 6a3349143aa6..e629d00e7be7 100644
--- a/packages/eslint-plugin/src/rules/enum-utils/shared.ts
+++ b/packages/eslint-plugin/src/rules/enum-utils/shared.ts
@@ -1,4 +1,4 @@
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as ts from 'typescript';
import * as util from '../../util';
diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts
index b19ec1527ec0..e57465be8365 100644
--- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts
+++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts
@@ -29,7 +29,6 @@ export default util.createRule({
docs: {
description:
'Require explicit return types on functions and class methods',
- recommended: false,
},
messages: {
missingReturnType: 'Missing return type on function.',
@@ -103,8 +102,8 @@ export default util.createRule({
function isAllowedFunction(
node:
| TSESTree.ArrowFunctionExpression
- | TSESTree.FunctionExpression
- | TSESTree.FunctionDeclaration,
+ | TSESTree.FunctionDeclaration
+ | TSESTree.FunctionExpression,
): boolean {
if (options.allowFunctionsWithoutTypeParameters && !node.typeParameters) {
return true;
@@ -165,10 +164,10 @@ export default util.createRule({
function isIIFE(
node:
| TSESTree.ArrowFunctionExpression
- | TSESTree.FunctionExpression
- | TSESTree.FunctionDeclaration,
+ | TSESTree.FunctionDeclaration
+ | TSESTree.FunctionExpression,
): boolean {
- return node.parent!.type === AST_NODE_TYPES.CallExpression;
+ return node.parent.type === AST_NODE_TYPES.CallExpression;
}
return {
diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
index 3fc42a956f68..d95a58dc281e 100644
--- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
+++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
@@ -23,26 +23,9 @@ interface Config {
type Options = [Config];
type MessageIds =
- | 'unwantedPublicAccessibility'
+ | 'addExplicitAccessibility'
| 'missingAccessibility'
- | 'addExplicitAccessibility';
-
-const accessibilityLevel = {
- oneOf: [
- {
- const: 'explicit',
- description: 'Always require an accessor.',
- },
- {
- const: 'no-public',
- description: 'Require an accessor except when public.',
- },
- {
- const: 'off',
- description: 'Never check whether there is an accessor.',
- },
- ],
-};
+ | 'unwantedPublicAccessibility';
export default util.createRule({
name: 'explicit-member-accessibility',
@@ -53,7 +36,6 @@ export default util.createRule({
description:
'Require explicit accessibility modifiers on class properties and methods',
// too opinionated to be recommended
- recommended: false,
},
fixable: 'code',
messages: {
@@ -63,41 +45,56 @@ export default util.createRule({
'Public accessibility modifier on {{type}} {{name}}.',
addExplicitAccessibility: "Add '{{ type }}' accessibility modifier",
},
- schema: {
- $defs: {
- accessibilityLevel,
- },
- prefixItems: [
- {
- type: 'object',
- properties: {
- accessibility: { $ref: '#/$defs/accessibilityLevel' },
- overrides: {
- type: 'object',
- properties: {
- accessors: { $ref: '#/$defs/accessibilityLevel' },
- constructors: { $ref: '#/$defs/accessibilityLevel' },
- methods: { $ref: '#/$defs/accessibilityLevel' },
- properties: { $ref: '#/$defs/accessibilityLevel' },
- parameterProperties: {
- $ref: '#/$defs/accessibilityLevel',
- },
+ schema: [
+ {
+ $defs: {
+ accessibilityLevel: {
+ oneOf: [
+ {
+ type: 'string',
+ enum: ['explicit'],
+ description: 'Always require an accessor.',
},
-
- additionalProperties: false,
- },
- ignoredMethodNames: {
- type: 'array',
- items: {
+ {
type: 'string',
+ enum: ['no-public'],
+ description: 'Require an accessor except when public.',
+ },
+ {
+ type: 'string',
+ enum: ['off'],
+ description: 'Never check whether there is an accessor.',
+ },
+ ],
+ },
+ },
+ type: 'object',
+ properties: {
+ accessibility: { $ref: '#/items/0/$defs/accessibilityLevel' },
+ overrides: {
+ type: 'object',
+ properties: {
+ accessors: { $ref: '#/items/0/$defs/accessibilityLevel' },
+ constructors: { $ref: '#/items/0/$defs/accessibilityLevel' },
+ methods: { $ref: '#/items/0/$defs/accessibilityLevel' },
+ properties: { $ref: '#/items/0/$defs/accessibilityLevel' },
+ parameterProperties: {
+ $ref: '#/items/0/$defs/accessibilityLevel',
},
},
+
+ additionalProperties: false,
+ },
+ ignoredMethodNames: {
+ type: 'array',
+ items: {
+ type: 'string',
+ },
},
- additionalProperties: false,
},
- ],
- type: 'array',
- },
+ additionalProperties: false,
+ },
+ ],
},
defaultOptions: [{ accessibility: 'explicit' }],
create(context, [option]) {
@@ -230,7 +227,7 @@ export default util.createRule({
accessibility: TSESTree.Accessibility,
fixer: TSESLint.RuleFixer,
): TSESLint.RuleFix | null {
- if (node?.decorators?.length) {
+ if (node?.decorators.length) {
const lastDecorator = node.decorators[node.decorators.length - 1];
const nextToken = sourceCode.getTokenAfter(lastDecorator)!;
return fixer.insertTextBefore(nextToken, `${accessibility} `);
diff --git a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts
index e7552e0cbd8f..1ac7e70bb9f8 100644
--- a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts
+++ b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts
@@ -22,15 +22,14 @@ type Options = [
allowedNames?: string[];
allowHigherOrderFunctions?: boolean;
allowTypedFunctionExpressions?: boolean;
- shouldTrackReferences?: boolean;
},
];
type MessageIds =
- | 'missingReturnType'
+ | 'anyTypedArg'
+ | 'anyTypedArgUnnamed'
| 'missingArgType'
| 'missingArgTypeUnnamed'
- | 'anyTypedArg'
- | 'anyTypedArgUnnamed';
+ | 'missingReturnType';
export default util.createRule({
name: 'explicit-module-boundary-types',
@@ -39,7 +38,6 @@ export default util.createRule({
docs: {
description:
"Require explicit return and argument types on exported functions' and classes' public class methods",
- recommended: false,
},
messages: {
missingReturnType: 'Missing return type on function.',
@@ -85,10 +83,6 @@ export default util.createRule({
'Whether to ignore type annotations on the variable of a function expresion.',
type: 'boolean',
},
- // DEPRECATED - To be removed in next major
- shouldTrackReferences: {
- type: 'boolean',
- },
},
additionalProperties: false,
},
@@ -160,7 +154,7 @@ export default util.createRule({
};
function checkParameters(
- node: TSESTree.TSEmptyBodyFunctionExpression | FunctionNode,
+ node: FunctionNode | TSESTree.TSEmptyBodyFunctionExpression,
): void {
function checkParameter(param: TSESTree.Parameter): void {
function report(
@@ -235,7 +229,7 @@ export default util.createRule({
* Checks if a function name is allowed and should not be checked.
*/
function isAllowedName(node: TSESTree.Node | undefined): boolean {
- if (!node || !options.allowedNames || !options.allowedNames.length) {
+ if (!node || !options.allowedNames || options.allowedNames.length === 0) {
return false;
}
@@ -274,7 +268,7 @@ export default util.createRule({
}
function isExportedHigherOrderFunction(node: FunctionNode): boolean {
- let current = node.parent;
+ let current: TSESTree.Node | undefined = node.parent;
while (current) {
if (current.type === AST_NODE_TYPES.ReturnStatement) {
// the parent of a return will always be a block statement, so we can skip over it
diff --git a/packages/eslint-plugin/src/rules/func-call-spacing.ts b/packages/eslint-plugin/src/rules/func-call-spacing.ts
index 31d8fa41046e..b72c54951f92 100644
--- a/packages/eslint-plugin/src/rules/func-call-spacing.ts
+++ b/packages/eslint-plugin/src/rules/func-call-spacing.ts
@@ -3,15 +3,15 @@ import type { TSESTree } from '@typescript-eslint/utils';
import * as util from '../util';
export type Options = [
- 'never' | 'always',
+ 'always' | 'never',
{
allowNewlines?: boolean;
}?,
];
export type MessageIds =
- | 'unexpectedWhitespace'
+ | 'missing'
| 'unexpectedNewline'
- | 'missing';
+ | 'unexpectedWhitespace';
export default util.createRule({
name: 'func-call-spacing',
@@ -20,7 +20,6 @@ export default util.createRule({
docs: {
description:
'Require or disallow spacing between function identifiers and their invocations',
- recommended: false,
extendsBaseRule: true,
},
fixable: 'whitespace',
@@ -30,6 +29,7 @@ export default util.createRule({
type: 'array',
items: [
{
+ type: 'string',
enum: ['never'],
},
],
@@ -40,6 +40,7 @@ export default util.createRule({
type: 'array',
items: [
{
+ type: 'string',
enum: ['always'],
},
{
@@ -83,7 +84,7 @@ export default util.createRule({
const closingParenToken = sourceCode.getLastToken(node)!;
const lastCalleeTokenWithoutPossibleParens = sourceCode.getLastToken(
- node.typeParameters ?? node.callee,
+ node.typeArguments ?? node.callee,
)!;
const openingParenToken = sourceCode.getFirstTokenBetween(
lastCalleeTokenWithoutPossibleParens,
diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts
index 19796054a4c6..f2f3805d800d 100644
--- a/packages/eslint-plugin/src/rules/indent.ts
+++ b/packages/eslint-plugin/src/rules/indent.ts
@@ -91,7 +91,6 @@ export default util.createRule({
docs: {
description: 'Enforce consistent indentation',
// too opinionated to be recommended
- recommended: false,
extendsBaseRule: true,
},
fixable: 'whitespace',
@@ -131,12 +130,12 @@ export default util.createRule({
*/
function TSPropertySignatureToProperty(
node:
- | TSESTree.TSPropertySignature
| TSESTree.TSEnumMember
+ | TSESTree.TSPropertySignature
| TSESTree.TypeElement,
type:
- | AST_NODE_TYPES.PropertyDefinition
- | AST_NODE_TYPES.Property = AST_NODE_TYPES.Property,
+ | AST_NODE_TYPES.Property
+ | AST_NODE_TYPES.PropertyDefinition = AST_NODE_TYPES.Property,
): TSESTree.Node | null {
const base = {
// indent doesn't actually use these
@@ -163,9 +162,15 @@ export default util.createRule({
} else {
return {
type,
- static: false,
- readonly: false,
+ accessibility: undefined,
declare: false,
+ decorators: [],
+ definite: false,
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ typeAnnotation: undefined,
...base,
} as TSESTree.PropertyDefinition;
}
@@ -193,7 +198,7 @@ export default util.createRule({
// transform it to a BinaryExpression
return rules['BinaryExpression, LogicalExpression']({
type: AST_NODE_TYPES.BinaryExpression,
- operator: 'as',
+ operator: 'as' as any,
left: node.expression,
// the first typeAnnotation includes the as token
right: node.typeAnnotation as any,
@@ -210,8 +215,9 @@ export default util.createRule({
return rules.ConditionalExpression({
type: AST_NODE_TYPES.ConditionalExpression,
test: {
+ parent: node,
type: AST_NODE_TYPES.BinaryExpression,
- operator: 'extends',
+ operator: 'extends' as any,
left: node.checkType as any,
right: node.extendsType as any,
@@ -297,6 +303,7 @@ export default util.createRule({
},
} as TSESTree.VariableDeclarator,
],
+ declare: false,
// location data
parent: node.parent,
@@ -351,7 +358,14 @@ export default util.createRule({
body: node.body as any,
id: null,
// TODO: This is invalid, there can be more than one extends in interface
- superClass: node.extends![0].expression as any,
+ superClass: node.extends[0].expression as any,
+ abstract: false,
+ declare: false,
+ decorators: [],
+ implements: [],
+ superTypeArguments: undefined,
+ superTypeParameters: undefined,
+ typeParameters: undefined,
// location data
parent: node.parent,
@@ -371,6 +385,7 @@ export default util.createRule({
type: AST_NODE_TYPES.ObjectExpression,
properties: [
{
+ parent: node,
type: AST_NODE_TYPES.Property,
key: node.typeParameter as any,
value: node.typeAnnotation as any,
@@ -391,6 +406,7 @@ export default util.createRule({
kind: 'init' as const,
computed: false,
method: false,
+ optional: false,
shorthand: false,
},
],
@@ -457,6 +473,8 @@ export default util.createRule({
selfClosing: false,
name: name as any,
attributes: attributes as any,
+ typeArguments: undefined,
+ typeParameters: undefined,
// location data
parent: node.parent,
diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts
index 405514edd1f0..f5cf92c28d16 100644
--- a/packages/eslint-plugin/src/rules/index.ts
+++ b/packages/eslint-plugin/src/rules/index.ts
@@ -37,7 +37,6 @@ import confusingNonNullAssertionLikeNotEqual from './no-confusing-non-null-asser
import noConfusingVoidExpression from './no-confusing-void-expression';
import noDupeClassMembers from './no-dupe-class-members';
import noDuplicateEnumValues from './no-duplicate-enum-values';
-import noDuplicateImports from './no-duplicate-imports';
import noDuplicateTypeConstituents from './no-duplicate-type-constituents';
import noDynamicDelete from './no-dynamic-delete';
import noEmptyFunction from './no-empty-function';
@@ -49,7 +48,6 @@ import noExtraSemi from './no-extra-semi';
import noExtraneousClass from './no-extraneous-class';
import noFloatingPromises from './no-floating-promises';
import noForInArray from './no-for-in-array';
-import noImplicitAnyCatch from './no-implicit-any-catch';
import noImpliedEval from './no-implied-eval';
import noImportTypeSideEffects from './no-import-type-side-effects';
import noInferrableTypes from './no-inferrable-types';
@@ -66,7 +64,6 @@ import noNamespace from './no-namespace';
import noNonNullAssertedNullishCoalescing from './no-non-null-asserted-nullish-coalescing';
import noNonNullAssertedOptionalChain from './no-non-null-asserted-optional-chain';
import noNonNullAssertion from './no-non-null-assertion';
-import noParameterProperties from './no-parameter-properties';
import noRedeclare from './no-redeclare';
import noRedundantTypeConstituents from './no-redundant-type-constituents';
import noRequireImports from './no-require-imports';
@@ -123,7 +120,6 @@ import restrictTemplateExpressions from './restrict-template-expressions';
import returnAwait from './return-await';
import semi from './semi';
import sortTypeConstituents from './sort-type-constituents';
-import sortTypeUnionIntersectionMembers from './sort-type-union-intersection-members';
import spaceBeforeBlocks from './space-before-blocks';
import spaceBeforeFunctionParen from './space-before-function-paren';
import spaceInfixOps from './space-infix-ops';
@@ -175,7 +171,6 @@ export default {
'no-confusing-void-expression': noConfusingVoidExpression,
'no-dupe-class-members': noDupeClassMembers,
'no-duplicate-enum-values': noDuplicateEnumValues,
- 'no-duplicate-imports': noDuplicateImports,
'no-duplicate-type-constituents': noDuplicateTypeConstituents,
'no-dynamic-delete': noDynamicDelete,
'no-empty-function': noEmptyFunction,
@@ -187,7 +182,6 @@ export default {
'no-extraneous-class': noExtraneousClass,
'no-floating-promises': noFloatingPromises,
'no-for-in-array': noForInArray,
- 'no-implicit-any-catch': noImplicitAnyCatch,
'no-implied-eval': noImpliedEval,
'no-import-type-side-effects': noImportTypeSideEffects,
'no-inferrable-types': noInferrableTypes,
@@ -204,7 +198,6 @@ export default {
'no-non-null-asserted-nullish-coalescing': noNonNullAssertedNullishCoalescing,
'no-non-null-asserted-optional-chain': noNonNullAssertedOptionalChain,
'no-non-null-assertion': noNonNullAssertion,
- 'no-parameter-properties': noParameterProperties,
'no-redeclare': noRedeclare,
'no-redundant-type-constituents': noRedundantTypeConstituents,
'no-require-imports': noRequireImports,
@@ -261,7 +254,6 @@ export default {
'return-await': returnAwait,
semi: semi,
'sort-type-constituents': sortTypeConstituents,
- 'sort-type-union-intersection-members': sortTypeUnionIntersectionMembers,
'space-before-blocks': spaceBeforeBlocks,
'space-before-function-paren': spaceBeforeFunctionParen,
'space-infix-ops': spaceInfixOps,
diff --git a/packages/eslint-plugin/src/rules/init-declarations.ts b/packages/eslint-plugin/src/rules/init-declarations.ts
index 27bdf3c75a51..fabbe73898a5 100644
--- a/packages/eslint-plugin/src/rules/init-declarations.ts
+++ b/packages/eslint-plugin/src/rules/init-declarations.ts
@@ -20,7 +20,6 @@ export default createRule({
docs: {
description:
'Require or disallow initialization in variable declarations',
- recommended: false,
extendsBaseRule: true,
},
hasSuggestions: baseRule.meta.hasSuggestions,
@@ -49,7 +48,7 @@ export default createRule({
function isAncestorNamespaceDeclared(
node: TSESTree.VariableDeclaration,
): boolean {
- let ancestor = node.parent;
+ let ancestor: TSESTree.Node | undefined = node.parent;
while (ancestor) {
if (
diff --git a/packages/eslint-plugin/src/rules/key-spacing.ts b/packages/eslint-plugin/src/rules/key-spacing.ts
index 2d4d3f5c11df..096f3b7493e7 100644
--- a/packages/eslint-plugin/src/rules/key-spacing.ts
+++ b/packages/eslint-plugin/src/rules/key-spacing.ts
@@ -31,7 +31,6 @@ export default util.createRule({
docs: {
description:
'Enforce consistent spacing between property names and type annotations in types and interfaces',
- recommended: false,
extendsBaseRule: true,
},
fixable: 'whitespace',
@@ -66,9 +65,9 @@ export default util.createRule({
}
type KeyTypeNode =
+ | TSESTree.PropertyDefinition
| TSESTree.TSIndexSignature
- | TSESTree.TSPropertySignature
- | TSESTree.PropertyDefinition;
+ | TSESTree.TSPropertySignature;
type KeyTypeNodeWithTypeAnnotation = KeyTypeNode & {
typeAnnotation: TSESTree.TSTypeAnnotation;
@@ -128,7 +127,7 @@ export default util.createRule({
function checkBeforeColon(
node: KeyTypeNodeWithTypeAnnotation,
expectedWhitespaceBeforeColon: number,
- mode: 'strict' | 'minimum',
+ mode: 'minimum' | 'strict',
): void {
const { typeAnnotation } = node;
const colon = typeAnnotation.loc.start.column;
@@ -162,7 +161,7 @@ export default util.createRule({
function checkAfterColon(
node: KeyTypeNodeWithTypeAnnotation,
expectedWhitespaceAfterColon: number,
- mode: 'strict' | 'minimum',
+ mode: 'minimum' | 'strict',
): void {
const { typeAnnotation } = node;
const colon = typeAnnotation.loc.start.column;
@@ -240,7 +239,7 @@ export default util.createRule({
function checkAlignGroup(group: TSESTree.Node[]): void {
let alignColumn = 0;
- const align: 'value' | 'colon' =
+ const align: 'colon' | 'value' =
(typeof options.align === 'object'
? options.align.on
: typeof options.multiLine?.align === 'object'
@@ -373,9 +372,9 @@ export default util.createRule({
function validateBody(
body:
- | TSESTree.TSTypeLiteral
+ | TSESTree.ClassBody
| TSESTree.TSInterfaceBody
- | TSESTree.ClassBody,
+ | TSESTree.TSTypeLiteral,
): void {
const isSingleLine = body.loc.start.line === body.loc.end.line;
diff --git a/packages/eslint-plugin/src/rules/keyword-spacing.ts b/packages/eslint-plugin/src/rules/keyword-spacing.ts
index aa09fb3d1b87..893c70db7674 100644
--- a/packages/eslint-plugin/src/rules/keyword-spacing.ts
+++ b/packages/eslint-plugin/src/rules/keyword-spacing.ts
@@ -1,5 +1,6 @@
import type { TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
+import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
import * as util from '../util';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
@@ -26,7 +27,7 @@ const schema = util.deepMerge(
},
},
},
-);
+) as unknown as JSONSchema4;
export default util.createRule({
name: 'keyword-spacing',
@@ -34,7 +35,6 @@ export default util.createRule({
type: 'layout',
docs: {
description: 'Enforce consistent spacing before and after keywords',
- recommended: false,
extendsBaseRule: true,
},
fixable: 'whitespace',
diff --git a/packages/eslint-plugin/src/rules/lines-around-comment.ts b/packages/eslint-plugin/src/rules/lines-around-comment.ts
index 478667040c5a..f7cdef33b2e4 100644
--- a/packages/eslint-plugin/src/rules/lines-around-comment.ts
+++ b/packages/eslint-plugin/src/rules/lines-around-comment.ts
@@ -48,92 +48,88 @@ export default util.createRule({
type: 'layout',
docs: {
description: 'Require empty lines around comments',
- recommended: false,
extendsBaseRule: true,
},
- schema: {
- type: 'array',
- items: [
- {
- type: 'object',
- properties: {
- beforeBlockComment: {
- type: 'boolean',
- default: true,
- },
- afterBlockComment: {
- type: 'boolean',
- default: false,
- },
- beforeLineComment: {
- type: 'boolean',
- default: false,
- },
- afterLineComment: {
- type: 'boolean',
- default: false,
- },
- allowBlockStart: {
- type: 'boolean',
- default: false,
- },
- allowBlockEnd: {
- type: 'boolean',
- default: false,
- },
- allowClassStart: {
- type: 'boolean',
- },
- allowClassEnd: {
- type: 'boolean',
- },
- allowObjectStart: {
- type: 'boolean',
- },
- allowObjectEnd: {
- type: 'boolean',
- },
- allowArrayStart: {
- type: 'boolean',
- },
- allowArrayEnd: {
- type: 'boolean',
- },
- allowInterfaceStart: {
- type: 'boolean',
- },
- allowInterfaceEnd: {
- type: 'boolean',
- },
- allowTypeStart: {
- type: 'boolean',
- },
- allowTypeEnd: {
- type: 'boolean',
- },
- allowEnumStart: {
- type: 'boolean',
- },
- allowEnumEnd: {
- type: 'boolean',
- },
- allowModuleStart: {
- type: 'boolean',
- },
- allowModuleEnd: {
- type: 'boolean',
- },
- ignorePattern: {
- type: 'string',
- },
- applyDefaultIgnorePatterns: {
- type: 'boolean',
- },
+ schema: [
+ {
+ type: 'object',
+ properties: {
+ beforeBlockComment: {
+ type: 'boolean',
+ default: true,
+ },
+ afterBlockComment: {
+ type: 'boolean',
+ default: false,
+ },
+ beforeLineComment: {
+ type: 'boolean',
+ default: false,
+ },
+ afterLineComment: {
+ type: 'boolean',
+ default: false,
+ },
+ allowBlockStart: {
+ type: 'boolean',
+ default: false,
+ },
+ allowBlockEnd: {
+ type: 'boolean',
+ default: false,
+ },
+ allowClassStart: {
+ type: 'boolean',
+ },
+ allowClassEnd: {
+ type: 'boolean',
+ },
+ allowObjectStart: {
+ type: 'boolean',
+ },
+ allowObjectEnd: {
+ type: 'boolean',
+ },
+ allowArrayStart: {
+ type: 'boolean',
+ },
+ allowArrayEnd: {
+ type: 'boolean',
+ },
+ allowInterfaceStart: {
+ type: 'boolean',
+ },
+ allowInterfaceEnd: {
+ type: 'boolean',
+ },
+ allowTypeStart: {
+ type: 'boolean',
+ },
+ allowTypeEnd: {
+ type: 'boolean',
+ },
+ allowEnumStart: {
+ type: 'boolean',
+ },
+ allowEnumEnd: {
+ type: 'boolean',
+ },
+ allowModuleStart: {
+ type: 'boolean',
+ },
+ allowModuleEnd: {
+ type: 'boolean',
+ },
+ ignorePattern: {
+ type: 'string',
+ },
+ applyDefaultIgnorePatterns: {
+ type: 'boolean',
},
- additionalProperties: false,
},
- ],
- },
+ additionalProperties: false,
+ },
+ ],
fixable: baseRule.meta.fixable,
hasSuggestions: baseRule.meta.hasSuggestions,
messages: baseRule.meta.messages,
diff --git a/packages/eslint-plugin/src/rules/lines-between-class-members.ts b/packages/eslint-plugin/src/rules/lines-between-class-members.ts
index 2f37b365daea..e88e42d477af 100644
--- a/packages/eslint-plugin/src/rules/lines-between-class-members.ts
+++ b/packages/eslint-plugin/src/rules/lines-between-class-members.ts
@@ -1,5 +1,6 @@
import type { TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
+import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
import * as util from '../util';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
@@ -9,17 +10,21 @@ const baseRule = getESLintCoreRule('lines-between-class-members');
type Options = util.InferOptionsTypeFromRule;
type MessageIds = util.InferMessageIdsTypeFromRule;
-const schema = util.deepMerge(
- { ...baseRule.meta.schema },
- {
- 1: {
- exceptAfterOverload: {
- type: 'boolean',
- default: true,
+const schema = Object.values(
+ util.deepMerge(
+ { ...baseRule.meta.schema },
+ {
+ 1: {
+ properties: {
+ exceptAfterOverload: {
+ type: 'boolean',
+ default: true,
+ },
+ },
},
},
- },
-);
+ ),
+) as JSONSchema4[];
export default util.createRule({
name: 'lines-between-class-members',
@@ -27,7 +32,6 @@ export default util.createRule({
type: 'layout',
docs: {
description: 'Require or disallow an empty line between class members',
- recommended: false,
extendsBaseRule: true,
},
fixable: 'whitespace',
diff --git a/packages/eslint-plugin/src/rules/member-delimiter-style.ts b/packages/eslint-plugin/src/rules/member-delimiter-style.ts
index 53d2019e97d7..e0055a385e17 100644
--- a/packages/eslint-plugin/src/rules/member-delimiter-style.ts
+++ b/packages/eslint-plugin/src/rules/member-delimiter-style.ts
@@ -1,5 +1,6 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
+import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
import * as util from '../util';
@@ -27,10 +28,10 @@ type Config = BaseOptions & {
};
type Options = [Config];
type MessageIds =
- | 'unexpectedComma'
- | 'unexpectedSemi'
| 'expectedComma'
- | 'expectedSemi';
+ | 'expectedSemi'
+ | 'unexpectedComma'
+ | 'unexpectedSemi';
type LastTokenType = TSESTree.Token;
interface MakeFixFunctionParams {
@@ -47,30 +48,6 @@ type MakeFixFunctionReturnType =
| ((fixer: TSESLint.RuleFixer) => TSESLint.RuleFix)
| null;
-const definition = {
- type: 'object',
- properties: {
- multiline: {
- type: 'object',
- properties: {
- delimiter: { enum: ['none', 'semi', 'comma'] },
- requireLast: { type: 'boolean' },
- },
- additionalProperties: false,
- },
- singleline: {
- type: 'object',
- properties: {
- // note can't have "none" for single line delimiter as it's invalid syntax
- delimiter: { enum: ['semi', 'comma'] },
- requireLast: { type: 'boolean' },
- },
- additionalProperties: false,
- },
- },
- additionalProperties: false,
-};
-
const isLastTokenEndOfLine = (token: LastTokenType, line: string): boolean => {
const positionInLine = token.loc.start.column;
@@ -132,6 +109,29 @@ const makeFixFunction = ({
};
};
+const BASE_SCHEMA: JSONSchema4 = {
+ type: 'object',
+ properties: {
+ multiline: {
+ type: 'object',
+ properties: {
+ delimiter: { $ref: '#/items/0/$defs/multiLineOption' },
+ requireLast: { type: 'boolean' },
+ },
+ additionalProperties: false,
+ },
+ singleline: {
+ type: 'object',
+ properties: {
+ delimiter: { $ref: '#/items/0/$defs/singleLineOption' },
+ requireLast: { type: 'boolean' },
+ },
+ additionalProperties: false,
+ },
+ },
+ additionalProperties: false,
+};
+
export default util.createRule({
name: 'member-delimiter-style',
meta: {
@@ -139,7 +139,6 @@ export default util.createRule({
docs: {
description:
'Require a specific member delimiter style for interfaces and type literals',
- recommended: false,
},
fixable: 'whitespace',
messages: {
@@ -150,20 +149,39 @@ export default util.createRule({
},
schema: [
{
+ $defs: {
+ multiLineOption: {
+ type: 'string',
+ enum: ['none', 'semi', 'comma'],
+ },
+ // note can't have "none" for single line delimiter as it's invalid syntax
+ singleLineOption: {
+ type: 'string',
+ enum: ['semi', 'comma'],
+ },
+ // note - need to define this last as it references the enums
+ delimiterConfig: BASE_SCHEMA,
+ },
type: 'object',
- properties: Object.assign({}, definition.properties, {
+ properties: {
+ ...BASE_SCHEMA.properties,
overrides: {
type: 'object',
properties: {
- interface: definition,
- typeLiteral: definition,
+ interface: {
+ $ref: '#/items/0/$defs/delimiterConfig',
+ },
+ typeLiteral: {
+ $ref: '#/items/0/$defs/delimiterConfig',
+ },
},
additionalProperties: false,
},
multilineDetection: {
+ type: 'string',
enum: ['brackets', 'last-member'],
},
- }),
+ },
additionalProperties: false,
},
],
diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts
index cadd1023058b..29b748e88cfe 100644
--- a/packages/eslint-plugin/src/rules/member-ordering.ts
+++ b/packages/eslint-plugin/src/rules/member-ordering.ts
@@ -1,6 +1,6 @@
import type { JSONSchema, TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-import naturalCompare from 'natural-compare-lite';
+import naturalCompare from 'natural-compare';
import * as util from '../util';
@@ -12,9 +12,9 @@ export type MessageIds =
type ReadonlyType = 'readonly-field' | 'readonly-signature';
type MemberKind =
+ | ReadonlyType
| 'call-signature'
| 'constructor'
- | ReadonlyType
| 'field'
| 'get'
| 'method'
@@ -25,16 +25,16 @@ type MemberKind =
type DecoratedMemberKind =
| Exclude
| 'field'
- | 'method'
| 'get'
+ | 'method'
| 'set';
type NonCallableMemberKind = Exclude<
MemberKind,
- 'constructor' | 'signature' | 'readonly-signature'
+ 'constructor' | 'readonly-signature' | 'signature'
>;
-type MemberScope = 'static' | 'instance' | 'abstract';
+type MemberScope = 'abstract' | 'instance' | 'static';
type Accessibility = TSESTree.Accessibility | '#private';
@@ -42,20 +42,20 @@ type BaseMemberType =
| MemberKind
| `${Accessibility}-${Exclude<
MemberKind,
- 'signature' | 'readonly-signature' | 'static-initialization'
+ 'readonly-signature' | 'signature' | 'static-initialization'
>}`
- | `${Accessibility}-decorated-${DecoratedMemberKind}`
- | `decorated-${DecoratedMemberKind}`
| `${Accessibility}-${MemberScope}-${NonCallableMemberKind}`
- | `${MemberScope}-${NonCallableMemberKind}`;
+ | `${Accessibility}-decorated-${DecoratedMemberKind}`
+ | `${MemberScope}-${NonCallableMemberKind}`
+ | `decorated-${DecoratedMemberKind}`;
type MemberType = BaseMemberType | BaseMemberType[];
type AlphabeticalOrder =
- | 'alphabetically'
| 'alphabetically-case-insensitive'
- | 'natural'
- | 'natural-case-insensitive';
+ | 'alphabetically'
+ | 'natural-case-insensitive'
+ | 'natural';
type Order = AlphabeticalOrder | 'as-written';
@@ -85,42 +85,34 @@ const neverConfig: JSONSchema.JSONSchema4 = {
enum: ['never'],
};
-const arrayConfig = (memberTypes: MemberType[]): JSONSchema.JSONSchema4 => ({
+const arrayConfig = (memberTypes: string): JSONSchema.JSONSchema4 => ({
type: 'array',
items: {
oneOf: [
{
- enum: memberTypes,
+ $ref: memberTypes,
},
{
type: 'array',
items: {
- enum: memberTypes,
+ $ref: memberTypes,
},
},
],
},
});
-const objectConfig = (memberTypes: MemberType[]): JSONSchema.JSONSchema4 => ({
+const objectConfig = (memberTypes: string): JSONSchema.JSONSchema4 => ({
type: 'object',
properties: {
memberTypes: {
oneOf: [arrayConfig(memberTypes), neverConfig],
},
order: {
- type: 'string',
- enum: [
- 'alphabetically',
- 'alphabetically-case-insensitive',
- 'as-written',
- 'natural',
- 'natural-case-insensitive',
- ],
+ $ref: '#/items/0/$defs/orderOptions',
},
optionalityOrder: {
- type: 'string',
- enum: ['optional-first', 'required-first'],
+ $ref: '#/items/0/$defs/optionalityOrderOptions',
},
},
additionalProperties: false,
@@ -380,11 +372,11 @@ function getNodeType(node: Member): MemberKind | null {
function getMemberRawName(
member:
| TSESTree.MethodDefinition
- | TSESTree.TSMethodSignature
- | TSESTree.TSAbstractMethodDefinition
+ | TSESTree.Property
| TSESTree.PropertyDefinition
+ | TSESTree.TSAbstractMethodDefinition
| TSESTree.TSAbstractPropertyDefinition
- | TSESTree.Property
+ | TSESTree.TSMethodSignature
| TSESTree.TSPropertySignature,
sourceCode: TSESLint.SourceCode,
): string {
@@ -529,7 +521,7 @@ function getRank(
const memberGroups: BaseMemberType[] = [];
if (supportsModifiers) {
- const decorated = 'decorators' in node && node.decorators!.length > 0;
+ const decorated = 'decorators' in node && node.decorators.length > 0;
if (
decorated &&
(type === 'readonly-field' ||
@@ -625,7 +617,6 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Require a consistent member declaration order',
- recommended: false,
},
messages: {
incorrectOrder:
@@ -636,70 +627,68 @@ export default util.createRule({
},
schema: [
{
- type: 'object',
- properties: {
- default: {
- oneOf: [
- neverConfig,
- arrayConfig(allMemberTypes),
- objectConfig(allMemberTypes),
+ $defs: {
+ orderOptions: {
+ type: 'string',
+ enum: [
+ 'alphabetically',
+ 'alphabetically-case-insensitive',
+ 'as-written',
+ 'natural',
+ 'natural-case-insensitive',
],
},
- classes: {
- oneOf: [
- neverConfig,
- arrayConfig(allMemberTypes),
- objectConfig(allMemberTypes),
+ optionalityOrderOptions: {
+ type: 'string',
+ enum: ['optional-first', 'required-first'],
+ },
+ allItems: {
+ type: 'string',
+ enum: allMemberTypes as string[],
+ },
+ typeItems: {
+ type: 'string',
+ enum: [
+ 'readonly-signature',
+ 'signature',
+ 'readonly-field',
+ 'field',
+ 'method',
+ 'constructor',
],
},
- classExpressions: {
+
+ baseConfig: {
oneOf: [
neverConfig,
- arrayConfig(allMemberTypes),
- objectConfig(allMemberTypes),
+ arrayConfig('#/items/0/$defs/allItems'),
+ objectConfig('#/items/0/$defs/allItems'),
],
},
- interfaces: {
+ typesConfig: {
oneOf: [
neverConfig,
- arrayConfig([
- 'readonly-signature',
- 'signature',
- 'readonly-field',
- 'field',
- 'method',
- 'constructor',
- ]),
- objectConfig([
- 'readonly-signature',
- 'signature',
- 'readonly-field',
- 'field',
- 'method',
- 'constructor',
- ]),
+ arrayConfig('#/items/0/$defs/typeItems'),
+ objectConfig('#/items/0/$defs/typeItems'),
],
},
+ },
+ type: 'object',
+ properties: {
+ default: {
+ $ref: '#/items/0/$defs/baseConfig',
+ },
+ classes: {
+ $ref: '#/items/0/$defs/baseConfig',
+ },
+ classExpressions: {
+ $ref: '#/items/0/$defs/baseConfig',
+ },
+ interfaces: {
+ $ref: '#/items/0/$defs/typesConfig',
+ },
typeLiterals: {
- oneOf: [
- neverConfig,
- arrayConfig([
- 'readonly-signature',
- 'signature',
- 'readonly-field',
- 'field',
- 'method',
- 'constructor',
- ]),
- objectConfig([
- 'readonly-signature',
- 'signature',
- 'readonly-field',
- 'field',
- 'method',
- 'constructor',
- ]),
- ],
+ $ref: '#/items/0/$defs/typesConfig',
},
},
additionalProperties: false,
@@ -725,9 +714,9 @@ export default util.createRule({
members: Member[],
groupOrder: MemberType[],
supportsModifiers: boolean,
- ): Array | null {
+ ): Member[][] | null {
const previousRanks: number[] = [];
- const memberGroups: Array = [];
+ const memberGroups: Member[][] = [];
let isCorrectlySorted = true;
// Find first member which isn't correctly sorted
@@ -896,7 +885,7 @@ export default util.createRule({
// Standardize config
let order: Order | undefined;
- let memberTypes: string | MemberType[] | undefined;
+ let memberTypes: MemberType[] | string | undefined;
let optionalityOrder: OptionalityOrder | undefined;
// returns true if everything is good and false if an error was reported
diff --git a/packages/eslint-plugin/src/rules/method-signature-style.ts b/packages/eslint-plugin/src/rules/method-signature-style.ts
index 93b214085116..ee8ea18ebf83 100644
--- a/packages/eslint-plugin/src/rules/method-signature-style.ts
+++ b/packages/eslint-plugin/src/rules/method-signature-style.ts
@@ -3,7 +3,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
-export type Options = [('property' | 'method')?];
+export type Options = [('method' | 'property')?];
export type MessageIds = 'errorMethod' | 'errorProperty';
export default util.createRule({
@@ -12,7 +12,6 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Enforce using a particular method signature syntax',
- recommended: false,
},
fixable: 'code',
messages: {
@@ -23,6 +22,7 @@ export default util.createRule({
},
schema: [
{
+ type: 'string',
enum: ['property', 'method'],
},
],
@@ -49,7 +49,7 @@ export default util.createRule({
}
function getMethodParams(
- node: TSESTree.TSMethodSignature | TSESTree.TSFunctionType,
+ node: TSESTree.TSFunctionType | TSESTree.TSMethodSignature,
): string {
let params = '()';
if (node.params.length > 0) {
@@ -78,7 +78,7 @@ export default util.createRule({
}
function getMethodReturnType(
- node: TSESTree.TSMethodSignature | TSESTree.TSFunctionType,
+ node: TSESTree.TSFunctionType | TSESTree.TSMethodSignature,
): string {
return node.returnType == null
? // if the method has no return type, it implicitly has an `any` return type
diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/enums.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/enums.ts
index 02900ab1d8b6..1b26c18ecb22 100644
--- a/packages/eslint-plugin/src/rules/naming-convention-utils/enums.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention-utils/enums.ts
@@ -78,7 +78,7 @@ enum MetaSelectors {
Selectors.typeProperty,
}
type MetaSelectorsString = keyof typeof MetaSelectors;
-type IndividualAndMetaSelectorsString = SelectorsString | MetaSelectorsString;
+type IndividualAndMetaSelectorsString = MetaSelectorsString | SelectorsString;
enum Modifiers {
// const variable
diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/parse-options.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/parse-options.ts
index c4e6e36b3039..945777dd7fbd 100644
--- a/packages/eslint-plugin/src/rules/naming-convention-utils/parse-options.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention-utils/parse-options.ts
@@ -83,10 +83,13 @@ function parseOptions(context: Context): ParsedOptions {
const normalizedOptions = context.options
.map(opt => normalizeOption(opt))
.reduce((acc, val) => acc.concat(val), []);
- return util.getEnumNames(Selectors).reduce((acc, k) => {
+
+ const result = util.getEnumNames(Selectors).reduce((acc, k) => {
acc[k] = createValidator(k, context, normalizedOptions);
return acc;
}, {} as ParsedOptions);
+
+ return result;
}
export { parseOptions };
diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts
index ff91d2e156d4..2cb6d9fed62b 100644
--- a/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts
@@ -14,35 +14,45 @@ import {
UnderscoreOptions,
} from './enums';
-const UNDERSCORE_SCHEMA: JSONSchema.JSONSchema4 = {
- type: 'string',
- enum: util.getEnumNames(UnderscoreOptions),
-};
-const PREFIX_SUFFIX_SCHEMA: JSONSchema.JSONSchema4 = {
- type: 'array',
- items: {
+const $DEFS: Record = {
+ // enums
+ underscoreOptions: {
type: 'string',
- minLength: 1,
+ enum: util.getEnumNames(UnderscoreOptions),
},
- additionalItems: false,
-};
-const MATCH_REGEX_SCHEMA: JSONSchema.JSONSchema4 = {
- type: 'object',
- properties: {
- match: { type: 'boolean' },
- regex: { type: 'string' },
+ predefinedFormats: {
+ type: 'string',
+ enum: util.getEnumNames(PredefinedFormats),
},
- required: ['match', 'regex'],
-};
-type JSONSchemaProperties = Record;
-const FORMAT_OPTIONS_PROPERTIES: JSONSchemaProperties = {
- format: {
+ typeModifiers: {
+ type: 'string',
+ enum: util.getEnumNames(TypeModifiers),
+ },
+
+ // repeated types
+ prefixSuffixConfig: {
+ type: 'array',
+ items: {
+ type: 'string',
+ minLength: 1,
+ },
+ additionalItems: false,
+ },
+ matchRegexConfig: {
+ type: 'object',
+ additionalProperties: false,
+ properties: {
+ match: { type: 'boolean' },
+ regex: { type: 'string' },
+ },
+ required: ['match', 'regex'],
+ },
+ formatOptionsConfig: {
oneOf: [
{
type: 'array',
items: {
- type: 'string',
- enum: util.getEnumNames(PredefinedFormats),
+ $ref: '#/$defs/predefinedFormats',
},
additionalItems: false,
},
@@ -51,6 +61,22 @@ const FORMAT_OPTIONS_PROPERTIES: JSONSchemaProperties = {
},
],
},
+};
+
+const UNDERSCORE_SCHEMA: JSONSchema.JSONSchema4 = {
+ $ref: '#/$defs/underscoreOptions',
+};
+const PREFIX_SUFFIX_SCHEMA: JSONSchema.JSONSchema4 = {
+ $ref: '#/$defs/prefixSuffixConfig',
+};
+const MATCH_REGEX_SCHEMA: JSONSchema.JSONSchema4 = {
+ $ref: '#/$defs/matchRegexConfig',
+};
+type JSONSchemaProperties = Record;
+const FORMAT_OPTIONS_PROPERTIES: JSONSchemaProperties = {
+ format: {
+ $ref: '#/$defs/formatOptionsConfig',
+ },
custom: MATCH_REGEX_SCHEMA,
leadingUnderscore: UNDERSCORE_SCHEMA,
trailingUnderscore: UNDERSCORE_SCHEMA,
@@ -94,8 +120,7 @@ function selectorSchema(
selector.types = {
type: 'array',
items: {
- type: 'string',
- enum: util.getEnumNames(TypeModifiers),
+ $ref: '#/$defs/typeModifiers',
},
additionalItems: false,
};
@@ -104,6 +129,7 @@ function selectorSchema(
return [
{
type: 'object',
+ description: `Selector '${selectorString}'`,
properties: {
...FORMAT_OPTIONS_PROPERTIES,
...selector,
@@ -117,6 +143,7 @@ function selectorSchema(
function selectorsSchema(): JSONSchema.JSONSchema4 {
return {
type: 'object',
+ description: 'Multiple selectors in one config',
properties: {
...FORMAT_OPTIONS_PROPERTIES,
...{
@@ -151,8 +178,7 @@ function selectorsSchema(): JSONSchema.JSONSchema4 {
types: {
type: 'array',
items: {
- type: 'string',
- enum: util.getEnumNames(TypeModifiers),
+ $ref: '#/$defs/typeModifiers',
},
additionalItems: false,
},
@@ -164,6 +190,7 @@ function selectorsSchema(): JSONSchema.JSONSchema4 {
}
const SCHEMA: JSONSchema.JSONSchema4 = {
+ $defs: $DEFS,
type: 'array',
items: {
oneOf: [
diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/shared.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/shared.ts
index 9772f91ced8d..a1d63d31bad2 100644
--- a/packages/eslint-plugin/src/rules/naming-convention-utils/shared.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention-utils/shared.ts
@@ -12,13 +12,13 @@ function selectorTypeToMessageString(selectorType: SelectorsString): string {
}
function isMetaSelector(
- selector: IndividualAndMetaSelectorsString | Selectors | MetaSelectors,
+ selector: IndividualAndMetaSelectorsString | MetaSelectors | Selectors,
): selector is MetaSelectorsString {
return selector in MetaSelectors;
}
function isMethodOrPropertySelector(
- selector: IndividualAndMetaSelectorsString | Selectors | MetaSelectors,
+ selector: IndividualAndMetaSelectorsString | MetaSelectors | Selectors,
): boolean {
return (
selector === MetaSelectors.method || selector === MetaSelectors.property
diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts
index d5c15994b8bb..fd0910050e00 100644
--- a/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts
@@ -35,7 +35,7 @@ interface Selector {
| IndividualAndMetaSelectorsString[];
modifiers?: ModifiersString[];
types?: TypeModifiersString[];
- filter?: string | MatchRegex;
+ filter?: MatchRegex | string;
}
interface NormalizedMatchRegex {
@@ -52,7 +52,7 @@ interface NormalizedSelector {
prefix: string[] | null;
suffix: string[] | null;
// selector options
- selector: Selectors | MetaSelectors;
+ selector: MetaSelectors | Selectors;
modifiers: Modifiers[] | null;
types: TypeModifiers[] | null;
filter: NormalizedMatchRegex | null;
@@ -61,7 +61,7 @@ interface NormalizedSelector {
}
type ValidatorFunction = (
- node: TSESTree.Identifier | TSESTree.PrivateIdentifier | TSESTree.Literal,
+ node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier,
modifiers?: Set,
) => void;
type ParsedOptions = Record;
diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts
index c2b87ccc33b1..4c80a167a0f7 100644
--- a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts
@@ -25,7 +25,7 @@ function createValidator(
context: Context,
allConfigs: NormalizedSelector[],
): (
- node: TSESTree.Identifier | TSESTree.PrivateIdentifier | TSESTree.Literal,
+ node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier,
) => void {
// make sure the "highest priority" configs are checked first
const selectorType = Selectors[type];
@@ -71,7 +71,7 @@ function createValidator(
});
return (
- node: TSESTree.Identifier | TSESTree.PrivateIdentifier | TSESTree.Literal,
+ node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier,
modifiers: Set = new Set(),
): void => {
const originalName =
@@ -155,7 +155,7 @@ function createValidator(
formats?: PredefinedFormats[];
originalName: string;
processedName?: string;
- position?: 'leading' | 'trailing' | 'prefix' | 'suffix';
+ position?: 'leading' | 'prefix' | 'suffix' | 'trailing';
custom?: NonNullable;
count?: 'one' | 'two';
}): Record {
@@ -184,7 +184,7 @@ function createValidator(
position: 'leading' | 'trailing',
config: NormalizedSelector,
name: string,
- node: TSESTree.Identifier | TSESTree.PrivateIdentifier | TSESTree.Literal,
+ node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier,
originalName: string,
): string | null {
const option =
@@ -305,7 +305,7 @@ function createValidator(
position: 'prefix' | 'suffix',
config: NormalizedSelector,
name: string,
- node: TSESTree.Identifier | TSESTree.PrivateIdentifier | TSESTree.Literal,
+ node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier,
originalName: string,
): string | null {
const affixes = config[position];
@@ -345,7 +345,7 @@ function createValidator(
function validateCustom(
config: NormalizedSelector,
name: string,
- node: TSESTree.Identifier | TSESTree.PrivateIdentifier | TSESTree.Literal,
+ node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier,
originalName: string,
): boolean {
const custom = config.custom;
@@ -378,7 +378,7 @@ function createValidator(
function validatePredefinedFormat(
config: NormalizedSelector,
name: string,
- node: TSESTree.Identifier | TSESTree.PrivateIdentifier | TSESTree.Literal,
+ node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier,
originalName: string,
modifiers: Set,
): boolean {
@@ -435,11 +435,10 @@ function isCorrectType(
return true;
}
- const { esTreeNodeToTSNodeMap, program } = util.getParserServices(context);
- const checker = program.getTypeChecker();
- const tsNode = esTreeNodeToTSNodeMap.get(node);
- const type = checker
- .getTypeAtLocation(tsNode)
+ const services = util.getParserServices(context);
+ const checker = services.program.getTypeChecker();
+ const type = services
+ .getTypeAtLocation(node)
// remove null and undefined from the type, as we don't care about it here
.getNonNullableType();
diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts
index 1c6c0ae31d1f..d3e52d377cf2 100644
--- a/packages/eslint-plugin/src/rules/naming-convention.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention.ts
@@ -12,12 +12,12 @@ import type {
import { Modifiers, parseOptions, SCHEMA } from './naming-convention-utils';
type MessageIds =
- | 'unexpectedUnderscore'
- | 'missingUnderscore'
+ | 'doesNotMatchFormat'
+ | 'doesNotMatchFormatTrimmed'
| 'missingAffix'
+ | 'missingUnderscore'
| 'satisfyCustom'
- | 'doesNotMatchFormat'
- | 'doesNotMatchFormatTrimmed';
+ | 'unexpectedUnderscore';
// Note that this intentionally does not strictly type the modifiers/types properties.
// This is because doing so creates a huge headache, as the rule's code doesn't need to care.
@@ -53,7 +53,6 @@ export default util.createRule({
docs: {
description:
'Enforce naming conventions for everything across a codebase',
- recommended: false,
// technically only requires type checking if the user uses "type" modifiers
requiresTypeChecking: true,
},
@@ -90,20 +89,18 @@ export default util.createRule({
const validators = parseOptions(context);
- // getParserServices(context, false) -- dirty hack to work around the docs checker test...
- const compilerOptions = util
- .getParserServices(context, true)
- .program.getCompilerOptions();
+ const compilerOptions =
+ util.getParserServices(context, true).program?.getCompilerOptions() ?? {};
function handleMember(
validator: ValidatorFunction,
node:
- | TSESTree.PropertyNonComputedName
- | TSESTree.PropertyDefinitionNonComputedName
- | TSESTree.TSAbstractPropertyDefinitionNonComputedName
- | TSESTree.TSPropertySignatureNonComputedName
| TSESTree.MethodDefinitionNonComputedName
+ | TSESTree.PropertyDefinitionNonComputedName
+ | TSESTree.PropertyNonComputedName
| TSESTree.TSAbstractMethodDefinitionNonComputedName
- | TSESTree.TSMethodSignatureNonComputedName,
+ | TSESTree.TSAbstractPropertyDefinitionNonComputedName
+ | TSESTree.TSMethodSignatureNonComputedName
+ | TSESTree.TSPropertySignatureNonComputedName,
modifiers: Set,
): void {
if (!validator) {
@@ -120,10 +117,10 @@ export default util.createRule({
function getMemberModifiers(
node:
- | TSESTree.PropertyDefinition
- | TSESTree.TSAbstractPropertyDefinition
| TSESTree.MethodDefinition
+ | TSESTree.PropertyDefinition
| TSESTree.TSAbstractMethodDefinition
+ | TSESTree.TSAbstractPropertyDefinition
| TSESTree.TSParameterProperty,
): Set {
const modifiers = new Set();
@@ -189,12 +186,12 @@ export default util.createRule({
function isAsyncMemberOrProperty(
propertyOrMemberNode:
- | TSESTree.PropertyNonComputedName
- | TSESTree.TSMethodSignatureNonComputedName
+ | TSESTree.MethodDefinitionNonComputedName
| TSESTree.PropertyDefinitionNonComputedName
+ | TSESTree.PropertyNonComputedName
+ | TSESTree.TSAbstractMethodDefinitionNonComputedName
| TSESTree.TSAbstractPropertyDefinitionNonComputedName
- | TSESTree.MethodDefinitionNonComputedName
- | TSESTree.TSAbstractMethodDefinitionNonComputedName,
+ | TSESTree.TSMethodSignatureNonComputedName,
): boolean {
return Boolean(
'value' in propertyOrMemberNode &&
@@ -276,8 +273,8 @@ export default util.createRule({
handler: (
node:
| TSESTree.FunctionDeclaration
- | TSESTree.TSDeclareFunction
- | TSESTree.FunctionExpression,
+ | TSESTree.FunctionExpression
+ | TSESTree.TSDeclareFunction,
validator,
): void => {
if (node.id == null) {
@@ -316,11 +313,11 @@ export default util.createRule({
validator: validators.parameter,
handler: (
node:
+ | TSESTree.ArrowFunctionExpression
| TSESTree.FunctionDeclaration
- | TSESTree.TSDeclareFunction
- | TSESTree.TSEmptyBodyFunctionExpression
| TSESTree.FunctionExpression
- | TSESTree.ArrowFunctionExpression,
+ | TSESTree.TSDeclareFunction
+ | TSESTree.TSEmptyBodyFunctionExpression,
validator,
): void => {
node.params.forEach(param => {
@@ -445,10 +442,10 @@ export default util.createRule({
validator: validators.classMethod,
handler: (
node:
- | TSESTree.PropertyDefinitionNonComputedName
- | TSESTree.TSAbstractPropertyDefinitionNonComputedName
| TSESTree.MethodDefinitionNonComputedName
- | TSESTree.TSAbstractMethodDefinitionNonComputedName,
+ | TSESTree.PropertyDefinitionNonComputedName
+ | TSESTree.TSAbstractMethodDefinitionNonComputedName
+ | TSESTree.TSAbstractPropertyDefinitionNonComputedName,
validator,
): void => {
const modifiers = getMemberModifiers(node);
diff --git a/packages/eslint-plugin/src/rules/no-array-constructor.ts b/packages/eslint-plugin/src/rules/no-array-constructor.ts
index 2b6105890ea4..fc71f275d7c3 100644
--- a/packages/eslint-plugin/src/rules/no-array-constructor.ts
+++ b/packages/eslint-plugin/src/rules/no-array-constructor.ts
@@ -9,7 +9,7 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow generic `Array` constructors',
- recommended: 'error',
+ recommended: 'recommended',
extendsBaseRule: true,
},
fixable: 'code',
@@ -31,7 +31,7 @@ export default util.createRule({
node.arguments.length !== 1 &&
node.callee.type === AST_NODE_TYPES.Identifier &&
node.callee.name === 'Array' &&
- !node.typeParameters &&
+ !node.typeArguments &&
!util.isOptionalCallExpression(node)
) {
context.report({
diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts
index 8b8521491f2c..9d74c87117c5 100644
--- a/packages/eslint-plugin/src/rules/no-base-to-string.ts
+++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts
@@ -5,7 +5,7 @@ import * as ts from 'typescript';
import * as util from '../util';
enum Usefulness {
- Always,
+ Always = 'always',
Never = 'will',
Sometimes = 'may',
}
@@ -23,7 +23,7 @@ export default util.createRule({
docs: {
description:
'Require `.toString()` to only be called on objects which provide useful information when stringified',
- recommended: 'strict',
+ recommended: 'recommended',
requiresTypeChecking: true,
},
messages: {
@@ -52,8 +52,8 @@ export default util.createRule({
},
],
create(context, [option]) {
- const parserServices = util.getParserServices(context);
- const typeChecker = parserServices.program.getTypeChecker();
+ const services = util.getParserServices(context);
+ const checker = services.program.getTypeChecker();
const ignoredTypeNames = option.ignoredTypeNames ?? [];
function checkExpression(node: TSESTree.Expression, type?: ts.Type): void {
@@ -62,10 +62,7 @@ export default util.createRule({
}
const certainty = collectToStringCertainty(
- type ??
- typeChecker.getTypeAtLocation(
- parserServices.esTreeNodeToTSNodeMap.get(node),
- ),
+ type ?? services.getTypeAtLocation(node),
);
if (certainty === Usefulness.Always) {
return;
@@ -82,7 +79,7 @@ export default util.createRule({
}
function collectToStringCertainty(type: ts.Type): Usefulness {
- const toString = typeChecker.getPropertyOfType(type, 'toString');
+ const toString = checker.getPropertyOfType(type, 'toString');
const declarations = toString?.getDeclarations();
if (!toString || !declarations || declarations.length === 0) {
return Usefulness.Always;
@@ -96,7 +93,7 @@ export default util.createRule({
return Usefulness.Always;
}
- if (ignoredTypeNames.includes(util.getTypeName(typeChecker, type))) {
+ if (ignoredTypeNames.includes(util.getTypeName(checker, type))) {
return Usefulness.Always;
}
@@ -155,17 +152,13 @@ export default util.createRule({
'AssignmentExpression[operator = "+="], BinaryExpression[operator = "+"]'(
node: TSESTree.AssignmentExpression | TSESTree.BinaryExpression,
): void {
- const leftType = typeChecker.getTypeAtLocation(
- parserServices.esTreeNodeToTSNodeMap.get(node.left),
- );
- const rightType = typeChecker.getTypeAtLocation(
- parserServices.esTreeNodeToTSNodeMap.get(node.right),
- );
-
- if (util.getTypeName(typeChecker, leftType) === 'string') {
+ const leftType = services.getTypeAtLocation(node.left);
+ const rightType = services.getTypeAtLocation(node.right);
+
+ if (util.getTypeName(checker, leftType) === 'string') {
checkExpression(node.right, rightType);
} else if (
- util.getTypeName(typeChecker, rightType) === 'string' &&
+ util.getTypeName(checker, rightType) === 'string' &&
node.left.type !== AST_NODE_TYPES.PrivateIdentifier
) {
checkExpression(node.left, leftType);
@@ -178,10 +171,7 @@ export default util.createRule({
checkExpression(memberExpr.object);
},
TemplateLiteral(node: TSESTree.TemplateLiteral): void {
- if (
- node.parent &&
- node.parent.type === AST_NODE_TYPES.TaggedTemplateExpression
- ) {
+ if (node.parent.type === AST_NODE_TYPES.TaggedTemplateExpression) {
return;
}
for (const expression of node.expressions) {
diff --git a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts
index 6268a9e6c751..5e91950ed202 100644
--- a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts
+++ b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts
@@ -10,7 +10,7 @@ export default util.createRule({
docs: {
description:
'Disallow non-null assertion in locations that may be confusing',
- recommended: 'strict',
+ recommended: 'stylistic',
},
fixable: 'code',
hasSuggestions: true,
@@ -32,7 +32,7 @@ export default util.createRule({
const sourceCode = context.getSourceCode();
return {
'BinaryExpression, AssignmentExpression'(
- node: TSESTree.BinaryExpression | TSESTree.AssignmentExpression,
+ node: TSESTree.AssignmentExpression | TSESTree.BinaryExpression,
): void {
function isLeftHandPrimaryExpression(
node: TSESTree.Expression | TSESTree.PrivateIdentifier,
diff --git a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts
index 62945ac689b4..66ac9e28c512 100644
--- a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts
+++ b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts
@@ -1,6 +1,6 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as ts from 'typescript';
import * as util from '../util';
@@ -14,12 +14,12 @@ export type Options = [
export type MessageId =
| 'invalidVoidExpr'
- | 'invalidVoidExprWrapVoid'
| 'invalidVoidExprArrow'
| 'invalidVoidExprArrowWrapVoid'
| 'invalidVoidExprReturn'
| 'invalidVoidExprReturnLast'
| 'invalidVoidExprReturnWrapVoid'
+ | 'invalidVoidExprWrapVoid'
| 'voidExprWrapVoid';
export default util.createRule({
@@ -28,7 +28,7 @@ export default util.createRule({
docs: {
description:
'Require expressions of type void to appear in statement position',
- recommended: false,
+ recommended: 'strict',
requiresTypeChecking: true,
},
messages: {
@@ -80,10 +80,8 @@ export default util.createRule({
| TSESTree.CallExpression
| TSESTree.TaggedTemplateExpression,
): void {
- const parserServices = util.getParserServices(context);
- const checker = parserServices.program.getTypeChecker();
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
- const type = util.getConstrainedTypeAtLocation(checker, tsNode);
+ const services = util.getParserServices(context);
+ const type = util.getConstrainedTypeAtLocation(services, node);
if (!tsutils.isTypeFlagSet(type, ts.TypeFlags.VoidLike)) {
// not a void expression
return;
@@ -186,7 +184,7 @@ export default util.createRule({
// put a semicolon at the beginning of the line
newReturnStmtText = `;${newReturnStmtText}`;
}
- if (returnStmt.parent?.type !== AST_NODE_TYPES.BlockStatement) {
+ if (returnStmt.parent.type !== AST_NODE_TYPES.BlockStatement) {
// e.g. `if (cond) return console.error();`
// add braces if not inside a block
newReturnStmtText = `{ ${newReturnStmtText} }`;
diff --git a/packages/eslint-plugin/src/rules/no-dupe-class-members.ts b/packages/eslint-plugin/src/rules/no-dupe-class-members.ts
index 62c1a8feb808..95689cae513c 100644
--- a/packages/eslint-plugin/src/rules/no-dupe-class-members.ts
+++ b/packages/eslint-plugin/src/rules/no-dupe-class-members.ts
@@ -15,7 +15,6 @@ export default util.createRule({
type: 'problem',
docs: {
description: 'Disallow duplicate class members',
- recommended: false,
extendsBaseRule: true,
},
hasSuggestions: baseRule.meta.hasSuggestions,
diff --git a/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts b/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts
index 4bb011d12346..8aeb1c4200b3 100644
--- a/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts
+++ b/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts
@@ -9,7 +9,7 @@ export default util.createRule({
type: 'problem',
docs: {
description: 'Disallow duplicate enum member values',
- recommended: 'strict',
+ recommended: 'recommended',
},
hasSuggestions: false,
messages: {
@@ -45,7 +45,7 @@ export default util.createRule({
return;
}
- let value: string | number | undefined;
+ let value: number | string | undefined;
if (isStringLiteral(member.initializer)) {
value = String(member.initializer.value);
} else if (isNumberLiteral(member.initializer)) {
diff --git a/packages/eslint-plugin/src/rules/no-duplicate-imports.ts b/packages/eslint-plugin/src/rules/no-duplicate-imports.ts
deleted file mode 100644
index c84fd26468f2..000000000000
--- a/packages/eslint-plugin/src/rules/no-duplicate-imports.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-import type { TSESTree } from '@typescript-eslint/utils';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-
-import * as util from '../util';
-import { getESLintCoreRule } from '../util/getESLintCoreRule';
-
-const baseRule = getESLintCoreRule('no-duplicate-imports');
-
-type Options = util.InferOptionsTypeFromRule;
-type MessageIds = util.InferMessageIdsTypeFromRule;
-
-export default util.createRule({
- name: 'no-duplicate-imports',
- meta: {
- deprecated: true,
- replacedBy: ['import/no-duplicates'],
- type: 'problem',
- docs: {
- description: 'Disallow duplicate imports',
- recommended: false,
- extendsBaseRule: true,
- },
- hasSuggestions: baseRule.meta.hasSuggestions,
- schema: baseRule.meta.schema,
- messages: {
- ...baseRule.meta.messages,
- importType: '{{module}} type import is duplicated.',
- importTypeAs: '{{module}} type import is duplicated as type export.',
- exportType: '{{module}} type export is duplicated.',
- exportTypeAs: '{{module}} type export is duplicated as type import.',
- },
- },
- defaultOptions: [
- {
- includeExports: false,
- },
- ],
- create(context, [{ includeExports }]) {
- const rules = baseRule.create(context);
- const typeMemberImports = new Set();
- const typeDefaultImports = new Set();
- const typeExports = new Set();
-
- function report(
- messageId: MessageIds,
- node: TSESTree.Node,
- module: string,
- ): void {
- context.report({
- messageId,
- node,
- data: {
- module,
- },
- });
- }
-
- function isAllMemberImport(node: TSESTree.ImportDeclaration): boolean {
- return node.specifiers.every(
- specifier => specifier.type === AST_NODE_TYPES.ImportSpecifier,
- );
- }
-
- function checkTypeImport(node: TSESTree.ImportDeclaration): void {
- if (node.source) {
- const value = node.source.value;
- const isMemberImport = isAllMemberImport(node);
- if (
- isMemberImport
- ? typeMemberImports.has(value)
- : typeDefaultImports.has(value)
- ) {
- report('importType', node, value);
- }
-
- if (includeExports && typeExports.has(value)) {
- report('importTypeAs', node, value);
- }
- if (isMemberImport) {
- typeMemberImports.add(value);
- } else {
- typeDefaultImports.add(value);
- }
- }
- }
-
- function checkTypeExport(
- node: TSESTree.ExportNamedDeclaration | TSESTree.ExportAllDeclaration,
- ): void {
- if (node.source) {
- const value = node.source.value;
- if (typeExports.has(value)) {
- report('exportType', node, value);
- }
- if (typeMemberImports.has(value) || typeDefaultImports.has(value)) {
- report('exportTypeAs', node, value);
- }
- typeExports.add(value);
- }
- }
-
- return {
- ...rules,
- ImportDeclaration(node): void {
- if (node.importKind === 'type') {
- checkTypeImport(node);
- return;
- }
- rules.ImportDeclaration(node);
- },
- ExportNamedDeclaration(node): void {
- if (includeExports && node.exportKind === 'type') {
- checkTypeExport(node);
- return;
- }
- rules.ExportNamedDeclaration?.(node);
- },
- ExportAllDeclaration(node): void {
- if (includeExports && node.exportKind === 'type') {
- checkTypeExport(node);
- return;
- }
- rules.ExportAllDeclaration?.(node);
- },
- };
- },
-});
diff --git a/packages/eslint-plugin/src/rules/no-duplicate-type-constituents.ts b/packages/eslint-plugin/src/rules/no-duplicate-type-constituents.ts
index 180ad3b340fc..c6e31acf5864 100644
--- a/packages/eslint-plugin/src/rules/no-duplicate-type-constituents.ts
+++ b/packages/eslint-plugin/src/rules/no-duplicate-type-constituents.ts
@@ -73,7 +73,7 @@ export default util.createRule({
docs: {
description:
'Disallow duplicate constituents of union or intersection types',
- recommended: false,
+ recommended: 'recommended',
requiresTypeChecking: true,
},
fixable: 'code',
@@ -108,7 +108,7 @@ export default util.createRule({
function checkDuplicate(
node: TSESTree.TSIntersectionType | TSESTree.TSUnionType,
): void {
- const cachedTypeMap: Map = new Map();
+ const cachedTypeMap = new Map();
node.types.reduce(
(uniqueConstituents, constituentNode) => {
const duplicatedPreviousConstituentInAst = uniqueConstituents.find(
diff --git a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts
index 09d5b5420d8a..0d1127f8a923 100644
--- a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts
+++ b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts
@@ -1,6 +1,6 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as util from '../util';
diff --git a/packages/eslint-plugin/src/rules/no-empty-function.ts b/packages/eslint-plugin/src/rules/no-empty-function.ts
index a78e4b86db4d..e77981eab301 100644
--- a/packages/eslint-plugin/src/rules/no-empty-function.ts
+++ b/packages/eslint-plugin/src/rules/no-empty-function.ts
@@ -1,5 +1,6 @@
import type { TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
+import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
import * as util from '../util';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
@@ -18,6 +19,7 @@ const schema = util.deepMerge(
properties: {
allow: {
items: {
+ type: 'string',
enum: [
'functions',
'arrowFunctions',
@@ -38,7 +40,7 @@ const schema = util.deepMerge(
},
},
},
-);
+) as unknown as JSONSchema4;
export default util.createRule({
name: 'no-empty-function',
@@ -46,7 +48,7 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow empty functions',
- recommended: 'error',
+ recommended: 'stylistic',
extendsBaseRule: true,
},
hasSuggestions: baseRule.meta.hasSuggestions,
@@ -129,7 +131,7 @@ export default util.createRule({
* @private
*/
function isAllowedEmptyDecoratedFunctions(
- node: TSESTree.FunctionExpression | TSESTree.FunctionDeclaration,
+ node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression,
): boolean {
if (isAllowedDecoratedFunctions && isBodyEmpty(node)) {
const decorators =
@@ -166,13 +168,6 @@ export default util.createRule({
rules.FunctionExpression(node);
},
- FunctionDeclaration(node): void {
- if (isAllowedEmptyDecoratedFunctions(node)) {
- return;
- }
-
- rules.FunctionDeclaration(node);
- },
};
},
});
diff --git a/packages/eslint-plugin/src/rules/no-empty-interface.ts b/packages/eslint-plugin/src/rules/no-empty-interface.ts
index d74034114bb8..12499f3b95c6 100644
--- a/packages/eslint-plugin/src/rules/no-empty-interface.ts
+++ b/packages/eslint-plugin/src/rules/no-empty-interface.ts
@@ -1,3 +1,4 @@
+import { ScopeType } from '@typescript-eslint/scope-manager';
import type { TSESLint } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
@@ -16,7 +17,7 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow the declaration of empty interfaces',
- recommended: 'error',
+ recommended: 'stylistic',
},
fixable: 'code',
hasSuggestions: true,
@@ -84,7 +85,7 @@ export default util.createRule({
const isInAmbientDeclaration = !!(
util.isDefinitionFile(filename) &&
- scope.type === 'tsModule' &&
+ scope.type === ScopeType.tsModule &&
scope.block.declare
);
diff --git a/packages/eslint-plugin/src/rules/no-explicit-any.ts b/packages/eslint-plugin/src/rules/no-explicit-any.ts
index 65b253a8a33f..fd2ddeefbe2b 100644
--- a/packages/eslint-plugin/src/rules/no-explicit-any.ts
+++ b/packages/eslint-plugin/src/rules/no-explicit-any.ts
@@ -9,7 +9,7 @@ export type Options = [
ignoreRestArgs?: boolean;
},
];
-export type MessageIds = 'unexpectedAny' | 'suggestUnknown' | 'suggestNever';
+export type MessageIds = 'suggestNever' | 'suggestUnknown' | 'unexpectedAny';
export default util.createRule({
name: 'no-explicit-any',
@@ -17,7 +17,7 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow the `any` type',
- recommended: 'warn',
+ recommended: 'recommended',
},
fixable: 'code',
hasSuggestions: true,
@@ -83,7 +83,6 @@ export default util.createRule({
function isNodeRestElementInFunction(node: TSESTree.Node): boolean {
return (
node.type === AST_NODE_TYPES.RestElement &&
- node.parent !== undefined &&
isNodeValidFunction(node.parent)
);
}
diff --git a/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
index a69cd262d6e3..082c3d212a69 100644
--- a/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
+++ b/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts
@@ -8,7 +8,7 @@ export default util.createRule({
type: 'problem',
docs: {
description: 'Disallow extra non-null assertions',
- recommended: 'error',
+ recommended: 'recommended',
},
fixable: 'code',
schema: [],
diff --git a/packages/eslint-plugin/src/rules/no-extra-parens.ts b/packages/eslint-plugin/src/rules/no-extra-parens.ts
index a44276a0a761..b3a150ad201e 100644
--- a/packages/eslint-plugin/src/rules/no-extra-parens.ts
+++ b/packages/eslint-plugin/src/rules/no-extra-parens.ts
@@ -18,7 +18,6 @@ export default util.createRule({
type: 'layout',
docs: {
description: 'Disallow unnecessary parentheses',
- recommended: false,
extendsBaseRule: true,
},
fixable: 'code',
@@ -80,7 +79,7 @@ export default util.createRule({
if (
node.arguments.length === 1 &&
- node.typeParameters?.params.some(
+ node.typeArguments?.params.some(
param =>
param.type === AST_NODE_TYPES.TSImportType ||
param.type === AST_NODE_TYPES.TSArrayType,
diff --git a/packages/eslint-plugin/src/rules/no-extra-semi.ts b/packages/eslint-plugin/src/rules/no-extra-semi.ts
index 6fcfb4871eeb..d2860771c53b 100644
--- a/packages/eslint-plugin/src/rules/no-extra-semi.ts
+++ b/packages/eslint-plugin/src/rules/no-extra-semi.ts
@@ -12,7 +12,6 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow unnecessary semicolons',
- recommended: 'error',
extendsBaseRule: true,
},
fixable: 'code',
diff --git a/packages/eslint-plugin/src/rules/no-extraneous-class.ts b/packages/eslint-plugin/src/rules/no-extraneous-class.ts
index b7b93c8c77c3..21dda4c686dd 100644
--- a/packages/eslint-plugin/src/rules/no-extraneous-class.ts
+++ b/packages/eslint-plugin/src/rules/no-extraneous-class.ts
@@ -11,7 +11,7 @@ type Options = [
allowWithDecorator?: boolean;
},
];
-type MessageIds = 'empty' | 'onlyStatic' | 'onlyConstructor';
+type MessageIds = 'empty' | 'onlyConstructor' | 'onlyStatic';
export default util.createRule({
name: 'no-extraneous-class',
@@ -72,9 +72,8 @@ export default util.createRule({
): boolean => {
return !!(
allowWithDecorator &&
- node &&
- node.decorators &&
- node.decorators.length
+ node?.decorators &&
+ node.decorators.length !== 0
);
};
@@ -82,10 +81,9 @@ export default util.createRule({
ClassBody(node): void {
const parent = node.parent as
| TSESTree.ClassDeclaration
- | TSESTree.ClassExpression
- | undefined;
+ | TSESTree.ClassExpression;
- if (!parent || parent.superClass || isAllowWithDecorator(parent)) {
+ if (parent.superClass || isAllowWithDecorator(parent)) {
return;
}
diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts
index c4ce3db8e1cc..00c86a09c11b 100644
--- a/packages/eslint-plugin/src/rules/no-floating-promises.ts
+++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts
@@ -1,6 +1,6 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as ts from 'typescript';
import * as util from '../util';
@@ -15,9 +15,9 @@ type Options = [
type MessageId =
| 'floating'
- | 'floatingVoid'
+ | 'floatingFixAwait'
| 'floatingFixVoid'
- | 'floatingFixAwait';
+ | 'floatingVoid';
export default util.createRule({
name: 'no-floating-promises',
@@ -25,7 +25,7 @@ export default util.createRule({
docs: {
description:
'Require Promise-like statements to be handled appropriately',
- recommended: 'error',
+ recommended: 'recommended',
requiresTypeChecking: true,
},
hasSuggestions: true,
@@ -65,8 +65,8 @@ export default util.createRule({
],
create(context, [options]) {
- const parserServices = util.getParserServices(context);
- const checker = parserServices.program.getTypeChecker();
+ const services = util.getParserServices(context);
+ const checker = services.program.getTypeChecker();
return {
ExpressionStatement(node): void {
@@ -89,7 +89,7 @@ export default util.createRule({
{
messageId: 'floatingFixVoid',
fix(fixer): TSESLint.RuleFix | TSESLint.RuleFix[] {
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(
+ const tsNode = services.esTreeNodeToTSNodeMap.get(
node.expression,
);
if (isHigherPrecedenceThanUnary(tsNode)) {
@@ -124,7 +124,7 @@ export default util.createRule({
'await',
);
}
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(
+ const tsNode = services.esTreeNodeToTSNodeMap.get(
node.expression,
);
if (isHigherPrecedenceThanUnary(tsNode)) {
@@ -148,7 +148,7 @@ export default util.createRule({
};
function isHigherPrecedenceThanUnary(node: ts.Node): boolean {
- const operator = tsutils.isBinaryExpression(node)
+ const operator = ts.isBinaryExpression(node)
? node.operatorToken.kind
: ts.SyntaxKind.Unknown;
const nodePrecedence = util.getOperatorPrecedence(node.kind, operator);
@@ -191,9 +191,7 @@ export default util.createRule({
}
// Check the type. At this point it can't be unhandled if it isn't a promise
- if (
- !isPromiseLike(checker, parserServices.esTreeNodeToTSNodeMap.get(node))
- ) {
+ if (!isPromiseLike(checker, services.esTreeNodeToTSNodeMap.get(node))) {
return false;
}
diff --git a/packages/eslint-plugin/src/rules/no-for-in-array.ts b/packages/eslint-plugin/src/rules/no-for-in-array.ts
index 34590d4e5692..ab6e98321656 100644
--- a/packages/eslint-plugin/src/rules/no-for-in-array.ts
+++ b/packages/eslint-plugin/src/rules/no-for-in-array.ts
@@ -7,7 +7,7 @@ export default util.createRule({
meta: {
docs: {
description: 'Disallow iterating over an array with a for-in loop',
- recommended: 'error',
+ recommended: 'recommended',
requiresTypeChecking: true,
},
messages: {
@@ -21,14 +21,10 @@ export default util.createRule({
create(context) {
return {
ForInStatement(node): void {
- const parserServices = util.getParserServices(context);
- const checker = parserServices.program.getTypeChecker();
- const originalNode = parserServices.esTreeNodeToTSNodeMap.get(node);
+ const services = util.getParserServices(context);
+ const checker = services.program.getTypeChecker();
- const type = util.getConstrainedTypeAtLocation(
- checker,
- originalNode.expression,
- );
+ const type = util.getConstrainedTypeAtLocation(services, node.right);
if (
util.isTypeArrayTypeOrUnionOfArrayTypes(type, checker) ||
diff --git a/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts b/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts
deleted file mode 100644
index bed757b8072f..000000000000
--- a/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts
+++ /dev/null
@@ -1,96 +0,0 @@
-import type { TSESLint } from '@typescript-eslint/utils';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-
-import * as util from '../util';
-
-export type Options = [
- {
- allowExplicitAny: boolean;
- },
-];
-export type MessageIds =
- | 'implicitAnyInCatch'
- | 'explicitAnyInCatch'
- | 'suggestExplicitUnknown';
-
-export default util.createRule({
- name: 'no-implicit-any-catch',
- meta: {
- deprecated: true,
- type: 'suggestion',
- docs: {
- description: 'Disallow usage of the implicit `any` type in catch clauses',
- recommended: false,
- },
- fixable: 'code',
- hasSuggestions: true,
- messages: {
- implicitAnyInCatch: 'Implicit any in catch clause.',
- explicitAnyInCatch: 'Explicit any in catch clause.',
- suggestExplicitUnknown:
- 'Use `unknown` instead, this will force you to explicitly, and safely assert the type is correct.',
- },
- schema: [
- {
- type: 'object',
- additionalProperties: false,
- properties: {
- allowExplicitAny: {
- description:
- 'Whether to disallow specifying `: any` as the error type as well. See also `no-explicit-any`.',
- type: 'boolean',
- },
- },
- },
- ],
- },
- defaultOptions: [
- {
- allowExplicitAny: false,
- },
- ],
- create(context, [{ allowExplicitAny }]) {
- return {
- CatchClause(node): void {
- if (!node.param) {
- return; // ignore catch without variable
- }
-
- if (!node.param.typeAnnotation) {
- context.report({
- node,
- messageId: 'implicitAnyInCatch',
- suggest: [
- {
- messageId: 'suggestExplicitUnknown',
- fix(fixer): TSESLint.RuleFix {
- return fixer.insertTextAfter(node.param!, ': unknown');
- },
- },
- ],
- });
- } else if (
- !allowExplicitAny &&
- node.param.typeAnnotation.typeAnnotation.type ===
- AST_NODE_TYPES.TSAnyKeyword
- ) {
- context.report({
- node,
- messageId: 'explicitAnyInCatch',
- suggest: [
- {
- messageId: 'suggestExplicitUnknown',
- fix(fixer): TSESLint.RuleFix {
- return fixer.replaceText(
- node.param!.typeAnnotation!,
- ': unknown',
- );
- },
- },
- ],
- });
- }
- },
- };
- },
-});
diff --git a/packages/eslint-plugin/src/rules/no-implied-eval.ts b/packages/eslint-plugin/src/rules/no-implied-eval.ts
index d88cd05ff6f4..0560d7647c42 100644
--- a/packages/eslint-plugin/src/rules/no-implied-eval.ts
+++ b/packages/eslint-plugin/src/rules/no-implied-eval.ts
@@ -1,6 +1,6 @@
import type { TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as ts from 'typescript';
import * as util from '../util';
@@ -19,7 +19,7 @@ export default util.createRule({
meta: {
docs: {
description: 'Disallow the use of `eval()`-like methods',
- recommended: 'error',
+ recommended: 'recommended',
extendsBaseRule: true,
requiresTypeChecking: true,
},
@@ -33,9 +33,8 @@ export default util.createRule({
},
defaultOptions: [],
create(context) {
- const parserServices = util.getParserServices(context);
- const program = parserServices.program;
- const checker = parserServices.program.getTypeChecker();
+ const services = util.getParserServices(context);
+ const checker = services.program.getTypeChecker();
function getCalleeName(
node: TSESTree.LeftHandSideExpression,
@@ -65,8 +64,7 @@ export default util.createRule({
}
function isFunctionType(node: TSESTree.Node): boolean {
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
- const type = checker.getTypeAtLocation(tsNode);
+ const type = services.getTypeAtLocation(node);
const symbol = type.getSymbol();
if (
@@ -79,11 +77,12 @@ export default util.createRule({
return true;
}
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
if (symbol && symbol.escapedName === FUNCTION_CONSTRUCTOR) {
const declarations = symbol.getDeclarations() ?? [];
for (const declaration of declarations) {
const sourceFile = declaration.getSourceFile();
- if (program.isSourceFileDefaultLibrary(sourceFile)) {
+ if (services.program.isSourceFileDefaultLibrary(sourceFile)) {
return true;
}
}
@@ -132,7 +131,7 @@ export default util.createRule({
}
function checkImpliedEval(
- node: TSESTree.NewExpression | TSESTree.CallExpression,
+ node: TSESTree.CallExpression | TSESTree.NewExpression,
): void {
const calleeName = getCalleeName(node.callee);
if (calleeName == null) {
@@ -140,14 +139,13 @@ export default util.createRule({
}
if (calleeName === FUNCTION_CONSTRUCTOR) {
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node.callee);
- const type = checker.getTypeAtLocation(tsNode);
+ const type = services.getTypeAtLocation(node.callee);
const symbol = type.getSymbol();
if (symbol) {
const declarations = symbol.getDeclarations() ?? [];
for (const declaration of declarations) {
const sourceFile = declaration.getSourceFile();
- if (program.isSourceFileDefaultLibrary(sourceFile)) {
+ if (services.program.isSourceFileDefaultLibrary(sourceFile)) {
context.report({ node, messageId: 'noFunctionConstructor' });
return;
}
diff --git a/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts b/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts
index 941aa93e72ae..0e814a0ca48d 100644
--- a/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts
+++ b/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts
@@ -13,7 +13,6 @@ export default util.createRule({
docs: {
description:
'Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers',
- recommended: false,
},
fixable: 'code',
messages: {
diff --git a/packages/eslint-plugin/src/rules/no-inferrable-types.ts b/packages/eslint-plugin/src/rules/no-inferrable-types.ts
index 1bc83c07c701..54823f7be392 100644
--- a/packages/eslint-plugin/src/rules/no-inferrable-types.ts
+++ b/packages/eslint-plugin/src/rules/no-inferrable-types.ts
@@ -19,7 +19,7 @@ export default util.createRule({
docs: {
description:
'Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean',
- recommended: 'error',
+ recommended: 'stylistic',
},
fixable: 'code',
messages: {
@@ -90,12 +90,12 @@ export default util.createRule({
type Keywords =
| TSESTree.TSBigIntKeyword
| TSESTree.TSBooleanKeyword
- | TSESTree.TSNumberKeyword
| TSESTree.TSNullKeyword
+ | TSESTree.TSNumberKeyword
| TSESTree.TSStringKeyword
| TSESTree.TSSymbolKeyword
- | TSESTree.TSUndefinedKeyword
- | TSESTree.TSTypeReference;
+ | TSESTree.TSTypeReference
+ | TSESTree.TSUndefinedKeyword;
const keywordMap = {
[AST_NODE_TYPES.TSBigIntKeyword]: 'bigint',
[AST_NODE_TYPES.TSBooleanKeyword]: 'boolean',
@@ -193,9 +193,9 @@ export default util.createRule({
*/
function reportInferrableType(
node:
- | TSESTree.VariableDeclarator
| TSESTree.Parameter
- | TSESTree.PropertyDefinition,
+ | TSESTree.PropertyDefinition
+ | TSESTree.VariableDeclarator,
typeNode: TSESTree.TSTypeAnnotation | undefined,
initNode: TSESTree.Expression | null | undefined,
): void {
@@ -243,9 +243,9 @@ export default util.createRule({
function inferrableParameterVisitor(
node:
- | TSESTree.FunctionExpression
+ | TSESTree.ArrowFunctionExpression
| TSESTree.FunctionDeclaration
- | TSESTree.ArrowFunctionExpression,
+ | TSESTree.FunctionExpression,
): void {
if (ignoreParameters || !node.params) {
return;
diff --git a/packages/eslint-plugin/src/rules/no-invalid-this.ts b/packages/eslint-plugin/src/rules/no-invalid-this.ts
index 36236d0b4af9..c1acdb24fe7a 100644
--- a/packages/eslint-plugin/src/rules/no-invalid-this.ts
+++ b/packages/eslint-plugin/src/rules/no-invalid-this.ts
@@ -20,13 +20,9 @@ export default createRule({
docs: {
description:
'Disallow `this` keywords outside of classes or class-like objects',
- recommended: false,
extendsBaseRule: true,
},
- // TODO: this rule has only had messages since v7.0 - remove this when we remove support for v6
- messages: baseRule.meta.messages ?? {
- unexpectedThis: "Unexpected 'this'.",
- },
+ messages: baseRule.meta.messages,
hasSuggestions: baseRule.meta.hasSuggestions,
schema: baseRule.meta.schema,
},
diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts
index 9f938ac438f7..4808a439f5a3 100644
--- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts
+++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts
@@ -4,14 +4,14 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
interface Options {
- allowInGenericTypeArguments?: boolean | string[];
+ allowInGenericTypeArguments?: string[] | boolean;
allowAsThisParameter?: boolean;
}
type MessageIds =
| 'invalidVoidForGeneric'
- | 'invalidVoidNotReturnOrGeneric'
| 'invalidVoidNotReturn'
+ | 'invalidVoidNotReturnOrGeneric'
| 'invalidVoidNotReturnOrThisParam'
| 'invalidVoidNotReturnOrThisParamOrGeneric'
| 'invalidVoidUnionConstituent';
@@ -47,7 +47,7 @@ export default util.createRule<[Options], MessageIds>({
{
type: 'array',
items: { type: 'string' },
- minLength: 1,
+ minItems: 1,
},
],
},
@@ -156,9 +156,9 @@ export default util.createRule<[Options], MessageIds>({
validUnionMembers.includes(member.type) ||
// allows any T<..., void, ...> here, checked by checkGenericTypeArgument
(member.type === AST_NODE_TYPES.TSTypeReference &&
- member.typeParameters?.type ===
+ member.typeArguments?.type ===
AST_NODE_TYPES.TSTypeParameterInstantiation &&
- member.typeParameters?.params
+ member.typeArguments?.params
.map(param => param.type)
.includes(AST_NODE_TYPES.TSVoidKeyword)),
);
@@ -166,11 +166,6 @@ export default util.createRule<[Options], MessageIds>({
return {
TSVoidKeyword(node: TSESTree.TSVoidKeyword): void {
- /* istanbul ignore next */
- if (!node.parent?.parent) {
- return;
- }
-
// checks T<..., void, ...> against specification of allowInGenericArguments option
if (
node.parent.type === AST_NODE_TYPES.TSTypeParameterInstantiation &&
@@ -211,7 +206,7 @@ export default util.createRule<[Options], MessageIds>({
// default cases
if (
validParents.includes(node.parent.type) &&
- !invalidGrandParents.includes(node.parent.parent.type)
+ !invalidGrandParents.includes(node.parent.parent!.type)
) {
return;
}
@@ -235,7 +230,7 @@ export default util.createRule<[Options], MessageIds>({
function getNotReturnOrGenericMessageId(
node: TSESTree.TSVoidKeyword,
): MessageIds {
- return node.parent!.type === AST_NODE_TYPES.TSUnionType
+ return node.parent.type === AST_NODE_TYPES.TSUnionType
? 'invalidVoidUnionConstituent'
: 'invalidVoidNotReturnOrGeneric';
}
diff --git a/packages/eslint-plugin/src/rules/no-loop-func.ts b/packages/eslint-plugin/src/rules/no-loop-func.ts
index 9e24cef086c5..f4e4b50825c9 100644
--- a/packages/eslint-plugin/src/rules/no-loop-func.ts
+++ b/packages/eslint-plugin/src/rules/no-loop-func.ts
@@ -16,7 +16,6 @@ export default util.createRule({
docs: {
description:
'Disallow function declarations that contain unsafe references inside loop statements',
- recommended: false,
extendsBaseRule: true,
},
hasSuggestions: baseRule.meta.hasSuggestions,
@@ -36,8 +35,8 @@ export default util.createRule({
function checkForLoops(
node:
| TSESTree.ArrowFunctionExpression
- | TSESTree.FunctionExpression
- | TSESTree.FunctionDeclaration,
+ | TSESTree.FunctionDeclaration
+ | TSESTree.FunctionExpression,
): void {
const loopNode = getContainingLoopNode(node);
diff --git a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts
index 2c0d84364e4b..8a07f975ab15 100644
--- a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts
+++ b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts
@@ -16,7 +16,7 @@ export default util.createRule({
type: 'problem',
docs: {
description: 'Disallow literal numbers that lose precision',
- recommended: 'error',
+ recommended: 'recommended',
extendsBaseRule: true,
},
hasSuggestions: baseRule?.meta.hasSuggestions,
diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts
index 604e82d21861..92a03c9078d4 100644
--- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts
+++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts
@@ -1,5 +1,6 @@
import type { TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
+import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
import * as util from '../util';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
@@ -31,7 +32,7 @@ const schema = util.deepMerge(
},
},
},
-);
+) as unknown as JSONSchema4;
export default util.createRule({
name: 'no-magic-numbers',
@@ -39,7 +40,6 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow magic numbers',
- recommended: false,
extendsBaseRule: true,
},
schema: [schema],
diff --git a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts
index 79d0611e5d05..524c54387889 100644
--- a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts
+++ b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts
@@ -1,6 +1,6 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { ESLintUtils } from '@typescript-eslint/utils';
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as ts from 'typescript';
import * as util from '../util';
@@ -47,8 +47,8 @@ export default util.createRule<
defaultOptions: [{ checkNever: false }],
create(context, [{ checkNever }]) {
- const parserServices = ESLintUtils.getParserServices(context);
- const checker = parserServices.program.getTypeChecker();
+ const services = ESLintUtils.getParserServices(context);
+ const checker = services.program.getTypeChecker();
const sourceCode = context.getSourceCode();
return {
@@ -60,10 +60,7 @@ export default util.createRule<
]);
};
- const argTsNode = parserServices.esTreeNodeToTSNodeMap.get(
- node.argument,
- );
- const argType = checker.getTypeAtLocation(argTsNode);
+ const argType = services.getTypeAtLocation(node.argument);
const unionParts = tsutils.unionTypeParts(argType);
if (
unionParts.every(
diff --git a/packages/eslint-plugin/src/rules/no-misused-new.ts b/packages/eslint-plugin/src/rules/no-misused-new.ts
index 7a4dcc69dabb..41df0cb5f997 100644
--- a/packages/eslint-plugin/src/rules/no-misused-new.ts
+++ b/packages/eslint-plugin/src/rules/no-misused-new.ts
@@ -9,7 +9,7 @@ export default util.createRule({
type: 'problem',
docs: {
description: 'Enforce valid definition of `new` and `constructor`',
- recommended: 'error',
+ recommended: 'recommended',
},
schema: [],
messages: {
@@ -25,9 +25,9 @@ export default util.createRule({
*/
function getTypeReferenceName(
node:
+ | TSESTree.EntityName
| TSESTree.TSTypeAnnotation
| TSESTree.TypeNode
- | TSESTree.EntityName
| undefined,
): string | null {
if (node) {
@@ -50,7 +50,7 @@ export default util.createRule({
* @param returnType type to be compared
*/
function isMatchingParentType(
- parent: undefined | TSESTree.Node,
+ parent: TSESTree.Node | undefined,
returnType: TSESTree.TSTypeAnnotation | undefined,
): boolean {
if (
@@ -70,7 +70,7 @@ export default util.createRule({
): void {
if (
isMatchingParentType(
- node.parent!.parent as TSESTree.TSInterfaceDeclaration,
+ node.parent.parent as TSESTree.TSInterfaceDeclaration,
node.returnType,
)
) {
@@ -93,10 +93,7 @@ export default util.createRule({
node: TSESTree.MethodDefinition,
): void {
if (node.value.type === AST_NODE_TYPES.TSEmptyBodyFunctionExpression) {
- if (
- node.parent &&
- isMatchingParentType(node.parent.parent, node.value.returnType)
- ) {
+ if (isMatchingParentType(node.parent.parent, node.value.returnType)) {
context.report({
node,
messageId: 'errorMessageClass',
diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts
index 8a7f2875170f..a5fe0721b88d 100644
--- a/packages/eslint-plugin/src/rules/no-misused-promises.ts
+++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts
@@ -1,6 +1,6 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as ts from 'typescript';
import * as util from '../util';
@@ -8,7 +8,7 @@ import * as util from '../util';
type Options = [
{
checksConditionals?: boolean;
- checksVoidReturn?: boolean | ChecksVoidReturnOptions;
+ checksVoidReturn?: ChecksVoidReturnOptions | boolean;
checksSpreads?: boolean;
},
];
@@ -23,15 +23,15 @@ interface ChecksVoidReturnOptions {
type MessageId =
| 'conditional'
+ | 'spread'
| 'voidReturnArgument'
- | 'voidReturnVariable'
+ | 'voidReturnAttribute'
| 'voidReturnProperty'
| 'voidReturnReturnValue'
- | 'voidReturnAttribute'
- | 'spread';
+ | 'voidReturnVariable';
function parseChecksVoidReturn(
- checksVoidReturn: boolean | ChecksVoidReturnOptions | undefined,
+ checksVoidReturn: ChecksVoidReturnOptions | boolean | undefined,
): ChecksVoidReturnOptions | false {
switch (checksVoidReturn) {
case false:
@@ -63,7 +63,7 @@ export default util.createRule({
meta: {
docs: {
description: 'Disallow Promises in places not designed to handle them',
- recommended: 'error',
+ recommended: 'recommended',
requiresTypeChecking: true,
},
messages: {
@@ -83,6 +83,7 @@ export default util.createRule({
schema: [
{
type: 'object',
+ additionalProperties: false,
properties: {
checksConditionals: {
type: 'boolean',
@@ -120,8 +121,8 @@ export default util.createRule({
],
create(context, [{ checksConditionals, checksVoidReturn, checksSpreads }]) {
- const parserServices = util.getParserServices(context);
- const checker = parserServices.program.getTypeChecker();
+ const services = util.getParserServices(context);
+ const checker = services.program.getTypeChecker();
const checkedNodes = new Set();
@@ -200,7 +201,7 @@ export default util.createRule({
}
return;
}
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
+ const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (isAlwaysThenable(checker, tsNode)) {
context.report({
messageId: 'conditional',
@@ -212,7 +213,7 @@ export default util.createRule({
function checkArguments(
node: TSESTree.CallExpression | TSESTree.NewExpression,
): void {
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
+ const tsNode = services.esTreeNodeToTSNodeMap.get(node);
const voidArgs = voidFunctionArguments(checker, tsNode);
if (voidArgs.size === 0) {
return;
@@ -223,7 +224,7 @@ export default util.createRule({
continue;
}
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(argument);
+ const tsNode = services.esTreeNodeToTSNodeMap.get(argument);
if (returnsThenable(checker, tsNode as ts.Expression)) {
context.report({
messageId: 'voidReturnArgument',
@@ -234,8 +235,8 @@ export default util.createRule({
}
function checkAssignment(node: TSESTree.AssignmentExpression): void {
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
- const varType = checker.getTypeAtLocation(tsNode.left);
+ const tsNode = services.esTreeNodeToTSNodeMap.get(node);
+ const varType = services.getTypeAtLocation(node.left);
if (!isVoidReturningFunctionType(checker, tsNode.left, varType)) {
return;
}
@@ -249,11 +250,11 @@ export default util.createRule({
}
function checkVariableDeclaration(node: TSESTree.VariableDeclarator): void {
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
+ const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (tsNode.initializer === undefined || node.init == null) {
return;
}
- const varType = checker.getTypeAtLocation(tsNode.name);
+ const varType = services.getTypeAtLocation(node.id);
if (!isVoidReturningFunctionType(checker, tsNode.initializer, varType)) {
return;
}
@@ -267,7 +268,7 @@ export default util.createRule({
}
function checkProperty(node: TSESTree.Property): void {
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
+ const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (ts.isPropertyAssignment(tsNode)) {
const contextualType = checker.getContextualType(tsNode.initializer);
if (
@@ -343,7 +344,7 @@ export default util.createRule({
}
function checkReturnStatement(node: TSESTree.ReturnStatement): void {
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
+ const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (tsNode.expression === undefined || node.argument == null) {
return;
}
@@ -371,10 +372,10 @@ export default util.createRule({
) {
return;
}
- const expressionContainer = parserServices.esTreeNodeToTSNodeMap.get(
+ const expressionContainer = services.esTreeNodeToTSNodeMap.get(
node.value,
);
- const expression = parserServices.esTreeNodeToTSNodeMap.get(
+ const expression = services.esTreeNodeToTSNodeMap.get(
node.value.expression,
);
const contextualType = checker.getContextualType(expressionContainer);
@@ -395,7 +396,7 @@ export default util.createRule({
}
function checkSpread(node: TSESTree.SpreadElement): void {
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node);
+ const tsNode = services.esTreeNodeToTSNodeMap.get(node);
if (isSometimesThenable(checker, tsNode.expression)) {
context.report({
diff --git a/packages/eslint-plugin/src/rules/no-mixed-enums.ts b/packages/eslint-plugin/src/rules/no-mixed-enums.ts
index 047471d4b262..33ad352b1b69 100644
--- a/packages/eslint-plugin/src/rules/no-mixed-enums.ts
+++ b/packages/eslint-plugin/src/rules/no-mixed-enums.ts
@@ -2,7 +2,7 @@ import type { Scope } from '@typescript-eslint/scope-manager';
import { DefinitionType } from '@typescript-eslint/scope-manager';
import type { TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as ts from 'typescript';
import * as util from '../util';
@@ -157,8 +157,8 @@ export default util.createRule({
// export enum MyEnum { B }
// }
if (
- node.parent!.type === AST_NODE_TYPES.ExportNamedDeclaration &&
- node.parent!.parent!.type === AST_NODE_TYPES.TSModuleBlock
+ node.parent.type === AST_NODE_TYPES.ExportNamedDeclaration &&
+ node.parent.parent.type === AST_NODE_TYPES.TSModuleBlock
) {
// TODO: We don't need to dip into the TypeScript type checker here!
// Merged namespaces must all exist in the same file.
diff --git a/packages/eslint-plugin/src/rules/no-namespace.ts b/packages/eslint-plugin/src/rules/no-namespace.ts
index 2a9a4a251bed..145ddc3ad16b 100644
--- a/packages/eslint-plugin/src/rules/no-namespace.ts
+++ b/packages/eslint-plugin/src/rules/no-namespace.ts
@@ -17,7 +17,7 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow TypeScript namespaces',
- recommended: 'error',
+ recommended: 'recommended',
},
messages: {
moduleSyntaxIsPreferred:
@@ -63,12 +63,11 @@ export default util.createRule({
}
return {
- "TSModuleDeclaration[global!=true][id.type='Identifier']"(
+ "TSModuleDeclaration[global!=true][id.type!='Literal']"(
node: TSESTree.TSModuleDeclaration,
): void {
if (
- (node.parent &&
- node.parent.type === AST_NODE_TYPES.TSModuleDeclaration) ||
+ node.parent.type === AST_NODE_TYPES.TSModuleDeclaration ||
(allowDefinitionFiles && util.isDefinitionFile(filename)) ||
(allowDeclarations && isDeclaration(node))
) {
diff --git a/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts b/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts
index d63b3ad43e34..3939fbdebb2a 100644
--- a/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts
+++ b/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts
@@ -1,18 +1,7 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-import * as semver from 'semver';
-import * as ts from 'typescript';
import * as util from '../util';
-const is3dot9 = semver.satisfies(
- ts.version,
- `>= 3.9.0 || >= 3.9.1-rc || >= 3.9.0-beta`,
- {
- includePrerelease: true,
- },
-);
-
export default util.createRule({
name: 'no-non-null-asserted-optional-chain',
meta: {
@@ -20,7 +9,7 @@ export default util.createRule({
docs: {
description:
'Disallow non-null assertions after an optional chain expression',
- recommended: 'error',
+ recommended: 'recommended',
},
hasSuggestions: true,
messages: {
@@ -32,16 +21,7 @@ export default util.createRule({
},
defaultOptions: [],
create(context) {
- // TS3.9 made a breaking change to how non-null works with optional chains.
- // Pre-3.9, `x?.y!.z` means `(x?.y).z` - i.e. it essentially scrubbed the optionality from the chain
- // Post-3.9, `x?.y!.z` means `x?.y!.z` - i.e. it just asserts that the property `y` is non-null, not the result of `x?.y`.
- // This means that for > 3.9, x?.y!.z is valid!
- //
- // NOTE: these cases are still invalid for 3.9:
- // - x?.y.z!
- // - (x?.y)!.z
-
- const baseSelectors = {
+ return {
// non-nulling a wrapped chain will scrub all nulls introduced by the chain
// (x?.y)!
// (x?.())!
@@ -89,62 +69,5 @@ export default util.createRule({
});
},
};
-
- if (is3dot9) {
- return baseSelectors;
- }
-
- return {
- ...baseSelectors,
- [[
- // > :not(ChainExpression) because that case is handled by a previous selector
- 'MemberExpression > TSNonNullExpression.object > :not(ChainExpression)',
- 'CallExpression > TSNonNullExpression.callee > :not(ChainExpression)',
- ].join(', ')](child: TSESTree.Node): void {
- // selector guarantees this assertion
- const node = child.parent as TSESTree.TSNonNullExpression;
-
- let current = child;
- while (current) {
- switch (current.type) {
- case AST_NODE_TYPES.MemberExpression:
- if (current.optional) {
- // found an optional chain! stop traversing
- break;
- }
-
- current = current.object;
- continue;
-
- case AST_NODE_TYPES.CallExpression:
- if (current.optional) {
- // found an optional chain! stop traversing
- break;
- }
-
- current = current.callee;
- continue;
-
- default:
- // something that's not a ChainElement, which means this is not an optional chain we want to check
- return;
- }
- }
-
- context.report({
- node,
- messageId: 'noNonNullOptionalChain',
- // use a suggestion instead of a fixer, because this can obviously break type checks
- suggest: [
- {
- messageId: 'suggestRemovingNonNull',
- fix(fixer): TSESLint.RuleFix {
- return fixer.removeRange([node.range[1] - 1, node.range[1]]);
- },
- },
- ],
- });
- },
- };
},
});
diff --git a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts
index 7a11802a7377..ba8b88158def 100644
--- a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts
+++ b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts
@@ -12,7 +12,7 @@ export default util.createRule<[], MessageIds>({
docs: {
description:
'Disallow non-null assertions using the `!` postfix operator',
- recommended: 'warn',
+ recommended: 'strict',
},
hasSuggestions: true,
messages: {
@@ -29,7 +29,7 @@ export default util.createRule<[], MessageIds>({
TSNonNullExpression(node): void {
const suggest: TSESLint.ReportSuggestionArray = [];
function convertTokenToOptional(
- replacement: '?' | '?.',
+ replacement: '?.' | '?',
): TSESLint.ReportFixFunction {
return (fixer: TSESLint.RuleFixer): TSESLint.RuleFix | null => {
const operator = sourceCode.getTokenAfter(
diff --git a/packages/eslint-plugin/src/rules/no-parameter-properties.ts b/packages/eslint-plugin/src/rules/no-parameter-properties.ts
deleted file mode 100644
index 3952dfc581f1..000000000000
--- a/packages/eslint-plugin/src/rules/no-parameter-properties.ts
+++ /dev/null
@@ -1,114 +0,0 @@
-import type { TSESTree } from '@typescript-eslint/utils';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-
-import * as util from '../util';
-
-type Modifier =
- | 'readonly'
- | 'private'
- | 'protected'
- | 'public'
- | 'private readonly'
- | 'protected readonly'
- | 'public readonly';
-type Options = [
- {
- allows: Modifier[];
- },
-];
-type MessageIds = 'noParamProp';
-
-export default util.createRule({
- name: 'no-parameter-properties',
- meta: {
- deprecated: true,
- replacedBy: ['@typescript-eslint/parameter-properties'],
- type: 'problem',
- docs: {
- description:
- 'Disallow the use of parameter properties in class constructors',
- // too opinionated to be recommended
- recommended: false,
- },
- messages: {
- noParamProp:
- 'Property {{parameter}} cannot be declared in the constructor.',
- },
- schema: [
- {
- type: 'object',
- properties: {
- allows: {
- type: 'array',
- items: {
- enum: [
- 'readonly',
- 'private',
- 'protected',
- 'public',
- 'private readonly',
- 'protected readonly',
- 'public readonly',
- ],
- },
- minItems: 1,
- },
- },
- additionalProperties: false,
- },
- ],
- },
- defaultOptions: [
- {
- allows: [],
- },
- ],
- create(context, [{ allows }]) {
- /**
- * Gets the modifiers of `node`.
- * @param node the node to be inspected.
- */
- function getModifiers(node: TSESTree.TSParameterProperty): Modifier {
- const modifiers: Modifier[] = [];
-
- if (node.accessibility) {
- modifiers.push(node.accessibility);
- }
- if (node.readonly) {
- modifiers.push('readonly');
- }
-
- return modifiers.filter(Boolean).join(' ') as Modifier;
- }
-
- return {
- TSParameterProperty(node): void {
- const modifiers = getModifiers(node);
-
- if (!allows.includes(modifiers)) {
- // HAS to be an identifier or assignment or TSC will throw
- if (
- node.parameter.type !== AST_NODE_TYPES.Identifier &&
- node.parameter.type !== AST_NODE_TYPES.AssignmentPattern
- ) {
- return;
- }
-
- const name =
- node.parameter.type === AST_NODE_TYPES.Identifier
- ? node.parameter.name
- : // has to be an Identifier or TSC will throw an error
- (node.parameter.left as TSESTree.Identifier).name;
-
- context.report({
- node,
- messageId: 'noParamProp',
- data: {
- parameter: name,
- },
- });
- }
- },
- };
- },
-});
diff --git a/packages/eslint-plugin/src/rules/no-redeclare.ts b/packages/eslint-plugin/src/rules/no-redeclare.ts
index 2b10c97c8e76..1f47b575c813 100644
--- a/packages/eslint-plugin/src/rules/no-redeclare.ts
+++ b/packages/eslint-plugin/src/rules/no-redeclare.ts
@@ -1,3 +1,4 @@
+import { ScopeType } from '@typescript-eslint/scope-manager';
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
@@ -17,7 +18,6 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow variable redeclaration',
- recommended: false,
extendsBaseRule: true,
},
schema: [
@@ -67,8 +67,8 @@ export default util.createRule({
function* iterateDeclarations(variable: TSESLint.Scope.Variable): Generator<
{
- type: 'builtin' | 'syntax' | 'comment';
- node?: TSESTree.Identifier | TSESTree.Comment;
+ type: 'builtin' | 'comment' | 'syntax';
+ node?: TSESTree.Comment | TSESTree.Identifier;
loc?: TSESTree.SourceLocation;
},
void,
@@ -103,7 +103,7 @@ export default util.createRule({
const identifiers = variable.identifiers
.map(id => ({
identifier: id,
- parent: id.parent!,
+ parent: id.parent,
}))
// ignore function declarations because TS will treat them as an overload
.filter(
@@ -256,7 +256,7 @@ export default util.createRule({
// Node.js or ES modules has a special scope.
if (
- scope.type === 'global' &&
+ scope.type === ScopeType.global &&
scope.childScopes[0] &&
// The special scope's block is the Program node.
scope.block === scope.childScopes[0].block
diff --git a/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts b/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts
index bc8fc8a4a3f5..e70637256bfd 100644
--- a/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts
+++ b/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts
@@ -1,5 +1,5 @@
import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils';
-import * as tsutils from 'tsutils';
+import * as tsutils from 'ts-api-utils';
import * as ts from 'typescript';
import * as util from '../util';
@@ -51,7 +51,7 @@ const keywordNodeTypesToTsTypes = new Map([
[TSESTree.AST_NODE_TYPES.TSStringKeyword, ts.TypeFlags.String],
]);
-type PrimitiveTypeFlag = typeof primitiveTypeFlags[number];
+type PrimitiveTypeFlag = (typeof primitiveTypeFlags)[number];
interface TypeFlagsWithName {
typeFlags: ts.TypeFlags;
@@ -87,6 +87,7 @@ function describeLiteralType(type: ts.Type): string {
}
if (type.isLiteral()) {
+ // eslint-disable-next-line @typescript-eslint/no-base-to-string
return type.value.toString();
}
@@ -106,11 +107,15 @@ function describeLiteralType(type: ts.Type): string {
return 'template literal type';
}
- if (tsutils.isBooleanLiteralType(type, true)) {
+ if (util.isTypeBigIntLiteralType(type)) {
+ return `${type.value.negative ? '-' : ''}${type.value.base10Value}n`;
+ }
+
+ if (tsutils.isTrueLiteralType(type)) {
return 'true';
}
- if (tsutils.isBooleanLiteralType(type, false)) {
+ if (tsutils.isFalseLiteralType(type)) {
return 'false';
}
@@ -155,7 +160,6 @@ function describeLiteralTypeNode(typeNode: TSESTree.TypeNode): string {
function isNodeInsideReturnType(node: TSESTree.TSUnionType): boolean {
return !!(
node.parent?.type === AST_NODE_TYPES.TSTypeAnnotation &&
- node.parent.parent &&
(util.isFunctionType(node.parent.parent) ||
util.isFunction(node.parent.parent))
);
@@ -167,8 +171,8 @@ function isNodeInsideReturnType(node: TSESTree.TSUnionType): boolean {
function unionTypePartsUnlessBoolean(type: ts.Type): ts.Type[] {
return type.isUnion() &&
type.types.length === 2 &&
- tsutils.isBooleanLiteralType(type.types[0], false) &&
- tsutils.isBooleanLiteralType(type.types[1], true)
+ tsutils.isFalseLiteralType(type.types[0]) &&
+ tsutils.isTrueLiteralType(type.types[1])
? [type]
: tsutils.unionTypeParts(type);
}
@@ -179,7 +183,7 @@ export default util.createRule({
docs: {
description:
'Disallow members of unions and intersections that do nothing or override type information',
- recommended: false,
+ recommended: 'recommended',
requiresTypeChecking: true,
},
messages: {
@@ -193,7 +197,7 @@ export default util.createRule({
},
defaultOptions: [],
create(context) {
- const parserServices = util.getParserServices(context);
+ const services = util.getParserServices(context);
const typesCache = new Map();
function getTypeNodeTypePartFlags(
@@ -229,9 +233,7 @@ export default util.createRule({
return typeNode.types.flatMap(getTypeNodeTypePartFlags);
}
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(typeNode);
- const checker = parserServices.program.getTypeChecker();
- const nodeType = checker.getTypeAtLocation(tsNode);
+ const nodeType = services.getTypeAtLocation(typeNode);
const typeParts = unionTypePartsUnlessBoolean(nodeType);
return typeParts.map(typePart => ({
diff --git a/packages/eslint-plugin/src/rules/no-require-imports.ts b/packages/eslint-plugin/src/rules/no-require-imports.ts
index 9abe12504064..2f9310b38fcd 100644
--- a/packages/eslint-plugin/src/rules/no-require-imports.ts
+++ b/packages/eslint-plugin/src/rules/no-require-imports.ts
@@ -9,7 +9,6 @@ export default util.createRule({
type: 'problem',
docs: {
description: 'Disallow invocation of `require()`',
- recommended: false,
},
schema: [],
messages: {
diff --git a/packages/eslint-plugin/src/rules/no-restricted-imports.ts b/packages/eslint-plugin/src/rules/no-restricted-imports.ts
index c2c2b54aa721..8c191dbaae9c 100644
--- a/packages/eslint-plugin/src/rules/no-restricted-imports.ts
+++ b/packages/eslint-plugin/src/rules/no-restricted-imports.ts
@@ -1,4 +1,5 @@
import type { TSESTree } from '@typescript-eslint/utils';
+import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema';
import type {
ArrayOfStringOrObject,
ArrayOfStringOrObjectPatterns,
@@ -10,7 +11,7 @@ import type {
InferMessageIdsTypeFromRule,
InferOptionsTypeFromRule,
} from '../util';
-import { createRule, deepMerge } from '../util';
+import { createRule } from '../util';
import { getESLintCoreRule } from '../util/getESLintCoreRule';
const baseRule = getESLintCoreRule('no-restricted-imports');
@@ -18,48 +19,86 @@ const baseRule = getESLintCoreRule('no-restricted-imports');
export type Options = InferOptionsTypeFromRule;
export type MessageIds = InferMessageIdsTypeFromRule;
-const allowTypeImportsOptionSchema = {
- allowTypeImports: {
- type: 'boolean',
- default: false,
- },
-};
-const schemaForMergeArrayOfStringsOrObjects = {
+const arrayOfStringsOrObjects: JSONSchema4 = {
+ type: 'array',
items: {
anyOf: [
- {},
+ { type: 'string' },
{
- properties: allowTypeImportsOptionSchema,
+ type: 'object',
+ properties: {
+ name: { type: 'string' },
+ message: {
+ type: 'string',
+ minLength: 1,
+ },
+ importNames: {
+ type: 'array',
+ items: {
+ type: 'string',
+ },
+ },
+ allowTypeImports: {
+ type: 'boolean',
+ description: 'Disallow value imports, but allow type-only imports.',
+ },
+ },
+ additionalProperties: false,
+ required: ['name'],
},
],
},
+ uniqueItems: true,
};
-const schemaForMergeArrayOfStringsOrObjectPatterns = {
+const arrayOfStringsOrObjectPatterns: JSONSchema4 = {
anyOf: [
- {},
{
+ type: 'array',
items: {
- properties: allowTypeImportsOptionSchema,
+ type: 'string',
},
+ uniqueItems: true,
},
- ],
-};
-const schema = deepMerge(
- { ...baseRule.meta.schema },
- {
- anyOf: [
- schemaForMergeArrayOfStringsOrObjects,
- {
- items: {
- properties: {
- paths: schemaForMergeArrayOfStringsOrObjects,
- patterns: schemaForMergeArrayOfStringsOrObjectPatterns,
+ {
+ type: 'array',
+ items: {
+ type: 'object',
+ properties: {
+ importNames: {
+ type: 'array',
+ items: {
+ type: 'string',
+ },
+ minItems: 1,
+ uniqueItems: true,
+ },
+ group: {
+ type: 'array',
+ items: {
+ type: 'string',
+ },
+ minItems: 1,
+ uniqueItems: true,
+ },
+ message: {
+ type: 'string',
+ minLength: 1,
+ },
+ caseSensitive: {
+ type: 'boolean',
+ },
+ allowTypeImports: {
+ type: 'boolean',
+ description: 'Disallow value imports, but allow type-only imports.',
},
},
+ additionalProperties: false,
+ required: ['group'],
},
- ],
- },
-);
+ uniqueItems: true,
+ },
+ ],
+};
function isObjectOfPaths(
obj: unknown,
@@ -110,12 +149,29 @@ export default createRule({
type: 'suggestion',
docs: {
description: 'Disallow specified modules when loaded by `import`',
- recommended: false,
extendsBaseRule: true,
},
messages: baseRule.meta.messages,
fixable: baseRule.meta.fixable,
- schema,
+ schema: {
+ anyOf: [
+ arrayOfStringsOrObjects,
+ {
+ type: 'array',
+ items: [
+ {
+ type: 'object',
+ properties: {
+ paths: arrayOfStringsOrObjects,
+ patterns: arrayOfStringsOrObjectPatterns,
+ },
+ additionalProperties: false,
+ },
+ ],
+ additionalItems: false,
+ },
+ ],
+ },
},
defaultOptions: [],
create(context) {
@@ -127,7 +183,7 @@ export default createRule({
}
const restrictedPaths = getRestrictedPaths(options);
- const allowedTypeImportPathNameSet: Set = new Set();
+ const allowedTypeImportPathNameSet = new Set();
for (const restrictedPath of restrictedPaths) {
if (
typeof restrictedPath === 'object' &&
diff --git a/packages/eslint-plugin/src/rules/no-shadow.ts b/packages/eslint-plugin/src/rules/no-shadow.ts
index e9b73370966e..ed202e9ea759 100644
--- a/packages/eslint-plugin/src/rules/no-shadow.ts
+++ b/packages/eslint-plugin/src/rules/no-shadow.ts
@@ -33,7 +33,6 @@ export default util.createRule({
docs: {
description:
'Disallow variable declarations from shadowing variables declared in the outer scope',
- recommended: false,
extendsBaseRule: true,
},
schema: [
@@ -44,6 +43,7 @@ export default util.createRule({
type: 'boolean',
},
hoist: {
+ type: 'string',
enum: ['all', 'functions', 'never'],
},
allow: {
@@ -365,7 +365,7 @@ export default util.createRule({
): TSESLint.Scope.Scope | null {
const upper = scope.upper;
- if (upper?.type === 'function-expression-name') {
+ if (upper?.type === ScopeType.functionExpressionName) {
return upper.upper;
}
return upper;
@@ -529,7 +529,7 @@ export default util.createRule({
*/
function getDeclaredLocation(
variable: TSESLint.Scope.Variable,
- ): { global: true } | { global: false; line: number; column: number } {
+ ): { global: false; line: number; column: number } | { global: true } {
const identifier = variable.identifiers[0];
if (identifier) {
return {
diff --git a/packages/eslint-plugin/src/rules/no-this-alias.ts b/packages/eslint-plugin/src/rules/no-this-alias.ts
index 2301bf11a99d..57a326e2e808 100644
--- a/packages/eslint-plugin/src/rules/no-this-alias.ts
+++ b/packages/eslint-plugin/src/rules/no-this-alias.ts
@@ -17,7 +17,7 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow aliasing `this`',
- recommended: 'error',
+ recommended: 'recommended',
},
schema: [
{
@@ -55,7 +55,7 @@ export default util.createRule({
create(context, [{ allowDestructuring, allowedNames }]) {
return {
"VariableDeclarator[init.type='ThisExpression'], AssignmentExpression[right.type='ThisExpression']"(
- node: TSESTree.VariableDeclarator | TSESTree.AssignmentExpression,
+ node: TSESTree.AssignmentExpression | TSESTree.VariableDeclarator,
): void {
const id =
node.type === AST_NODE_TYPES.VariableDeclarator ? node.id : node.left;
diff --git a/packages/eslint-plugin/src/rules/no-throw-literal.ts b/packages/eslint-plugin/src/rules/no-throw-literal.ts
index 9f79ea0ff476..55145507d657 100644
--- a/packages/eslint-plugin/src/rules/no-throw-literal.ts
+++ b/packages/eslint-plugin/src/rules/no-throw-literal.ts
@@ -49,9 +49,8 @@ export default util.createRule