diff --git a/.cspell.json b/.cspell.json
index b8e07af4864..6f036d77516 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/**",
@@ -44,6 +52,7 @@
"ambiently",
"Armano",
"astexplorer",
+ "Astro",
"ASTs",
"autofix",
"autofixers",
@@ -108,15 +117,16 @@
"rulesets",
"serializers",
"Sourcegraph",
+ "stringification",
"superset",
"thenables",
"transpiled",
"transpiles",
"transpiling",
"triaging",
+ "trpc",
"tsconfigs",
"tseslint",
- "tsutils",
"tsvfs",
"typedef",
"typedefs",
diff --git a/.eslintignore b/.eslintignore
index 1e5cc6e0083..431bc803029 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 ee9dba8c4d0..9795cfb5792 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/DISCUSSION_TEMPLATE/rfcs.yml b/.github/DISCUSSION_TEMPLATE/rfcs.yml
index e9467392b44..446767111f6 100644
--- a/.github/DISCUSSION_TEMPLATE/rfcs.yml
+++ b/.github/DISCUSSION_TEMPLATE/rfcs.yml
@@ -14,11 +14,12 @@ body:
- attributes:
label: Before you submit your RFC, please confirm the following. If any of these required steps are not taken, we may not be able to review your RFC. Help us to help you!
options:
+ - label: I have [read the discussions guidelines](https://typescript-eslint.io/contributing/discussions) and per those guidelines, this fits a discussion category, _not_ a help request or standard issue.
+ required: true
- label: I have [searched for related discussions](https://github.com/typescript-eslint/typescript-eslint/discussions) and [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues) and found none that match my proposal.
required: true
- label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
required: true
id: required-checks
type: checkboxes
-labels: ['rfc']
title: Your Title Here
diff --git a/.github/DISCUSSION_TEMPLATE/technical-discussions.yml b/.github/DISCUSSION_TEMPLATE/technical-discussions.yml
new file mode 100644
index 00000000000..7c8f96d2fca
--- /dev/null
+++ b/.github/DISCUSSION_TEMPLATE/technical-discussions.yml
@@ -0,0 +1,25 @@
+body:
+ - attributes:
+ label: Body
+ value: |
+ Body of the technical discussion...
+ id: body
+ type: textarea
+ - attributes:
+ label: Additional Info
+ value: |
+ Any additional info...
+ id: additional
+ type: textarea
+ - attributes:
+ label: Before you submit your discussion, please confirm the following. If any of these required steps are not taken, we may not be able to review your RFC. Help us to help you!
+ options:
+ - label: I have [read the discussions guidelines](https://typescript-eslint.io/contributing/discussions) and per those guidelines, this fits a discussion category, _not_ a help request or standard issue.
+ required: true
+ - label: I have [searched for related discussions](https://github.com/typescript-eslint/typescript-eslint/discussions) and [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues) and found none that match my proposal.
+ required: true
+ - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed.
+ required: true
+ id: required-checks
+ type: checkboxes
+title: Your Title Here
diff --git a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml
index 91f2cf35fd3..3e3fc8aa137 100644
--- a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml
+++ b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml
@@ -36,6 +36,7 @@ body:
- ast-spec
- eslint-plugin-tslint
- parser
+ - rule-tester
- scope-manager
- typescript-estree
- utils
@@ -118,6 +119,7 @@ body:
| -------------------------------------- | ------- |
| `@typescript-eslint/eslint-plugin` | `X.Y.Z` |
| `@typescript-eslint/parser` | `X.Y.Z` |
+ | `@typescript-eslint/rule-tester` | `X.Y.Z` |
| `@typescript-eslint/scope-manager` | `X.Y.Z` |
| `@typescript-eslint/typescript-estree` | `X.Y.Z` |
| `@typescript-eslint/type-utils` | `X.Y.Z` |
diff --git a/.github/actions/prepare-build/action.yml b/.github/actions/prepare-build/action.yml
index d656587ca56..227b60733b3 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/actions/wait-for-netlify/action.yml b/.github/actions/wait-for-netlify/action.yml
new file mode 100644
index 00000000000..f5095651e30
--- /dev/null
+++ b/.github/actions/wait-for-netlify/action.yml
@@ -0,0 +1,15 @@
+name: Wait for the Netlify deployment for the current commit to be ready
+description: Wait for the Netlify deployment for the current commit to be ready
+
+inputs:
+ netlify_token:
+ description: The value of secrets.NETLIFY_TOKEN
+ required: true
+ max_timeout:
+ description: The maximum length of time to keep retrying the Netlify api
+ retry_interval:
+ description: How long to wait between retries of the Netlify api
+
+runs:
+ using: node16
+ main: index.js
diff --git a/.github/actions/wait-for-netlify/index.js b/.github/actions/wait-for-netlify/index.js
new file mode 100644
index 00000000000..f96f6bac7d0
--- /dev/null
+++ b/.github/actions/wait-for-netlify/index.js
@@ -0,0 +1,108 @@
+const core = require('@actions/core');
+const github = require('@actions/github');
+
+const NETLIFY_SITE_ID = '128d21c7-b2fe-45ad-b141-9878fcf5de3a'; // https://app.netlify.com/sites/typescript-eslint/overview
+const NETLIFY_TOKEN = core.getInput('netlify_token', { required: true });
+const MAX_TIMEOUT = core.getInput('max_timeout') || 300000; // 5 minutes
+const RETRY_INTERVAL = core.getInput('retry_interval') || 5000; // 5 seconds
+
+const COMMIT_SHA =
+ github.context.eventName === 'pull_request'
+ ? github.context.payload.pull_request.head.sha
+ : github.context.sha;
+const BRANCH =
+ github.context.eventName === 'pull_request'
+ ? github.context.payload.pull_request.head.ref
+ : github.context.ref_name;
+
+if (!COMMIT_SHA || !BRANCH) {
+ core.setFailed(
+ `Could not determine the full commit SHA and branch from the GitHub context: ${JSON.stringify(
+ github.context,
+ null,
+ 2,
+ )}`,
+ );
+}
+
+async function run() {
+ const { NetlifyAPI } = await import('netlify'); // ESM only, cannot be used with `require`
+ const client = new NetlifyAPI(NETLIFY_TOKEN);
+
+ async function getReadyDeploymentForCommitRef() {
+ console.log(
+ `Checking if deployment for commit "${COMMIT_SHA}" on branch "${BRANCH}" has state "ready"...`,
+ );
+ const deployments = await client.listSiteDeploys({
+ site_id: NETLIFY_SITE_ID,
+ branch: BRANCH,
+ });
+ console.log(
+ `Found ${deployments.length} deployments for this branch "${BRANCH}"`,
+ );
+ const deploymentForCommit = deployments.find(
+ deployment => deployment.commit_ref === COMMIT_SHA,
+ );
+ if (!deploymentForCommit) {
+ console.log(
+ `No deployment found yet for commit "${COMMIT_SHA}" on branch "${BRANCH}"`,
+ );
+ return null;
+ }
+ if (deploymentForCommit.state !== 'ready') {
+ console.log(
+ `Resolve deployment for commit "${COMMIT_SHA}" on branch "${BRANCH}", but it is not ready yet. State: ${deploymentForCommit.state}`,
+ );
+ return null;
+ }
+ return deploymentForCommit;
+ }
+
+ async function waitUntilReadyDeployment() {
+ const maxTimeout = new Promise((_, reject) => {
+ const id = setTimeout(() => {
+ clearTimeout(id);
+ reject(
+ new Error(
+ `Error: Timed out in ${MAX_TIMEOUT}ms, based on the configured MAX_TIMEOUT.`,
+ ),
+ );
+ }, MAX_TIMEOUT);
+ });
+
+ const isReady = new Promise(async (resolve, reject) => {
+ const checkReady = async () => {
+ try {
+ const readyDeployment = await getReadyDeploymentForCommitRef();
+ if (readyDeployment) {
+ return resolve({ readyDeployment });
+ }
+ console.log(
+ `Deployment is not ready yet. Retrying in ${RETRY_INTERVAL}ms based on the configured RETRY_INTERVAL...`,
+ );
+ setTimeout(checkReady, RETRY_INTERVAL);
+ } catch (err) {
+ return reject(err);
+ }
+ };
+ checkReady();
+ });
+
+ return Promise.race([isReady, maxTimeout]);
+ }
+
+ waitUntilReadyDeployment()
+ .then(({ readyDeployment }) => {
+ console.log(
+ `Resolved "ready" deployment with ID: ${readyDeployment.id}, URL: ${readyDeployment.deploy_ssl_url}`,
+ );
+ core.setOutput('deploy_id', readyDeployment.id);
+ core.setOutput('url', readyDeployment.deploy_ssl_url);
+ process.exit(0);
+ })
+ .catch(error => {
+ core.setFailed(error.message);
+ });
+}
+
+run();
diff --git a/.github/renovate.json5 b/.github/renovate.json5
index c14c3ed55e5..73ef8938f86 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:
@@ -12,20 +12,14 @@
'ts-node',
// the nx packages get updated using the nx migrate CLI
'@nrwl/cli',
+ '@nx/cli',
'@nrwl/devkit',
- '@nrwl/jest',
+ '@nx/devkit',
+ '@nx/jest',
+ '@nx/jest',
'@nrwl/nx-cloud',
+ 'nx-cloud',
'@nrwl/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
@@ -85,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 67ac9a27d68..47da35c1741 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -4,14 +4,13 @@ on:
push:
branches:
- main
- - v6
pull_request:
branches:
- '**'
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 +94,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 +135,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 +143,8 @@ jobs:
'eslint-plugin-internal',
'eslint-plugin-tslint',
'parser',
+ 'repo-tools',
+ 'rule-schema-to-typescript-types',
'scope-manager',
'type-utils',
'typescript-estree',
@@ -176,52 +192,81 @@ jobs:
# Sadly 1 day is the minimum
retention-days: 1
- ## TODO - re-enable once we fix them
- # https://github.com/typescript-eslint/typescript-eslint/issues/6508
- # website_tests:
- # permissions:
- # contents: read # to fetch code (actions/checkout)
-
- # name: Website tests
- # # We technically do not need to wait for build within the pipeline any more because the build we care about is happening within Netlify, however,
- # # it is highly likely that if the CI one fails, the Netlify one will as well, so in order to not waste unncessary Github Actions minutes/resources,
- # # we do still keep this requirement here.
- # needs: [build]
- # runs-on: ubuntu-latest
- # steps:
- # - name: Checkout
- # uses: actions/checkout@v3
- # with:
- # fetch-depth: 2
+ unit_tests_tsserver:
+ name: Run Unit Tests with Experimental TSServer
+ needs: [build]
+ runs-on: ubuntu-latest
+ strategy:
+ matrix:
+ package:
+ [
+ 'eslint-plugin',
+ 'eslint-plugin-internal',
+ 'eslint-plugin-tslint',
+ 'typescript-estree',
+ ]
+ env:
+ COLLECT_COVERAGE: false
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 2
+ - name: Install
+ uses: ./.github/actions/prepare-install
+ with:
+ node-version: 18
+ - name: Build
+ uses: ./.github/actions/prepare-build
+ - name: Run unit tests for ${{ matrix.package }}
+ run: npx nx test ${{ matrix.package }} --coverage=false
+ env:
+ CI: true
+ TYPESCRIPT_ESLINT_EXPERIMENTAL_TSSERVER: true
+
+ website_tests:
+ # The NETLIFY_TOKEN secret will not be available on forks
+ if: github.repository_owner == 'typescript-eslint'
+ permissions:
+ contents: read # to fetch code (actions/checkout)
+
+ name: Website tests
+ # We technically do not need to wait for build within the pipeline any more because the build we care about is happening within Netlify, however,
+ # it is highly likely that if the CI one fails, the Netlify one will as well, so in order to not waste unncessary Github Actions minutes/resources,
+ # we do still keep this requirement here.
+ needs: [build]
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+ with:
+ fetch-depth: 2
- # - name: Install
- # uses: ./.github/actions/prepare-install
- # with:
- # node-version: ${{ env.PRIMARY_NODE_VERSION }}
+ - name: Install
+ uses: ./.github/actions/prepare-install
+ with:
+ node-version: ${{ env.PRIMARY_NODE_VERSION }}
- # - name: Install Playwright Browsers
- # run: npx playwright install --with-deps
+ - name: Install Playwright Browsers
+ run: npx playwright install --with-deps
- # - name: Wait for Netlify deployment
- # uses: probablyup/wait-for-netlify-action@v3.4.0
- # id: waitForDeployment
- # with:
- # site_id: '128d21c7-b2fe-45ad-b141-9878fcf5de3a'
- # max_timeout: 300 # 5 minutes
- # env:
- # NETLIFY_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
+ - name: Wait for Netlify deployment
+ uses: ./.github/actions/wait-for-netlify
+ id: waitForDeployment
+ with:
+ netlify_token: ${{ secrets.NETLIFY_TOKEN }}
- # - name: Run Playwright tests against the Netlify deployment
- # run: yarn playwright test --reporter=list
- # working-directory: packages/website
- # env:
- # PLAYWRIGHT_TEST_BASE_URL: ${{ steps.waitForDeployment.outputs.url }}
+ - name: Run Playwright tests against the Netlify deployment
+ run: yarn playwright test --reporter=list
+ working-directory: packages/website
+ env:
+ PLAYWRIGHT_TEST_BASE_URL: ${{ steps.waitForDeployment.outputs.url }}
- # - if: always()
- # uses: actions/upload-artifact@v3
- # with:
- # name: playwright-report
- # path: packages/website/playwright-report
+ - if: always()
+ uses: actions/upload-artifact@v3
+ with:
+ name: playwright-report
+ path: packages/website/playwright-report
upload_coverage:
name: Upload Codecov Coverage
@@ -247,6 +292,8 @@ jobs:
publish_canary_version:
name: Publish the latest code as a canary version
runs-on: ubuntu-latest
+ permissions:
+ id-token: write
needs: [integration_tests, lint_with_build, lint_without_build, unit_tests]
if: github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main'
steps:
@@ -268,28 +315,3 @@ jobs:
run: npx lerna publish --loglevel=verbose --canary --exact --force-publish --yes
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
-
- publish_canary_version_v6:
- name: Publish the next major version code as a canary version
- runs-on: ubuntu-latest
- needs: [integration_tests, lint_with_build, lint_without_build, unit_tests]
- if: github.ref == 'refs/heads/v6'
- steps:
- - name: Checkout
- uses: actions/checkout@v3
- - name: Install
- uses: ./.github/actions/prepare-install
- with:
- node-version: ${{ env.PRIMARY_NODE_VERSION }}
- registry-url: 'https://registry.npmjs.org'
- - name: Build
- uses: ./.github/actions/prepare-build
-
- # Fetch all history for all tags and branches in this job because lerna needs it
- - run: |
- git fetch --prune --unshallow
-
- - name: Publish all packages to npm
- run: npx lerna publish premajor --loglevel=verbose --canary --exact --force-publish --yes --dist-tag rc-v6
- env:
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.github/workflows/nx-migrate.yml b/.github/workflows/nx-migrate.yml
index af107f6c391..b379d65e2c7 100644
--- a/.github/workflows/nx-migrate.yml
+++ b/.github/workflows/nx-migrate.yml
@@ -1,8 +1,8 @@
# This workflow is used to augment the capabilities of the renovate GitHub app by running a full
-# `nx migrate` when renovate opens a PR to change the version of @nrwl/workspace.
+# `nx migrate` when renovate opens a PR to change the version of @nx/workspace.
#
# You will therefore also notice that in the renovate configuration, we ignore any packages which
-# Nx will manage for us as part of `nx migrate` such as the remaining @nrwl/* packages and jest.
+# Nx will manage for us as part of `nx migrate` such as the remaining @nx/* packages and jest.
name: Nx Migrate
@@ -33,12 +33,12 @@ jobs:
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
- - name: Check if @nrwl/workspace was changed as part of the latest commit on the PR
+ - name: Check if @nx/workspace was changed as part of the latest commit on the PR
id: nrwl-workspace-package-check
run: |
- git diff HEAD~1 -G"@nrwl/workspace" --exit-code package.json && echo "@nrwl/workspace unchanged" || echo "::set-output name=was-changed::true"
+ git diff HEAD~1 -G"@nx/workspace" --exit-code package.json && echo "@nx/workspace unchanged" || echo "::set-output name=was-changed::true"
- - name: Run nx migrate if @nrwl/workspace changed and commit the results
+ - name: Run nx migrate if @nx/workspace changed and commit the results
if: ${{ steps.nrwl-workspace-package-check.outputs.was-changed == 'true' }}
env:
# We cannot use secrets.GITHUB_TOKEN for this because it is not permitted to kick off subsequent actions worfklow runs, so we use a PAT instead
@@ -50,14 +50,14 @@ jobs:
gh pr checkout ${{ github.event.pull_request.number }}
# Get the version of Nx we are migrating to
- NX_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@nrwl/workspace'])")
+ NX_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@nx/workspace'])")
# Revert renovate's changes to package.json and yarn.lock so that it is a clean migrate from the status quo
git checkout HEAD~1 -- package.json yarn.lock
yarn --ignore-scripts
- npx nx migrate @nrwl/workspace@$NX_VERSION
+ npx nx migrate @nx/workspace@$NX_VERSION
# Sometimes Nx can require config formatting changes after a migrate command
yarn --ignore-scripts
@@ -81,5 +81,5 @@ jobs:
git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git
git add --all
- git commit -m "chore: run nx migrate for @nrwl/workspace v$NX_VERSION"
+ git commit -m "chore: run nx migrate for @nx/workspace v$NX_VERSION"
git push
diff --git a/.github/workflows/prettier-update.yml b/.github/workflows/prettier-update.yml
new file mode 100644
index 00000000000..c90c72151ae
--- /dev/null
+++ b/.github/workflows/prettier-update.yml
@@ -0,0 +1,51 @@
+# This workflow is used to augment the capabilities of the renovate GitHub app by running a full
+# `prettier --write` when renovate opens a PR to change the version of prettier.
+
+name: Prettier Update
+
+on:
+ pull_request:
+ branches: [main]
+ paths:
+ - 'package.json'
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
+ cancel-in-progress: true
+
+jobs:
+ maybe_prettier_update:
+ # Only run if it was the renovate bot that triggered the workflow (otherwise we'll create a loop)
+ if: contains('["renovate[bot]"]', github.actor) == true
+ name: Run prettier formatting if required
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v3
+
+ - name: Check if prettier was changed as part of the latest commit on the PR
+ id: prettier-package-check
+ run: |
+ git diff HEAD~1 -G"prettier" --exit-code package.json && echo "prettier unchanged" || echo "::set-output name=was-changed::true"
+
+ - name: Run prettier formatting if prettier was changed and commit the results
+ if: ${{ steps.prettier-package-check.outputs.was-changed == 'true' }}
+ env:
+ # We cannot use secrets.GITHUB_TOKEN for this because it is not permitted to kick off subsequent actions worfklow runs, so we use a PAT instead
+ GITHUB_TOKEN: ${{ secrets.JAMES_HENRY_GITHUB_TOKEN }}
+ run: |
+ yarn --ignore-scripts
+ yarn format
+
+ # Commit all the changes to the PR (see note on not being able to use secrets.GITHUB_TOKEN for this)
+ git config --global user.email "james@henry.sc"
+ git config --global user.name "JamesHenry"
+ git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git
+
+ # If the status is empty, there are no uncommitted changes
+ if [[ -z $(git status --porcelain) ]]; then
+ echo "No uncommitted changes"
+ else
+ git add --all
+ git commit -m "chore: update formatting after prettier upgrade"
+ git push
+ fi
diff --git a/.github/workflows/semantic-pr-titles.yml b/.github/workflows/semantic-pr-titles.yml
index 98a7013beb7..fdbc928068c 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 7fad8b15206..fb6fcf441bd 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/.npmrc b/.npmrc
index 9cf9495031e..4cfe3ce0674 100644
--- a/.npmrc
+++ b/.npmrc
@@ -1 +1,2 @@
-package-lock=false
\ No newline at end of file
+package-lock=false
+provenance=true
\ No newline at end of file
diff --git a/.prettierignore b/.prettierignore
index 548792bb901..ac66ab689e2 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -1,25 +1,28 @@
-**/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
+# prettier doesn't yet support JSX namespaced attributes
+packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx
+packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx
+
# Ignore CHANGELOG.md files to avoid issues with automated release job
CHANGELOG.md
packages/website/.docusaurus
packages/website/build
-packages/website/src/vendor
+packages/website/playwright-report
+
+# 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 aee0ff73ab0..82c02f90b2e 100644
--- a/.vscode/launch.json
+++ b/.vscode/launch.json
@@ -71,6 +71,109 @@
"${workspaceFolder}/packages/scope-manager/dist/index.js",
"${workspaceFolder}/packages/scope-manager/dist/index.js",
],
+ },{
+ "type": "node",
+ "request": "launch",
+ "name": "Jest Test Current eslint-plugin-tslint Rule",
+ "cwd": "${workspaceFolder}/packages/eslint-plugin-tslint/",
+ "program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
+ "args": [
+ "--runInBand",
+ "--no-cache",
+ "--no-coverage",
+ "${fileBasenameNoExtension}"
+ ],
+ "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/index.ts",
+ "${workspaceFolder}/packages/type-utils/dist/index.js",
+ "${workspaceFolder}/packages/parser/src/index.ts",
+ "${workspaceFolder}/packages/parser/dist/index.js",
+ "${workspaceFolder}/packages/typescript-estree/src/index.ts",
+ "${workspaceFolder}/packages/typescript-estree/dist/index.js",
+ "${workspaceFolder}/packages/types/src/index.ts",
+ "${workspaceFolder}/packages/types/dist/index.js",
+ "${workspaceFolder}/packages/visitor-keys/src/index.ts",
+ "${workspaceFolder}/packages/visitor-keys/dist/index.js",
+ "${workspaceFolder}/packages/scope-manager/dist/index.js",
+ "${workspaceFolder}/packages/scope-manager/dist/index.js",
+ ],
+ },
+ {
+ "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",
+ "name": "Jest Test Current eslint-plugin-tslint Rule",
+ "cwd": "${workspaceFolder}/packages/eslint-plugin-tslint/",
+ "program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
+ "args": [
+ "--runInBand",
+ "--no-cache",
+ "--no-coverage",
+ "${fileBasenameNoExtension}"
+ ],
+ "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/index.ts",
+ "${workspaceFolder}/packages/type-utils/dist/index.js",
+ "${workspaceFolder}/packages/parser/src/index.ts",
+ "${workspaceFolder}/packages/parser/dist/index.js",
+ "${workspaceFolder}/packages/typescript-estree/src/index.ts",
+ "${workspaceFolder}/packages/typescript-estree/dist/index.js",
+ "${workspaceFolder}/packages/types/src/index.ts",
+ "${workspaceFolder}/packages/types/dist/index.js",
+ "${workspaceFolder}/packages/visitor-keys/src/index.ts",
+ "${workspaceFolder}/packages/visitor-keys/dist/index.js",
+ "${workspaceFolder}/packages/scope-manager/dist/index.js",
+ "${workspaceFolder}/packages/scope-manager/dist/index.js",
+ ],
},
{
"type": "node",
@@ -258,10 +361,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 0cd3da95b52..2b770bca2c9 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,317 @@
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)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [comma-spacing] allow no space after trailing comma in objects and arrays ([#6938](https://github.com/typescript-eslint/typescript-eslint/issues/6938)) ([24bdacc](https://github.com/typescript-eslint/typescript-eslint/commit/24bdacc7e5df40c92031a1bd7e9815d66a35b31d))
+* **eslint-plugin:** [prefer-includes] escape special characters ([#7161](https://github.com/typescript-eslint/typescript-eslint/issues/7161)) ([5a347a5](https://github.com/typescript-eslint/typescript-eslint/commit/5a347a5978bc5737412bd12d61eb6058163cf4a0)), closes [#7145](https://github.com/typescript-eslint/typescript-eslint/issues/7145)
+* **eslint-plugin:** replace auto-fix of class literal property style rule with suggestion ([#7054](https://github.com/typescript-eslint/typescript-eslint/issues/7054)) ([a8c824a](https://github.com/typescript-eslint/typescript-eslint/commit/a8c824a1e84453f93cd2b464fc102bc878c1aff3))
+
+
+### Features
+
+* **eslint-plugin:** [prefer-nullish-coalescing] add `ignorePrimitives` option ([#6487](https://github.com/typescript-eslint/typescript-eslint/issues/6487)) ([6edaa04](https://github.com/typescript-eslint/typescript-eslint/commit/6edaa04565576f0af7e60bc08602bd781c847804))
+
+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.61.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.1...v5.61.0) (2023-07-03)
+
+
+### Features
+
+* **eslint-plugin:** [ban-types] ban types in extends and implements ([#7129](https://github.com/typescript-eslint/typescript-eslint/issues/7129)) ([997783f](https://github.com/typescript-eslint/typescript-eslint/commit/997783ff108ca18af709667ef3fdfa7134a8eefe))
+* support TypeScript 5.1 ([#7088](https://github.com/typescript-eslint/typescript-eslint/issues/7088)) ([4bf2d73](https://github.com/typescript-eslint/typescript-eslint/commit/4bf2d7360eaf74c9ef87b196ff4c459b8f50800b))
+* use graphemer instead of grapheme-splitter ([#7069](https://github.com/typescript-eslint/typescript-eslint/issues/7069)) ([faea3ff](https://github.com/typescript-eslint/typescript-eslint/commit/faea3ff8b4d750974c41262b44db314f20d0c99c))
+
+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.60.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.0...v5.60.1) (2023-06-26)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+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.60.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.11...v5.60.0) (2023-06-19)
+
+
+### Features
+
+* **eslint-plugin:** [restrict-plus-operands] add allow* options ([#6161](https://github.com/typescript-eslint/typescript-eslint/issues/6161)) ([def09f8](https://github.com/typescript-eslint/typescript-eslint/commit/def09f88cdb4a85cebb8619b45931f7e2c88dfc0))
+
+
+
+
+
+## [5.59.11](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.10...v5.59.11) (2023-06-12)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+
+
+
+
+## [5.59.10](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.9...v5.59.10) (2023-06-12)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+
+
+
+
+## [5.59.9](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.8...v5.59.9) (2023-06-05)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+
+
+
+
+## [5.59.8](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.7...v5.59.8) (2023-05-29)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+
+
+
+
+## [5.59.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.6...v5.59.7) (2023-05-22)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+
+
+
+
+## [5.59.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.5...v5.59.6) (2023-05-15)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+
+
+
+
+## [5.59.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.4...v5.59.5) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+
+
+
+
+## [5.59.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.3...v5.59.4) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+
+
+
+
+## [5.59.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.2...v5.59.3) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+
+
+
+
+## [5.59.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.1...v5.59.2) (2023-05-01)
+
+**Note:** Version bump only for package @typescript-eslint/typescript-eslint
+
+
+
+
+
+## [5.59.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.0...v5.59.1) (2023-04-24)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [prefer-regexp-exec] skip malformed regexes ([#6935](https://github.com/typescript-eslint/typescript-eslint/issues/6935)) ([05ed60e](https://github.com/typescript-eslint/typescript-eslint/commit/05ed60e25f1de9d1bb83d56c81a349130960bec8))
+* **eslint-plugin:** [unified-signatures] no parameters function ([#6940](https://github.com/typescript-eslint/typescript-eslint/issues/6940)) ([2970861](https://github.com/typescript-eslint/typescript-eslint/commit/297086154acc568a0ae8eb41c8977b7a7ba4e0ed))
+
+
+
+
+
+# [5.59.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.58.0...v5.59.0) (2023-04-17)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [no-unnecessary-condition] allow nullish coalescing for naked type parameter ([#6910](https://github.com/typescript-eslint/typescript-eslint/issues/6910)) ([3e5f858](https://github.com/typescript-eslint/typescript-eslint/commit/3e5f8583f1e4fe045c2fe2143d6f280b7381f96b))
+
+
+### Features
+
+* **eslint-plugin:** [ban-types] add NonNullable suggestion and allow custom suggestions ([#6876](https://github.com/typescript-eslint/typescript-eslint/issues/6876)) ([ff65235](https://github.com/typescript-eslint/typescript-eslint/commit/ff65235246bb6214fb64f0e0317373ca99f8bcbe))
+
+
+
+
+
+# [5.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [unified-signatures] allow overloads with different named and different number of parameters ([#6877](https://github.com/typescript-eslint/typescript-eslint/issues/6877)) ([939d665](https://github.com/typescript-eslint/typescript-eslint/commit/939d6656ebcb94fab048a08d719b3e77362ab5b4))
+* update getLib for new TypeScript targets ES2021, ES2022 ([#6782](https://github.com/typescript-eslint/typescript-eslint/issues/6782)) ([1c04664](https://github.com/typescript-eslint/typescript-eslint/commit/1c0466414300f338c6c4111f8d1eac0c3e6a8983))
+
+
+### Features
+
+* **eslint-plugin:** [no-unsafe-enum-comparison] add rule ([#6107](https://github.com/typescript-eslint/typescript-eslint/issues/6107)) ([915f9c2](https://github.com/typescript-eslint/typescript-eslint/commit/915f9c2dc8934eef491a672786ec9f016f3658ba))
+
+
+
+
+
+## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [strict-boolean-expressions] support mixed enums in allowNullableEnum option ([#6740](https://github.com/typescript-eslint/typescript-eslint/issues/6740)) ([49be8a8](https://github.com/typescript-eslint/typescript-eslint/commit/49be8a814c82f3784308ef5a6e90478eb56e55c1))
+
+
+
+
+
+# [5.57.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.56.0...v5.57.0) (2023-03-27)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [no-unnecessary-boolean-literal-compare] simplify fixer and add support for double negation ([#6620](https://github.com/typescript-eslint/typescript-eslint/issues/6620)) ([81c8519](https://github.com/typescript-eslint/typescript-eslint/commit/81c85193d27d2e7f6d12bc259088b9b73dbe1e8b))
+* **eslint-plugin:** correct crashes with getTypeArguments for ts < 3.7 ([#6767](https://github.com/typescript-eslint/typescript-eslint/issues/6767)) ([59eab58](https://github.com/typescript-eslint/typescript-eslint/commit/59eab587890a915387444d00c4a9387aed602718))
+
+
+### Features
+
+* **eslint-plugin:** [consistent-type-assertions] add suggestions for objectLiteralTypeAssertions ([#6642](https://github.com/typescript-eslint/typescript-eslint/issues/6642)) ([720e811](https://github.com/typescript-eslint/typescript-eslint/commit/720e81138b66c94c60c4a4471b86b7d8567b6df0))
+* **eslint-plugin:** [consistent-type-assertions] autofix angle bracket assertions to as ([#6641](https://github.com/typescript-eslint/typescript-eslint/issues/6641)) ([ad8ea64](https://github.com/typescript-eslint/typescript-eslint/commit/ad8ea64dbdf06c92ff72b48022f041693a8d7076))
+* **eslint-plugin:** add `no-duplicate-type-constituents` rule ([#5728](https://github.com/typescript-eslint/typescript-eslint/issues/5728)) ([bc31078](https://github.com/typescript-eslint/typescript-eslint/commit/bc31078cf86d69eee881e4a7daeffa347c1d82a7))
+
+
+
+
+
# [5.56.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.55.0...v5.56.0) (2023-03-20)
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 0b78c2f34f4..031a9105d30 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -1,3 +1,12 @@
+
+
# Contributors
Thanks goes to these wonderful people:
@@ -9,7 +18,7 @@ Thanks goes to these wonderful people:
James Henry |
Brad Zacher |
Armano |
- Josh Goldberg |
+ Josh Goldberg ✨ |
Oleksandr T. |
@@ -17,10 +26,10 @@ Thanks goes to these wonderful people:
Reyad Attiyat |
SUZUKI Sosuke |
Gareth Jones |
- Patricio Trevino |
+ Joshua Chen |
- Joshua Chen |
+ Patricio Trevino |
YeonJuan |
Nicholas C. Zakas |
Jed Fox |
@@ -34,18 +43,36 @@ Thanks goes to these wonderful people:
Retsam |
+ Kai Cataldo |
Rasmus Eneman |
+ Rebecca Stevens |
+ Toru Nagashima |
+ Yosuke Ota |
+
+
JounQin |
- Zzzen |
- Daniil Dubrava |
- ldrick |
+ Lucas Azzola |
+ Omri Luzon |
+ Simen Bekkhus |
+ Danny Fritz |
+
+
+ Ika |
+ Mackie Underdown |
+ Sviatoslav Zaytsev |
+ Bryan Mishkin |
+ Kanitkorn Sujautra |
+ SHIMA RYUHEI |
+ Zzzen |
+ Anix |
+ Pete Gonzalez |
Gavin Barron |
- Pavel Birukov |
- Daniel Cassidy |
- Daniel Nixon |
- James Garbutt |
+
+
+ Sylvia Favello |
+
diff --git a/README.md b/README.md
index fd3e232b0b7..c9474769f51 100644
--- a/README.md
+++ b/README.md
@@ -18,12 +18,7 @@
- See main--typescript-eslint.netlify.app for documentation on the latest canary release.
-
-
-
-
- See v6--typescript-eslint.netlify.app for documentation on upcoming v6 release.
+ See main--typescript-eslint.netlify.app for documentation on the latest canary release.
diff --git a/docs/Architecture.mdx b/docs/Architecture.mdx
deleted file mode 100644
index ee224c1e90a..00000000000
--- a/docs/Architecture.mdx
+++ /dev/null
@@ -1,17 +0,0 @@
----
-id: architecture
-title: Architecture
----
-
-The `@typescript-eslint/*` packages are built from a monorepo located at https://github.com/typescript-eslint/typescript-eslint.
-The monorepo is built with [Lerna](https://lerna.js.org) and [Nx](https://nx.dev).
-
-Each page in this section corresponds to a package we intentionally expose to users.
-They are:
-
-- [`@typescript-eslint/eslint-plugin`](./architecture/ESLint_Plugin.mdx): An ESLint plugin which provides lint rules for TypeScript codebases.
-- [`@typescript-eslint/eslint-plugin-tslint`](./architecture/ESLint_Plugin_TSLint.mdx): ESLint plugin that allows running TSLint rules within ESLint to help you migrate from TSLint to ESLint.
-- [`@typescript-eslint/parser`](./architecture/Parser.mdx): An ESLint parser which allows for ESLint to lint TypeScript source code.
-- [`@typescript-eslint/scope-manager`](./architecture/Scope_Manager.mdx): A fork of [`eslint-scope`](https://github.com/eslint/eslint-scope), enhanced to support TypeScript functionality.
-- [`@typescript-eslint/typescript-estree`](./architecture/TypeScript-ESTree.mdx): The underlying code used by [`@typescript-eslint/parser`](./architecture/Parser.mdx) that converts TypeScript source code into an ESTree-compatible form.
-- [`@typescript-eslint/utils`](./architecture/Utils.mdx): Utilities for working with TypeScript + ESLint together.
diff --git a/docs/Developers.mdx b/docs/Developers.mdx
new file mode 100644
index 00000000000..e1658aa105b
--- /dev/null
+++ b/docs/Developers.mdx
@@ -0,0 +1,10 @@
+---
+id: developers
+title: Developers
+---
+
+These are the developer guides to working with the typescript-eslint tooling.
+It's intended for use by third-parties who want to use our tools to build great things.
+
+> If you're reading this as a new developer: welcome to the community!
+> We're happy to have you! ❤️🔥
diff --git a/docs/Getting_Started.mdx b/docs/Getting_Started.mdx
index cdaf39899a9..40463088e58 100644
--- a/docs/Getting_Started.mdx
+++ b/docs/Getting_Started.mdx
@@ -20,6 +20,7 @@ npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugi
Next, create a `.eslintrc.cjs` config file in the root of your project, and populate it with the following:
```js title=".eslintrc.cjs"
+/* eslint-env node */
module.exports = {
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
parser: '@typescript-eslint/parser',
@@ -57,22 +58,23 @@ ESLint will lint all TypeScript compatible files within the current folder, and
## Details
-- You can read more about configuring ESLint [in their documentation on configuration](https://eslint.org/docs/user-guide/configuring).
-- You can read more about the rules provided by ESLint [in their documentation on their rules](https://eslint.org/docs/rules/).
-- You can read more about the rules provided by typescript-eslint in [our rules documentation](/rules).
-
-### Configuration Values
-
-- `parser: '@typescript-eslint/parser'` tells ESLint to use the [`@typescript-eslint/parser`](./architecture/Parser.mdx) package you installed to parse your source files.
+- `parser: '@typescript-eslint/parser'` tells ESLint to use the [`@typescript-eslint/parser`](./packages/Parser.mdx) package you installed to parse your source files.
- This is required, or else ESLint will throw errors as it tries to parse TypeScript code as if it were regular JavaScript.
-- `plugins: ['@typescript-eslint']` tells ESLint to load the [`@typescript-eslint/eslint-plugin`](./architecture/ESLint_Plugin.mdx) package as a plugin.
+- `plugins: ['@typescript-eslint']` tells ESLint to load the [`@typescript-eslint/eslint-plugin`](./packages/ESLint_Plugin.mdx) package as a plugin.
- This allows you to use typescript-eslint's rules within your codebase.
- `extends: [ ... ]` tells ESLint that your config extends the given configurations.
- `eslint:recommended` is ESLint's inbuilt "recommended" config - it turns on a small, sensible set of rules which lint for well-known best-practices.
- `plugin:@typescript-eslint/recommended` is our "recommended" config - it's similar to `eslint:recommended`, except it turns on TypeScript-specific rules from our plugin.
+- `root: true` is a generally good ESLint practice to indicate this file is the root-level one used by the project and ESLint should not search beyond this directory for config files.
## Next Steps
We provide a plethora of powerful rules that utilize the power of TypeScript's type information. [Visit the next page for a setup guide](./linting/Typed_Linting.mdx 'Visit the next page for a typed rules setup guide').
If you're having problems getting this working, please have a look at our [Troubleshooting & FAQs](./linting/Troubleshooting.mdx).
+
+### Documentation Resources
+
+- You can read more about configuring ESLint [in their documentation on configuration](https://eslint.org/docs/user-guide/configuring).
+- You can read more about the rules provided by ESLint [in their documentation on their rules](https://eslint.org/docs/rules/).
+- You can read more about the rules provided by typescript-eslint in [our rules documentation](/rules).
diff --git a/docs/Maintenance.mdx b/docs/Maintenance.mdx
index 75f1030c015..bc0db0d1e19 100644
--- a/docs/Maintenance.mdx
+++ b/docs/Maintenance.mdx
@@ -8,5 +8,7 @@ This is the maintainers guide to working on typescript-eslint.
It's intended for use by contributors who have been given access to at least triage issues and pull requests.
We keep it in the open for visibility into our processes.
-> If you're reading this as a new maintainer: welcome!
-> We're happy to have you! ❤️🔥
+:::info Welcome!
+If you're reading this as a new maintainer: welcome!
+We're happy to have you! ❤️🔥
+:::
diff --git a/docs/Packages.mdx b/docs/Packages.mdx
new file mode 100644
index 00000000000..e0eee8cf178
--- /dev/null
+++ b/docs/Packages.mdx
@@ -0,0 +1,18 @@
+---
+id: packages
+title: Packages
+---
+
+The `@typescript-eslint/*` packages are all stored in [our GitHub monorepo](https://github.com/typescript-eslint/typescript-eslint).
+The monorepo is built with [Lerna](https://lerna.js.org) and [Nx](https://nx.dev).
+
+Each page in this section corresponds to a package we intentionally expose to users.
+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/Users.mdx b/docs/Users.mdx
new file mode 100644
index 00000000000..120d225240c
--- /dev/null
+++ b/docs/Users.mdx
@@ -0,0 +1,12 @@
+---
+id: users
+title: Users
+---
+
+These are the user guides to consuming the typescript-eslint tooling.
+It's intended for users who want to consume our tools.
+
+:::info Welcome!
+If you're reading this as a new user: welcome to the community!
+We're happy to have you! ❤️🔥
+:::
diff --git a/docs/contributing/Discussions.md b/docs/contributing/Discussions.mdx
similarity index 92%
rename from docs/contributing/Discussions.md
rename to docs/contributing/Discussions.mdx
index ac7fe9d875a..80c723157dd 100644
--- a/docs/contributing/Discussions.md
+++ b/docs/contributing/Discussions.mdx
@@ -23,5 +23,5 @@ We can always move an issue to a discussion if it becomes unexpectedly deep.
:::caution
Please don't use Discussions as a support forum.
-See [Issues > Questions and Support Requests](./Issues.mdx#questions-and-support-requests).
+See [Contributing > Issues > Questions and Support Requests](./Issues.mdx#questions-and-support-requests).
:::
diff --git a/docs/contributing/Issues.mdx b/docs/contributing/Issues.mdx
index bd4620a9d72..90531020ebf 100644
--- a/docs/contributing/Issues.mdx
+++ b/docs/contributing/Issues.mdx
@@ -31,7 +31,7 @@ Please don't:
The issue tracker is not an appropriate place for questions or support requests.
You can instead:
-- Ask in our [Discord channel](https://discord.gg/FSxKq8Tdyg)'s `#help` server
+- Ask in our [Discord server](https://discord.gg/FSxKq8Tdyg)'s `#help` server
- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript-eslint 'StackOverflow questions tagged with typescript-eslint') using the `typescript-eslint` tag
- Publicly toot [@tseslint on Mastodon](https://fosstodon.org/@tseslint) or tweet [@tseslint on Twitter](https://twitter.com/tseslint)
diff --git a/docs/contributing/Local_Development.mdx b/docs/contributing/Local_Development.mdx
index 3f85bd9c90b..0b23be5c4a9 100644
--- a/docs/contributing/Local_Development.mdx
+++ b/docs/contributing/Local_Development.mdx
@@ -32,7 +32,7 @@ For example, if you make a change within `scope-manager` and want to use it in `
The following checks are all run on pull requests automatically.
You can also perform them locally.
-> See [Contributing > Pull Requests](../Contributing.mdx#raising-a-pr) for more information on pull requests.
+> See [Contributing > Pull Requests](./Pull_Requests.mdx) for more information on pull requests.
### Formatting
diff --git a/docs/contributing/Pull_Requests.mdx b/docs/contributing/Pull_Requests.mdx
index 36059661b4b..c2c99aa06a6 100644
--- a/docs/contributing/Pull_Requests.mdx
+++ b/docs/contributing/Pull_Requests.mdx
@@ -35,7 +35,7 @@ The title of your PR should match the following format:
You can find more samples of good past PR titles in [recent commits to `main`](https://github.com/typescript-eslint/typescript-eslint/commits/main):
- `fix(scope-manager): correct handling for class static blocks`
-- `docs: Fix links to getting started in README.md`
+- `docs: fix links to getting started in README.md`
Within the body of your PR, make sure you reference the issue that you have worked on, as well as pointing out anything of note you wish us to look at during our review.
@@ -81,3 +81,9 @@ You can [resolve conversations](https://docs.github.com/en/pull-requests/collabo
Once you've addressed all our feedback by making code changes and/or started a followup discussion, [re-request review](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/about-pull-request-reviews#re-requesting-a-review) from each maintainer whose feedback you addressed.
Once the feedback is addressed, and the PR is approved, we'll ensure the branch is up to date with `main`, and merge it for you.
+
+### Asking Questions
+
+If you need help and/or have a question, posting a comment in the PR is a great way to do so.
+There's no need to tag anybody individually.
+One of us will drop by and help when we can.
diff --git a/docs/Custom_Rules.mdx b/docs/developers/Custom_Rules.mdx
similarity index 78%
rename from docs/Custom_Rules.mdx
rename to docs/developers/Custom_Rules.mdx
index 56cc7899792..29ed9adde0e 100644
--- a/docs/Custom_Rules.mdx
+++ b/docs/developers/Custom_Rules.mdx
@@ -1,12 +1,12 @@
---
id: custom-rules
-sidebar_label: Custom Rules
+sidebar_label: Building Custom Rules
title: Custom Rules
---
:::important
This page describes how to write your own custom ESLint rules using typescript-eslint.
-You should be familiar with [ESLint's developer guide](https://eslint.org/docs/developer-guide) and [ASTs](https://typescript-eslint.io/blog/asts-and-typescript-eslint) before writing custom rules.
+You should be familiar with [ESLint's developer guide](https://eslint.org/docs/developer-guide) and [ASTs](/blog/asts-and-typescript-eslint) before writing custom rules.
:::
As long as you are using `@typescript-eslint/parser` as the `parser` in your ESLint configuration, custom ESLint rules generally work the same way for JavaScript and TypeScript code.
@@ -18,7 +18,7 @@ The main three changes to custom rules writing are:
## Utils Package
-The [`@typescript-eslint/utils`](./architecture/Utils.mdx) package acts as a replacement package for `eslint` that exports all the same objects and types, but with typescript-eslint support.
+The [`@typescript-eslint/utils`](../packages/Utils.mdx) package acts as a replacement package for `eslint` that exports all the same objects and types, but with typescript-eslint support.
It also exports common utility functions and constants most custom typescript-eslint rules tend to use.
:::caution
@@ -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
deleted file mode 100644
index 10d3f6293d5..00000000000
--- a/docs/linting/CONFIGURATIONS.mdx
+++ /dev/null
@@ -1,141 +0,0 @@
----
-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.
-`@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".
-> Rule additions and removals are treated as breaking changes and will only be done in major version bumps.
-
-## Recommended Configurations
-
-Most projects should extend from at least 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.
-- [`strict`](#strict): Additional strict rules that can also catch bugs but are more opinionated than recommended rules.
-
-:::tip
-We recommend most projects use [`recommended-requiring-type-checking`](#recommended-requiring-type-checking) (which requires [typed linting](./Typed_Linting.mdx)).
-:::
-
-:::note
-These configurations are our recommended starting points, but **you don't need to use them as-is**.
-ESLint allows configuring own rule settings on top of extended configurations.
-See [ESLint's Configuring Rules docs](https://eslint.org/docs/user-guide/configuring/rules#using-configuration-files).
-:::
-
-### `recommended`
-
-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.
-
-```json
-{
- "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.
-
-:::tip
-We strongly recommend all TypeScript projects extend from `plugin:@typescript-eslint/recommended`.
-:::
-
-### `recommended-requiring-type-checking`
-
-Additional recommended rules that require type information.
-Rules in this configuration are similarly useful to those in `recommended`.
-
-```json
-{
- "extends": [
- "plugin:@typescript-eslint/recommended",
- "plugin:@typescript-eslint/recommended-requiring-type-checking"
- ]
-}
-```
-
-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.
-
-:::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.
-:::
-
-### `strict`
-
-Additional strict rules that can also catch bugs but are more opinionated than recommended rules.
-
-```json
-{
- "extends": [
- "plugin:@typescript-eslint/recommended",
- "plugin:@typescript-eslint/recommended-requiring-type-checking",
- "plugin:@typescript-eslint/strict"
- ]
-}
-```
-
-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.
-
-:::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.
-:::
-
-## 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.
-
-### `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.
-
-:::warning
-We do not recommend a 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.
-
-
-
-This config is automatically included if you use any of the recommended configurations.
-
-### `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"
- ]
-}
-```
-
-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.
-
-## Suggesting Configuration Changes
-
-If you feel strongly that a specific rule should (or should not) be one of these configurations, please [file an issue](https://github.com/typescript-eslint/typescript-eslint/issues/new?assignees=&labels=package%3A+eslint-plugin%2Cpreset+config+change%2Ctriage&template=09-config-change.yaml&title=Configs%3A+%3Ca+short+description+of+my+proposal%3E) along with a **detailed** argument explaining your reasoning.
-
-## Formatting
-
-None of the preset configs provided by typescript-eslint enable formatting rules (rules that only serve to enforce code whitespace and other trivia).
-We strongly recommend you use Prettier or an equivalent for formatting your code, not ESLint formatting rules.
-See [What About Formatting? > Suggested Usage](./troubleshooting/formatting#suggested-usage).
diff --git a/docs/linting/Configurations.mdx b/docs/linting/Configurations.mdx
new file mode 100644
index 00000000000..215a5ec0168
--- /dev/null
+++ b/docs/linting/Configurations.mdx
@@ -0,0 +1,232 @@
+---
+id: configs
+title: Configurations
+---
+
+[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 `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
+
+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-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.
+
+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**.
+ESLint allows configuring own rule settings on top of extended configurations.
+See [ESLint's Configuring Rules docs](https://eslint.org/docs/user-guide/configuring/rules#using-configuration-files).
+:::
+
+### `recommended`
+
+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 core ESLint rules known to conflict with typescript-eslint rules or cause issues in TypeScript codebases.
+
+```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.
+
+### `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/main/packages/eslint-plugin/src/configs/recommended-type-checked.ts) for the exact contents of this config.
+
+### `strict`
+
+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.
+
+```js title=".eslintrc.js"
+module.exports = {
+ extends: ['plugin:@typescript-eslint/strict'],
+};
+```
+
+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.
+
+:::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-type-checked`
+
+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`.
+
+```js title=".eslintrc.js"
+module.exports = {
+ extends: ['plugin:@typescript-eslint/strict-type-checked'],
+};
+```
+
+See [`configs/strict-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/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-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/main/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/main/packages/eslint-plugin/src/configs/stylistic-type-checked.ts) for the exact contents of this config.
+
+## Other Configurations
+
+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.
+
+:::warning
+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/main/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/main/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.
+
+```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.
+
+## Suggesting Configuration Changes
+
+If you feel strongly that a specific rule should (or should not) be one of these configurations, please [file an issue](https://github.com/typescript-eslint/typescript-eslint/issues/new?assignees=&labels=package%3A+eslint-plugin%2Cpreset+config+change%2Ctriage&template=09-config-change.yaml&title=Configs%3A+%3Ca+short+description+of+my+proposal%3E) along with a **detailed** argument explaining your reasoning.
+
+## Formatting
+
+None of the preset configs provided by typescript-eslint enable formatting rules (rules that only serve to enforce code whitespace and other trivia).
+We strongly recommend you use Prettier or an equivalent for formatting your code, not ESLint formatting rules.
+See [What About Formatting? > Suggested Usage](./troubleshooting/formatting#suggested-usage).
diff --git a/docs/linting/Troubleshooting.mdx b/docs/linting/Troubleshooting.mdx
index f29eabc12c3..2393a533a1d 100644
--- a/docs/linting/Troubleshooting.mdx
+++ b/docs/linting/Troubleshooting.mdx
@@ -7,7 +7,7 @@ title: Troubleshooting & FAQs
This happens because TypeScript adds new features that ESLint doesn't know about.
-The first step is to [check our list of "extension" rules here](https://typescript-eslint.io/rules/#extension-rules).
+The first step is to [check our list of "extension" rules here](/rules/#extension-rules).
An extension rule is a rule which extends the base ESLint rules to support TypeScript syntax.
If you find it in there, give it a go to see if it works for you.
You can configure it by disabling the base rule, and turning on the extension rule.
@@ -23,28 +23,74 @@ Here's an example with the `semi` rule:
```
If you don't find an existing extension rule, or the extension rule doesn't work for your case, then you can go ahead and check our issues.
-[The contributing guide outlines the best way to raise an issue](https://github.com/typescript-eslint/typescript-eslint/blob/main/CONTRIBUTING.md#raising-issues).
+[The contributing guide outlines the best way to raise an issue](../contributing/Issues.mdx).
> We release a new version our tooling every week.
-> _Please_ ensure that you [check our the latest list of "extension" rules](https://typescript-eslint.io/rules/#extension-rules) **_before_** filing an issue.
+> _Please_ ensure that you [check our the latest list of "extension" rules](/rules/#extension-rules) **_before_** filing an issue.
## I get errors telling me "ESLint was configured to run ... However, that TSConfig does not / none of those TSConfigs include this file"
+These errors are caused by an ESLint config requesting type information be generated for a file that isn't included in the TypeScript configuration.
+
### Fixing the Error
+
+
- If you **do not** want to lint the file:
- Use [one of the options ESLint offers](https://eslint.org/docs/latest/user-guide/configuring/ignoring-code) to ignore files, namely a `.eslintignore` file, or `ignorePatterns` config.
- If you **do** want to lint the file:
- If you **do not** want to lint the file with [type-aware linting](./Typed_Linting.mdx):
- - Use [ESLint's `overrides` configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#configuration-based-on-glob-patterns) to configure the file to not be parsed with type information.
- - A popular setup is to omit the above additions from top-level configuration and only apply them to TypeScript files via an override.
- - Alternatively, you can add `parserOptions: { project: null }` to an override for the files you wish to exclude. Note that `{ project: undefined }` will not work.
+ - Use [ESLint's `overrides` configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#configuration-based-on-glob-patterns) to configure the file to not be parsed with type information:
+
+
+ A popular setup is to remove all rules requiring type information from the top-level configuration
+ and only apply them to TypeScript files via an override.
+
+
+ ```js title=".eslintrc.cjs"
+ module.exports = {
+ // ... the rest of your config ...
+ overrides: [
+ {
+ extends: [
+ 'plugin:@typescript-eslint/recommended-requiring-type-checking',
+ ],
+ files: ['./**/*.{ts,tsx}'],
+ },
+ ],
+ };
+ ```
+
+
+
+
+ Alternatively, in our version v6, you can use our{' '}
+ disable-type-checked
config to disable type checking for just that type of file.
+
+
+ ```js title=".eslintrc.cjs"
+ module.exports = {
+ // ... the rest of your config ...
+ overrides: [
+ {
+ extends: ['plugin:@typescript-eslint/disable-type-checked'],
+ files: ['./**/*.js'],
+ },
+ ],
+ };
+ ```
+ To disable type checking for files manually, set `parserOptions: { project: null }` to an override for the files you wish to exclude. Note that `{ project: undefined }` will not work, and you'll also need to disable any rules or rule options that require type checking.
+
+
- If you **do** want to lint the file with [type-aware linting](./Typed_Linting.mdx):
- - Check the `include` option of each of the tsconfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it.
+ - Check the `include` option of each of the TSConfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it.
+ - If the file is a `.cjs`, `.js`, or `.mjs` file, make sure [`allowJs`](https://www.typescriptlang.org/tsconfig#allowJs) is enabled.
- If your file shouldn't be a part of one of your existing tsconfigs (for example, it is a script/tool local to the repo), then consider creating a new tsconfig (we advise calling it `tsconfig.eslint.json`) in your project root which lists this file in its `include`. For an example of this, you can check out the configuration we use in this repo:
- [`tsconfig.eslint.json`](https://github.com/typescript-eslint/typescript-eslint/blob/main/tsconfig.eslint.json)
- [`.eslintrc.js`](https://github.com/typescript-eslint/typescript-eslint/blob/main/.eslintrc.js)
+
+
### More Details
This error may appear from the combination of two things:
@@ -71,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:
@@ -125,7 +207,7 @@ See [#2041](https://github.com/typescript-eslint/typescript-eslint/issues/2041)
ESLint core contains the rule [`no-restricted-syntax`](https://eslint.org/docs/rules/no-restricted-syntax).
This generic rule allows you to specify a [selector](https://eslint.org/docs/developer-guide/selectors) for the code you want to ban, along with a custom error message.
-You can use an AST visualization tool such as [typescript-eslint playground](https://typescript-eslint.io/play#showAST=es) > _Options_ > _AST Explorer_ on its left sidebar by selecting _ESTree_ to help in figuring out the structure of the AST that you want to ban.
+You can use an AST visualization tool such as [typescript-eslint playground](/play#showAST=es) > _Options_ > _AST Explorer_ on its left sidebar by selecting _ESTree_ to help in figuring out the structure of the AST that you want to ban.
For example, you can ban enums (or some variation of) using one of the following configs:
@@ -244,8 +326,36 @@ See [this issue comment](https://github.com/typescript-eslint/typescript-eslint/
### I get `no-unsafe-*` complaints for cross-file changes
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`](https://typescript-eslint.io/rules/no-unsafe-argument), [`no-unsafe-assignment`](https://typescript-eslint.io/rules/no-unsafe-assignment), and [`no-unsafe-call`](https://typescript-eslint.io/rules/no-unsafe-call) are often impacted.
+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.md).
+If you think you're having issues with performance, see our [Performance Troubleshooting documentation](./troubleshooting/Performance.mdx).
+
+## Are TypeScript project references supported?
+
+No, TypeScript project references are not yet supported.
+
+See [issue #2094 discussing project references](https://github.com/typescript-eslint/typescript-eslint/issues/2094) for more details.
diff --git a/docs/linting/Typed_Linting.mdx b/docs/linting/Typed_Linting.mdx
index a51afdad02b..290aca7d392 100644
--- a/docs/linting/Typed_Linting.mdx
+++ b/docs/linting/Typed_Linting.mdx
@@ -6,13 +6,14 @@ title: Linting with Type Information
Some typescript-eslint rules utilize the awesome power of TypeScript's type checking APIs to provide much deeper insights into your code.
To tap into TypeScript's additional powers, there are two small changes you need to make to your config file:
-```js title=".eslintrc.js"
+```js title=".eslintrc.cjs"
+/* eslint-env node */
module.exports = {
extends: [
'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',
@@ -26,12 +27,17 @@ module.exports = {
};
```
+:::caution
+Your `.eslintrc.cjs` file may start receiving a parsing error about type information.
+See [our TSConfig inclusion FAQ](./Troubleshooting.mdx#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file).
+:::
+
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.
-- `parserOptions.project` tells our parser the relative path where your project's `tsconfig.json` is.
+- `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](../architecture/Parser.mdx#tsconfigRootDir)).
+- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser#tsconfigRootDir](../packages/Parser.mdx#tsconfigRootDir)).
With that done, run the same lint command you ran before.
You may see new rules reporting errors based on type information!
@@ -41,7 +47,7 @@ You may see new rules reporting errors based on type information!
The `parserOptions.project` option can be turned on with either:
- `true`: to always use `tsconfig.json`s nearest to source files
-- `string | string[]`: any number of glob paths to match TSConfig files relative to the
+- `string | string[]`: any number of glob paths to match TSConfig files relative to `parserOptions.tsconfigRootDir`, or the current working directory if that is not provided
For example, if you use a specific `tsconfig.eslint.json` for linting, you'd specify:
@@ -55,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).
@@ -63,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/troubleshooting/Formatting.mdx b/docs/linting/troubleshooting/Formatting.mdx
index 345ac00acf4..fecec612bdc 100644
--- a/docs/linting/troubleshooting/Formatting.mdx
+++ b/docs/linting/troubleshooting/Formatting.mdx
@@ -38,6 +38,7 @@ You can then configure your formatter separately from ESLint.
Using this config by adding it to the end of your `extends`:
```js title=".eslintrc.js"
+/* eslint-env node */
module.exports = {
extends: [
'eslint:recommended',
diff --git a/docs/linting/troubleshooting/Performance.md b/docs/linting/troubleshooting/Performance.mdx
similarity index 100%
rename from docs/linting/troubleshooting/Performance.md
rename to docs/linting/troubleshooting/Performance.mdx
diff --git a/docs/linting/troubleshooting/TSLint.mdx b/docs/linting/troubleshooting/TSLint.mdx
index cc55ee62617..29e778aec93 100644
--- a/docs/linting/troubleshooting/TSLint.mdx
+++ b/docs/linting/troubleshooting/TSLint.mdx
@@ -17,7 +17,7 @@ You can look at [the alternatives list](https://github.com/typescript-eslint/typ
There is also the ultimate fallback option of using both linters together for a while during your transition if you
absolutely have to by using TSLint _within_ ESLint.
-For this option, check out [`@typescript-eslint/eslint-plugin-tslint`](../../architecture/ESLint_Plugin_TSLint.mdx).
+For this option, check out [`@typescript-eslint/eslint-plugin-tslint`](../../packages/ESLint_Plugin_TSLint.mdx).
## Why Deprecate TSLint?
diff --git a/docs/linting/typed-linting/Monorepos.mdx b/docs/linting/typed-linting/Monorepos.mdx
index 9d0d67e331f..43f688062b7 100644
--- a/docs/linting/typed-linting/Monorepos.mdx
+++ b/docs/linting/typed-linting/Monorepos.mdx
@@ -43,11 +43,12 @@ Paths may be provided as [Node globs](https://github.com/isaacs/node-glob/blob/f
For each file being linted, the first matching project path will be used as its backing TSConfig.
```js title=".eslintrc.js"
+/* eslint-env node */
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: {
@@ -68,11 +69,12 @@ Using wide globs `**` in your `parserOptions.project` may degrade linting perfor
Instead of globs that use `**` to recursively check all folders, prefer paths that use a single `*` at a time.
```js title=".eslintrc.js"
+/* eslint-env node */
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: {
@@ -99,7 +101,7 @@ See [#1192](https://github.com/typescript-eslint/typescript-eslint/issues/1192)
If you do run into an OOM, please comment on the above issue and let us know about your repo - the more information we have, the better.
As an interim workaround, consider one of the following:
-- Switching to one root `tsconfig.eslint.json` (see below)
+- Switching to one root `tsconfig.eslint.json` (see [One root `tsconfig.json`](#one-root-tsconfigjson))
- Using a shell script to only lint one package at a time, using your existing config above.
## Troubleshooting
diff --git a/docs/maintenance/versioning/dependant-version-upgrades.mdx b/docs/maintenance/Dependency_Version_Upgrades.mdx
similarity index 92%
rename from docs/maintenance/versioning/dependant-version-upgrades.mdx
rename to docs/maintenance/Dependency_Version_Upgrades.mdx
index bf1a17f2829..25903f3f535 100644
--- a/docs/maintenance/versioning/dependant-version-upgrades.mdx
+++ b/docs/maintenance/Dependency_Version_Upgrades.mdx
@@ -1,6 +1,6 @@
---
-id: dependant-version-upgrades
-title: Dependant Version Upgrades
+id: dependency-version-upgrades
+title: Dependency Version Upgrades
---
## ESLint
@@ -21,7 +21,7 @@ Whenever you discover any new areas of work that are blocked by dropping an old
1. Upgrade the root `package.json` `devDependency` to the latest ESLint
1. Add the new major version to the explicit `peerDependency` versions
1. Check [`eslint-visitor-keys`](https://www.npmjs.com/package/eslint-visitor-keys) for a new version to be upgraded to as well.
-1. Update [Versioning > ESLint](../Versioning.mdx#eslint)
+1. Update [Users > Dependency Versions > ESLint](../users/Dependency_Versions.mdx#eslint)
### Removing Support for an Old ESLint Version
@@ -32,7 +32,7 @@ Whenever you discover any new areas of work that are blocked by dropping an old
- `/eslint.*5/i`
- `/todo.*eslint.*5/i`
- `/todo.*eslint/i`
-1. Update [Versioning > ESLint](../Versioning.mdx#eslint)
+1. Update [Users > Dependency Versions > ESLint](../users/Dependency_Versions.mdx#eslint)
See [chore: drop support for ESLint v6](https://github.com/typescript-eslint/typescript-eslint/pull/5972) for reference.
@@ -81,15 +81,15 @@ 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
- In the root `package.json`, change the `devDependency` on `typescript` to `~X.Y.3`
- Rename and update `patches/typescript*` to the new TypeScript version
- Any other changes made necessary due to changes in TypeScript between the RC version and stable version
- - Update the supported version range in [Versioning](../Versioning.mdx)
-1. Update [Versioning > TypeScript](../Versioning.mdx#typescript)
+ - Update the supported version range in [Users > Dependency Versions](../users/Dependency_Versions.mdx)
+1. Update [Users > Dependency Versions > TypeScript](../users/Dependency_Versions.mdx#typescript)
1. Send a PR that updates this documentation page to point to your newer issues and PRs
- Also update any of these steps if you go with a different process
@@ -108,7 +108,7 @@ A single PR can remove support for old TypeScript versions as a breaking change:
1. Update the root `package.json` `devDependency`
1. Update the `SUPPORTED_TYPESCRIPT_VERSIONS` constant in `warnAboutTSVersion.ts`
1. Update the `versions` constant in `version-check.ts`
-1. Update [Versioning > TypeScript](../Versioning.mdx#typescript)
+1. Update [Users > Dependency Versions > TypeScript](../users/Dependency_Versions.mdx#typescript)
1. Search for source code comments (excluding `CHANGELOG.md` files) that mention a now-unsupported version of TypeScript.
- For example, to remove support for v4.3, searches might include:
- `4.3`
diff --git a/docs/maintenance/Issues.mdx b/docs/maintenance/Issues.mdx
index fc8a89711de..fbe1a45157f 100644
--- a/docs/maintenance/Issues.mdx
+++ b/docs/maintenance/Issues.mdx
@@ -78,7 +78,7 @@ In such cases you can forgo the back-and-forth and just skip to the closing step
#### 🐞 "Simple" Bugs
-A simple bug is a bug that can be reproduced in a single TS file plus an ESLint config (and possibly a TSConfig) - i.e. an issue reproducible on https://typescript-eslint.io/play.
+A simple bug is a bug that can be reproduced in a single TS file plus an ESLint config (and possibly a TSConfig) - i.e. an issue reproducible on [our playground](/play).
The vast majority of bug reports fall into this category.
If you cannot reproduce the issue as described using the issue's provided playground reproduction, it has not provided enough information.
@@ -127,7 +127,7 @@ For enhancements meant to limit which kinds of nodes the rule targets, mark the
#### 🚀 New Rules
We're generally accepting of new rules that meet the above feature request criteria.
-The biggest exception is rules that can roughly be implemented with [`@typescript-eslint/ban-types`](https://typescript-eslint.io/rules/ban-types) and/or [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax).
+The biggest exception is rules that can roughly be implemented with [`@typescript-eslint/ban-types`](/rules/ban-types) and/or [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax).
## Pruning Old Issues
diff --git a/docs/maintenance/Releases.mdx b/docs/maintenance/Major_Release_Steps.mdx
similarity index 55%
rename from docs/maintenance/Releases.mdx
rename to docs/maintenance/Major_Release_Steps.mdx
index 87fb87529df..42993b4480b 100644
--- a/docs/maintenance/Releases.mdx
+++ b/docs/maintenance/Major_Release_Steps.mdx
@@ -1,62 +1,9 @@
---
-id: releases
-sidebar_label: Releases
-title: Releases
+id: major-release-steps
+title: Major Release Steps
---
-## Canary
-
-We release a canary version for each commit to `main` that passes all required checks. This release is performed automatically by the [`publish_canary_version` step](https://github.com/typescript-eslint/typescript-eslint/blob/5feb2dba9da2bd5e233451b7b0f1c99414b5aef9/.github/workflows/ci.yml#L234-L263).
-
-This release is goes to the `canary` tag on npm and it is versioned as an incremental canary patch release on top of the current `latest` version. I.e. if the current version is `5.6.1`, then the first canary version will be `5.6.2-alpha.0`, the second `5.6.2-alpha.1`, and so on.
-
-### Installing Canary Versions
-
-To try out the latest canary versions of typescript-eslint, install `@typescript-eslint/eslint-plugin@canary` and `@typescript-eslint/parser@canary`.
-Note that npm may need a `--force` to override version requirements.
-
-
-
-### npm
-
-```bash
-npm i @typescript-eslint/eslint-plugin@canary @typescript-eslint/parser@canary --save-dev --force
-```
-
-### Yarn
-
-```bash
-yarn add @typescript-eslint/eslint-plugin@canary @typescript-eslint/parser@canary --save-dev
-```
-
-
-
-## Latest
-
-We release a latest version every Monday at 1pm US Eastern time using the latest commit to `main` at that time. This release is performed automatically by a Github action located in a private repository. This release goes to the standard `latest` tag on npm.
-
-See the [versioning](#versioning) section below for how the version number is calculated.
-
-If there have been no commits that impact public-facing packages then a patch-level release shall be released.
-
-Latest releases shall only ever be "minor" or "patch" releases.
-
-## Major Releases
-
-We currently do not have a set schedule around when major releases shall be performed; instead they are done as the need arises.
-
-We keep a backlog of breaking issues as a milestone on GitHub that is named in the form `${major}.0.0`.
-When we do do a major release, we release a release candidate version to the `rc-v${major}` tag on npm for each commit to the major branch.
-
-### Major Release Steps
-
-Our releases go through three groups of steps:
-
-1. [Pre-Release Preparation]
-1. [Merging Breaking Changes]
-1. [Releasing the Version]
-
-#### 1. Pre-Release Preparation
+## 1. Pre-Release Preparation
1. Create a milestone by the name of the release [example: [Milestone 6.0.0](https://github.com/typescript-eslint/typescript-eslint/milestone/8)].
1. If an issue for changes to recommended rule configs doesn't yet exist, create one [example: [Changes to the `recommended` sets for 5.0.0](https://github.com/typescript-eslint/typescript-eslint/issues/5900)].
@@ -71,7 +18,7 @@ Our releases go through three groups of steps:
- Its publish command should be `npx lerna publish premajor --loglevel=verbose --canary --exact --force-publish --yes --dist-tag rc-v${major}`.
- Merge this into `main` once reviewed and rebase the `v${major}` branch.
-#### 2. Merging Breaking Changes
+## 2. Merging Breaking Changes
1. Send a PR from `v${major}` to `main` [example: [v6.0.0](https://github.com/typescript-eslint/typescript-eslint/pull/5886)].
1. Change all [breaking change PRs](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+is%3Aopen+label%3A%22breaking+change%22) to target the `v${major}` branch.
@@ -87,7 +34,7 @@ _Non_-breaking changes can be merged to `main` or the major branch.
They don't need any special treatment.
:::
-#### 3. Releasing the Version
+## 3. Releasing the Version
1. Discuss with the maintainers to be ready for an [out-of-band](#out-of-band) release. Doing this manually helps ensure someone is on-hand to action any issues that might arise from the major release.
1. Prepare the release notes. Lerna will automatically generate the release notes on GitHub, however this will be disorganized and unhelpful for users. We need to reorganize the release notes so that breaking changes are placed at the top to make them most visible. If any migrations are required, we must list the steps to make it easy for users.
@@ -95,15 +42,3 @@ They don't need any special treatment.
- Example release notes: [`v5.0.0`](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v5.0.0), [`v4.0.0`](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0), [`v3.0.0`](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0)
1. Finally, tweet the release on the `@tseslint` twitter with a link to the GitHub release. Make sure you include additional information about the highlights of the release!
-
-## Out-of-Band
-
-We will do releases "out-of-band" (outside the [latest](#latest) schedule) for rare emergencies.
-We assess need on a case-by-case basis though generally an emergency is defined as a critical regression specifically introduced in the latest release.
-
-These releases are done manually by a maintainer with the required access privileges.
-
-## Back-Porting Releases
-
-We **_do not_** back port releases to previously released major/minor versions.
-We only ever release forward.
diff --git a/docs/maintenance/Pull_Requests.mdx b/docs/maintenance/Pull_Requests.mdx
index 37c6b40256c..02f00ac952d 100644
--- a/docs/maintenance/Pull_Requests.mdx
+++ b/docs/maintenance/Pull_Requests.mdx
@@ -32,3 +32,11 @@ Our flow for PRs that have been waiting for >=1 month is:
2. Add the `stale` label to the PR
3. Wait 2 weeks
4. If they still haven't responded, close the PR with a message like the _Pruning Stale PR_ template
+
+## Suggestions
+
+Consider adding fun to PR reviews with GIFs.
+The benefits of using GIFs in PR reviews are that it adds a touch of humor and lightheartedness to the process, builds camaraderie and team spirit, and can help break the ice by making users feel welcomed.
+Please remember to use appropriate and respectful GIFs and use them sparingly; GIFs should enhance the conversation, not detract from it.
+
+> We like to use the _GIFs for Github_ extension: available as [GIFs for GitHub (Chrome)](https://chrome.google.com/webstore/detail/gifs-for-github/dkgjnpbipbdaoaadbdhpiokaemhlphep) and [GIFs for GitHub (Firefox)](https://addons.mozilla.org/en-US/firefox/addon/gifs-for-github). ✨
diff --git a/docs/maintenance/issues/Rule_Deprecations.mdx b/docs/maintenance/issues/Rule_Deprecations.mdx
index 98486f2bb6c..1e89880390b 100644
--- a/docs/maintenance/issues/Rule_Deprecations.mdx
+++ b/docs/maintenance/issues/Rule_Deprecations.mdx
@@ -31,4 +31,4 @@ Provide it an `## Overview` containing:
- `deprecated: true`
- `replacedBy`, if applicable
2. In the next major version, you may delete the rule
- - If the rule is relatively popular with users, consider leaving a documentation page as a tombstone pointing to the new relevant rule or docs (see [`camelcase`](https://typescript-eslint.io/rules/camelcase/) as an example)
+ - If the rule is relatively popular with users, consider leaving a documentation page as a tombstone pointing to the new relevant rule or docs (see [`camelcase`](/rules/camelcase/) as an example)
diff --git a/docs/architecture/ESLint_Plugin.mdx b/docs/packages/ESLint_Plugin.mdx
similarity index 100%
rename from docs/architecture/ESLint_Plugin.mdx
rename to docs/packages/ESLint_Plugin.mdx
diff --git a/docs/architecture/ESLint_Plugin_TSLint.mdx b/docs/packages/ESLint_Plugin_TSLint.mdx
similarity index 100%
rename from docs/architecture/ESLint_Plugin_TSLint.mdx
rename to docs/packages/ESLint_Plugin_TSLint.mdx
diff --git a/docs/architecture/Parser.mdx b/docs/packages/Parser.mdx
similarity index 88%
rename from docs/architecture/Parser.mdx
rename to docs/packages/Parser.mdx
index 39ade74168a..a4faf2a8446 100644
--- a/docs/architecture/Parser.mdx
+++ b/docs/packages/Parser.mdx
@@ -21,7 +21,7 @@ TS's AST is optimized for its use case of parsing incomplete code and typechecki
ESTree is unoptimized and intended for "general purpose" use-cases of traversing the AST.
:::tip
-You can select `@typescript-eslint/parser` on the [typescript-eslint playground](https://typescript-eslint.io/play#showAST=es)'s left sidebar under _Options_ > _AST Explorer_ by selecting _ESTree_.
+You can select `@typescript-eslint/parser` on the [typescript-eslint playground](/play#showAST=es)'s left sidebar under _Options_ > _AST Explorer_ by selecting _ESTree_.
:::
## Configuration
@@ -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[];
@@ -109,7 +108,7 @@ Specifies the version of ECMAScript syntax you want to use. This is used by the
> Default `undefined`.
-This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](https://typescript-eslint.io/linting/typed-linting). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster.
+This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](../linting/Typed_Linting.mdx). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster.
### `extraFileExtensions`
@@ -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
{
@@ -251,7 +231,23 @@ Doing so ensures running ESLint from a directory other than the root will still
> Default `true`.
-This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported
+This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported. The warning message would look like this:
+
+```plaintext
+=============
+
+WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
+
+You may find that it works just fine, or you may not.
+
+SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.1.0
+
+YOUR TYPESCRIPT VERSION: 5.1.3
+
+Please only submit bug reports when using the officially supported version.
+
+=============
+```
## Utilities
diff --git a/docs/packages/Rule_Tester.mdx b/docs/packages/Rule_Tester.mdx
new file mode 100644
index 00000000000..8caec346d77
--- /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/architecture/Scope_Manager.mdx b/docs/packages/Scope_Manager.mdx
similarity index 90%
rename from docs/architecture/Scope_Manager.mdx
rename to docs/packages/Scope_Manager.mdx
index af7bd6e27c5..cd33ac0fc75 100644
--- a/docs/architecture/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/architecture/TypeScript-ESTree.mdx b/docs/packages/TypeScript_ESTree.mdx
similarity index 82%
rename from docs/architecture/TypeScript-ESTree.mdx
rename to docs/packages/TypeScript_ESTree.mdx
index 40d42606296..6354565e828 100644
--- a/docs/architecture/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,
@@ -137,6 +147,15 @@ interface ParseAndGenerateServicesOptions extends ParseOptions {
*/
errorOnTypeScriptSyntacticAndSemanticIssues?: boolean;
+ /**
+ * ***EXPERIMENTAL FLAG*** - Use this at your own risk.
+ *
+ * Whether to create a shared TypeScript server to power program creation.
+ *
+ * @see https://github.com/typescript-eslint/typescript-eslint/issues/6575
+ */
+ EXPERIMENTAL_useProjectService?: boolean;
+
/**
* ***EXPERIMENTAL FLAG*** - Use this at your own risk.
*
@@ -145,7 +164,7 @@ interface ParseAndGenerateServicesOptions extends ParseOptions {
*
* This flag REQUIRES at least TS v3.9, otherwise it does nothing.
*
- * See: https://github.com/typescript-eslint/typescript-eslint/issues/2094
+ * @see https://github.com/typescript-eslint/typescript-eslint/issues/2094
*/
EXPERIMENTAL_useSourceOfProjectReferenceRedirect?: boolean;
@@ -202,15 +221,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 +255,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 +298,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/architecture/Utils.mdx b/docs/packages/Utils.mdx
similarity index 66%
rename from docs/architecture/Utils.mdx
rename to docs/packages/Utils.mdx
index 7c4fd674d70..df05daa7690 100644
--- a/docs/architecture/Utils.mdx
+++ b/docs/packages/Utils.mdx
@@ -8,21 +8,21 @@ sidebar_label: utils
> Utilities for working with TypeScript + ESLint together. ✨
This package contains public utilities for writing custom rules and plugins in TypeScript.
-Rules declared in [`@typescript-eslint/eslint-plugin`](https://typescript-eslint.io/architecture/eslint-plugin) are created using these utility functions.
+Rules declared in [`@typescript-eslint/eslint-plugin`](./ESLint_Plugin.mdx) are created using these utility functions.
Any custom rules you write generally will be as well.
-> See [Custom Rules](https://typescript-eslint.io/custom-rules) for documentation on creating your own custom ESLint rules for TypeScript code.
+> See [Custom Rules](../developers/Custom_Rules.mdx) for documentation on creating your own custom ESLint rules for TypeScript code.
## 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/Dependency_Versions.mdx b/docs/users/Dependency_Versions.mdx
new file mode 100644
index 00000000000..406ec999eeb
--- /dev/null
+++ b/docs/users/Dependency_Versions.mdx
@@ -0,0 +1,35 @@
+---
+id: dependency-versions
+title: Dependency Versions
+---
+
+## 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 `>=3.3.1 <5.2.0`.
+
+These versions are what we test against.
+
+We will always endeavor to support the latest stable version of TypeScript.
+Sometimes, but not always, changes in TypeScript will not require breaking changes in this project, and so we are able to support more than one version of TypeScript.
+In some cases, we may even be able to support additional pre-releases (i.e. betas and release candidates) of TypeScript, but only if doing so does not require us to compromise on support for the latest stable version.
+
+Note that our packages have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.
+
+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: [Packages > Parser > `warnOnUnsupportedTypeScriptVersion`](../packages/Parser.mdx#warnonunsupportedtypescriptversion).
+
+## Dependant Version Upgrades
+
+See [Maintenance > Dependent Version Upgrades](../maintenance/Dependency_Version_Upgrades.mdx) for maintenance steps to update these versions.
diff --git a/docs/users/Releases.mdx b/docs/users/Releases.mdx
new file mode 100644
index 00000000000..7e8721f9fb5
--- /dev/null
+++ b/docs/users/Releases.mdx
@@ -0,0 +1,83 @@
+---
+id: releases
+sidebar_label: Releases
+title: Releases
+---
+
+## Latest
+
+
+
+
+
+We release a latest version every Monday at 1pm US Eastern time using the latest commit to `main` at that time. This release is performed automatically by a Github action located in a private repository. This release goes to the standard `latest` tag on npm.
+
+See [Versioning](./Versioning.mdx) for how the version number is calculated.
+
+If there have been no commits that impact public-facing packages then a patch-level release shall be released.
+
+Latest releases shall only ever be "minor" or "patch" releases.
+
+### Release Notes
+
+Every release is documented on the [Github Release page](https://github.com/typescript-eslint/typescript-eslint/releases).
+
+These release notes will list the PRs included in the release.
+
+## Canary
+
+
+
+
+
+We release a canary version for each commit to `main` that passes all required checks. This release is performed automatically by the [`publish_canary_version` step](https://github.com/typescript-eslint/typescript-eslint/blob/5feb2dba9da2bd5e233451b7b0f1c99414b5aef9/.github/workflows/ci.yml#L234-L263).
+
+This release is goes to the `canary` tag on npm and it is versioned as an incremental canary patch release on top of the current `latest` version. I.e. if the current version is `5.6.1`, then the first canary version will be `5.6.2-alpha.0`, the second `5.6.2-alpha.1`, and so on.
+
+### Installing Canary Versions
+
+To try out the latest canary versions of typescript-eslint, install `@typescript-eslint/eslint-plugin@canary` and `@typescript-eslint/parser@canary`.
+Note that npm may need a `--force` to override version requirements.
+
+
+
+### npm
+
+```bash
+npm i @typescript-eslint/eslint-plugin@canary @typescript-eslint/parser@canary --save-dev --force
+```
+
+### Yarn
+
+```bash
+yarn add @typescript-eslint/eslint-plugin@canary @typescript-eslint/parser@canary --dev
+```
+
+
+
+## Major Releases
+
+We currently do not have a set schedule around when major releases shall be performed; instead they are done as the need arises.
+
+We keep a backlog of breaking issues as a milestone on GitHub that is named in the form `${major}.0.0`.
+When we do do a major release, we release a release candidate version to the `rc-v${major}` tag on npm for each commit to the major branch.
+
+See [Maintenance > Major Release Steps](../maintenance/Major_Release_Steps.mdx) for steps to perform a major release.
+
+## Out-of-Band
+
+We will do releases "out-of-band" (outside the [latest](#latest) schedule) for rare emergencies.
+We assess need on a case-by-case basis though generally an emergency is defined as a critical regression specifically introduced in the latest release.
+
+These releases are done manually by a maintainer with the required access privileges.
+
+## Back-Porting Releases
+
+We **_do not_** back port releases to previously released major/minor versions.
+We only ever release forward.
diff --git a/docs/maintenance/Versioning.mdx b/docs/users/Versioning.mdx
similarity index 77%
rename from docs/maintenance/Versioning.mdx
rename to docs/users/Versioning.mdx
index 4cd92c6c857..5f9f9450953 100644
--- a/docs/maintenance/Versioning.mdx
+++ b/docs/users/Versioning.mdx
@@ -35,10 +35,6 @@ The only exception to the automated publishes described above is when we are in
During these periods, we manually publish `canary` releases until we are happy with the release and promote it to `latest`.
:::
-## Dependant Versions
-
-> See [Versioning > Dependant Version Upgrades](./versioning/dependant-version-upgrades.mdx) for maintenance steps to update these versions.
-
### ESLint
> The version range of ESLint currently supported is `^6.0.0 || ^7.0.0 || ^8.0.0`.
@@ -52,19 +48,31 @@ Support for specific Current status releases are considered periodically.
### TypeScript
-> The version range of TypeScript currently supported is `>=3.3.1 <5.1.0`.
+> 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.
-These versions are what we test against.
+Generally we will begin working on supporting the next release when the `rc` version is released.
-We will always endeavor to support the latest stable version of TypeScript.
-Sometimes, but not always, changes in TypeScript will not require breaking changes in this project, and so we are able to support more than one version of TypeScript.
-In some cases, we may even be able to support additional pre-releases (i.e. betas and release candidates) of TypeScript, but only if doing so does not require us to compromise on support for the latest stable version.
+#### Version Warning Logs
Note that our packages have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript.
-If you use a non-supported version of TypeScript, the parser will log a warning to the console.
+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`](../architecture/Parser.mdx#warnonunsupportedtypescriptversion).
+See: [Parser > `warnOnUnsupportedTypeScriptVersion`](../packages/Parser.mdx#warnonunsupportedtypescriptversion).
## Breaking Changes
diff --git a/jest.config.base.js b/jest.config.base.js
index 48c306a70c0..355b70884c9 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/jest.config.js b/jest.config.js
index 42c86fd0ca4..1a9107f8706 100644
--- a/jest.config.js
+++ b/jest.config.js
@@ -1,4 +1,4 @@
-const { getJestProjects } = require('@nrwl/jest');
+const { getJestProjects } = require('@nx/jest');
module.exports = {
projects: getJestProjects(),
diff --git a/lerna.json b/lerna.json
index f5ad724031b..c96412a8497 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,6 +1,11 @@
{
- "version": "5.56.0",
+ "$schema": "node_modules/lerna/schemas/lerna-schema.json",
+ "version": "6.0.0",
"npmClient": "yarn",
- "useWorkspaces": true,
- "stream": true
+ "stream": true,
+ "command": {
+ "version": {
+ "changelogEntryAdditionalMarkdown": "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."
+ }
+ }
}
diff --git a/netlify.toml b/netlify.toml
index 06deeaaed01..6d2badd2a9c 100644
--- a/netlify.toml
+++ b/netlify.toml
@@ -19,7 +19,7 @@
[[redirects]]
from = "/docs/development/architecture/packages"
- to = "/architecture"
+ to = "/packages"
[[redirects]]
from = "/docs/development/custom-rules"
@@ -39,4 +39,4 @@
[[redirects]]
from = "/docs/*"
- to = "/"
+ to = "/:splat"
diff --git a/nx.json b/nx.json
index 8830a7c698a..e441e44aff7 100644
--- a/nx.json
+++ b/nx.json
@@ -1,9 +1,8 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
- "npmScope": "typescript-eslint",
"tasksRunnerOptions": {
"default": {
- "runner": "@nrwl/nx-cloud",
+ "runner": "nx-cloud",
"options": {
"cacheableOperations": ["build", "lint", "package", "prebuild", "test"],
"accessToken": "YjIzMmMxMWItMjhiMS00NWY2LTk1NWYtYWU3YWQ0YjE4YjBlfHJlYWQ="
@@ -27,6 +26,7 @@
"inputs": [
"default",
"{workspaceRoot}/.eslintrc.js",
+ "{workspaceRoot}/yarn.lock",
"{workspaceRoot}/.eslintignore"
]
}
@@ -43,6 +43,6 @@
}
],
"sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"],
- "production": ["default"]
+ "production": ["default", "!{projectRoot}/src/test-setup.[jt]s"]
}
}
diff --git a/package.json b/package.json
index 88447c4b5f2..22460b599a7 100644
--- a/package.json
+++ b/package.json
@@ -16,121 +16,133 @@
"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": {
- "@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",
- "@nrwl/jest": "15.7.2",
- "@nrwl/nx-cloud": "15.0.3",
- "@nrwl/workspace": "15.7.2",
- "@swc/core": "^1.3.1",
- "@swc/jest": "^0.2.21",
+ "@actions/core": "^1.10.0",
+ "@actions/github": "^5.1.1",
+ "@babel/code-frame": "^7.22.5",
+ "@babel/core": "^7.22.8",
+ "@babel/eslint-parser": "^7.22.7",
+ "@babel/parser": "^7.22.7",
+ "@babel/types": "^7.22.5",
+ "@nrwl/nx-cloud": "16.1.0",
+ "@nx/jest": "16.5.2",
+ "@nx/linter": "16.5.2",
+ "@nx/workspace": "16.5.2",
+ "@swc/core": "^1.3.68",
+ "@swc/jest": "^0.2.26",
"@types/babel__code-frame": "^7.0.3",
- "@types/debug": "^4.1.7",
- "@types/eslint-visitor-keys": "^1.0.0",
- "@types/glob": "^8.0.0",
+ "@types/babel__core": "^7.20.1",
+ "@types/debug": "^4.1.8",
"@types/is-glob": "^4.0.2",
- "@types/jest": "^29.0.2",
- "@types/jest-specific-snapshot": "^0.5.5",
- "@types/lodash": "^4.14.182",
- "@types/marked": "^4.0.3",
+ "@types/jest-specific-snapshot": "^0.5.6",
+ "@types/jest": "29.5.3",
+ "@types/marked": "^5.0.0",
+ "@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.19",
+ "@types/prettier": "^2.7.2",
+ "@types/semver": "^7.5.0",
"@types/tmp": "^0.2.3",
- "console-fail-test": "^0.1.7",
- "cross-env": "^7.0.3",
- "cross-fetch": "^3.1.5",
- "cspell": "^6.0.0",
+ "console-fail-test": "^0.2.3",
+ "cross-fetch": "^4.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.44.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.1.0",
+ "eslint-plugin-import": "^2.27.5",
+ "eslint-plugin-jest": "^27.2.2",
+ "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.0.3",
- "jest-diff": "^29.0.3",
- "jest-snapshot": "^29.0.3",
+ "eslint-plugin-unicorn": "^47.0.0",
+ "execa": "7.1.1",
+ "glob": "^10.3.3",
+ "husky": "^8.0.3",
+ "jest-diff": "^29.6.1",
+ "jest-snapshot": "^29.6.1",
"jest-specific-snapshot": "^8.0.0",
- "lerna": "6.5.1",
- "lint-staged": "^13.0.0",
- "make-dir": "^3.1.0",
- "markdownlint-cli": "^0.33.0",
+ "jest": "29.6.1",
+ "lerna": "7.1.3",
+ "lint-staged": "^13.2.3",
+ "make-dir": "^4.0.0",
+ "markdownlint-cli": "^0.35.0",
"ncp": "^2.0.0",
- "nx": "15.7.2",
- "patch-package": "^6.4.7",
- "prettier": "2.8.1",
- "pretty-format": "^29.0.3",
- "rimraf": "^4.0.0",
+ "netlify": "^13.1.9",
+ "nx-cloud": "16.1.0",
+ "nx": "16.5.2",
+ "patch-package": "^7.0.0",
+ "prettier": "^2.8.4",
+ "pretty-format": "^29.6.1",
+ "raw-loader": "^4.0.2",
+ "rimraf": "^5.0.1",
"tmp": "^0.2.1",
"ts-node": "10.7.0",
"tslint": "^6.1.3",
- "tsx": "^3.12.1",
- "typescript": ">=3.3.1 <5.1.0"
+ "tsx": "^3.12.7",
+ "typescript": ">=4.3.5 <5.2.0"
},
"resolutions": {
- "typescript": "~5.0.2",
- "@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.19",
+ "@types/react": "^18.2.14",
+ "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.7",
+ "typescript": "5.1.6"
}
}
diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md
index cecad00b4d5..091ae8a95ce 100644
--- a/packages/ast-spec/CHANGELOG.md
+++ b/packages/ast-spec/CHANGELOG.md
@@ -3,6 +3,220 @@
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
+
+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.61.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.1...v5.61.0) (2023-07-03)
+
+
+### Features
+
+* support TypeScript 5.1 ([#7088](https://github.com/typescript-eslint/typescript-eslint/issues/7088)) ([4bf2d73](https://github.com/typescript-eslint/typescript-eslint/commit/4bf2d7360eaf74c9ef87b196ff4c459b8f50800b))
+
+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.60.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.0...v5.60.1) (2023-06-26)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+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.60.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.11...v5.60.0) (2023-06-19)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.11](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.10...v5.59.11) (2023-06-12)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.10](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.9...v5.59.10) (2023-06-12)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.9](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.8...v5.59.9) (2023-06-05)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.8](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.7...v5.59.8) (2023-05-29)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.6...v5.59.7) (2023-05-22)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.5...v5.59.6) (2023-05-15)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.4...v5.59.5) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.3...v5.59.4) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.2...v5.59.3) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.1...v5.59.2) (2023-05-01)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.59.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.0...v5.59.1) (2023-04-24)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+# [5.59.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.58.0...v5.59.0) (2023-04-17)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+# [5.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
+# [5.57.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.56.0...v5.57.0) (2023-03-27)
+
+**Note:** Version bump only for package @typescript-eslint/ast-spec
+
+
+
+
+
# [5.56.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.55.0...v5.56.0) (2023-03-20)
**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 6437c93c83b..f8ef9553d47 100644
--- a/packages/ast-spec/package.json
+++ b/packages/ast-spec/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/ast-spec",
- "version": "5.56.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": "*",
+ "@microsoft/api-extractor": "^7.36.1",
"glob": "*",
"jest-diff": "*",
"jest-snapshot": "*",
diff --git a/packages/ast-spec/project.json b/packages/ast-spec/project.json
index 41721d18d71..60741f21eae 100644
--- a/packages/ast-spec/project.json
+++ b/packages/ast-spec/project.json
@@ -13,10 +13,11 @@
"outputs": ["{projectRoot}/dist/**/*.ts"]
},
"lint": {
- "executor": "@nrwl/linter:eslint",
+ "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 4878cfc87b6..595d1393ac4 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 56446bc78ba..035b18a682e 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 f1f2087ccae..f2815458d58 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 f1d5b9cc440..a379ac92242 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 0da1e7b414d..afd906f3778 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 683600ec01d..dc7f701f0f1 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 00000000000..d54b28def83
--- /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 00000000000..f81327f8c1f
--- /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 00000000000..428e6049da8
--- /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 00000000000..72c44523ffa
--- /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 00000000000..f81327f8c1f
--- /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 00000000000..09c3f103496
--- /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 00000000000..32918ff7c5f
--- /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 00000000000..123225a1825
--- /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 00000000000..4f8ef959d9b
--- /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 c17328b32e8..f8cc08dcf67 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 00000000000..18e4442401e
--- /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 00000000000..f8435732131
--- /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 00000000000..35683b84121
--- /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 00000000000..a14c3c54cac
--- /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 00000000000..49567ea7a7b
--- /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 00000000000..e3a40451c7e
--- /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 7b137a8c5de..cbf46a94b95 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 00000000000..098ed5e7a14
--- /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 00000000000..6ef9a4c481a
--- /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 0be64ad3473..106f67b9962 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 00000000000..98c58289073
--- /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 556a8358a93..bbe0a4ac3df 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 54a7219ce9a..b4665912df8 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 a1d8cdbc4c7..97f866fa71b 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 9fbaa86d5a2..7b52ed82f8c 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 c9cc55d9563..c9593be9d1a 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 751a6cc951f..8170c78f09b 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 589d5478de6..a8e11ccde02 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 503bd4f5ad8..373c6c0b694 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 189097a1c6b..df093f58556 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 795e34e032c..230ef4b49bc 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 53d85a3efcb..e2d4e3c5b2b 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 432a1483eb4..f9a14574511 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 d1b1649faf2..96f7df79dc0 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 d7a16a19520..64ff14cbc80 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 2ce8cf69e4f..d515d3cc5d0 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 7408520a611..724e995d358 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 ce7ed5710f2..145331d6f60 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 77b0476655c..d38bcdd0e91 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 da55fad4be0..0fac21498b6 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 b0aec089f61..e8a1bd9feae 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 5608ba08cb8..463d9e92366 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 8d97c664397..f995f9cb827 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 e67ef886321..449bb1d1903 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 60e9b202a98..c370fbf2d48 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 816492fcd48..881f037d032 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 121e647439e..24c2998c99c 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 00000000000..b45b0c8fc85
--- /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 d3c411c7ec3..41bd9538e7f 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 00000000000..89889f0ae31
--- /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 00000000000..04ccfb73d5b
--- /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 5f6d97e5f2b..cea1b9f2468 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 00000000000..3e05e98bfaf
--- /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 00000000000..a3d08a7b52a
--- /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 bcf5b40695c..f3e5cca5923 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 00000000000..3a1a419a831
--- /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 d5880f6e82a..cfc3aa2ff7c 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 077fe892d33..73bad658c9a 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 46c322f2648..4ca39e1413a 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 7d543dbf759..35ef7eeb190 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 414f4ad0e4d..0e45eb9b9ff 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 8aabbae3357..195370c94fc 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 00000000000..294c438cb03
--- /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 c289052b36c..2d7fc99e0d6 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 00000000000..32a1cb0d300
--- /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 00000000000..a80c3233614
--- /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 d1633569950..49d3238347f 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 00000000000..7ecaa9bcded
--- /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 00000000000..6afc67d4a5b
--- /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 bce2c7cd5ee..c9b9a1add35 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 00000000000..9f4c01a0337
--- /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 00000000000..318dee3aacf
--- /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 43ab9a3893e..d8dbfa38549 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 00000000000..327cd763562
--- /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 39f13498111..b9477b99094 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 6c617458733..27fa552a126 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 b385410a6f4..78e1248e57a 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 0472fbccb82..5ccd7cf076e 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 27c43a096a4..6d1adf5f5c3 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 4d3dd269c49..f49e8ea492d 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 10f61a476b3..5f8ad663f08 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 892ae8987da..31cfe8a973e 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 8583f46cc17..538a6bf0b1b 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 6e67c16fb8b..d5c74ed1fc0 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 2b194f9fe41..e065912d92e 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 1fc84e1257d..5682d50ae12 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 4f5ff343403..2375cb57a51 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 778b30b1513..5818ff75d81 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 00000000000..dabc7d927d5
--- /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 71841045f6c..015ff072aa2 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 00000000000..efb97399842
--- /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 00000000000..b3ebe67f29a
--- /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 4bb37139b1b..499868339f5 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 00000000000..82e5ade4750
--- /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 82e5ade4750..1f517013974 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 00000000000..70ef1140faa
--- /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 9c89f7d7f37..4082dd30023 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 00000000000..15aae2856e1
--- /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 00000000000..d3a01941b96
--- /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 bc1507d797f..28d1d243964 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 00000000000..fd6445ddef3
--- /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 00000000000..873ef0496aa
--- /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 00000000000..b75c9eb03cb
--- /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 00000000000..59d790cb18d
--- /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 af9eba5ac2c..ceed78baec4 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 00000000000..dbe6913aab5
--- /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 00000000000..968987af209
--- /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 302c6c7c652..1f563cfbf37 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 00000000000..00f60c625f5
--- /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 00000000000..3ba27489473
--- /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 7e7d8c008fc..55c09361565 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 00000000000..f2d4bb40cc5
--- /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 00000000000..cf5a26409d1
--- /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 9e96ac05522..119a66ed891 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 00000000000..7d06f41fc05
--- /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 3d293d47906..4b9ea6313a3 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 845f2cb5cfb..81487c9bfc1 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 38a932b1510..f5bf7d6c3a9 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 cb90ab5e0fb..1e08010d64d 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 e3bcf1073f7..47339e03ec4 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 9aaae286a11..b1623c4968c 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 52eb4ae3b01..8f25a46494f 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 1a21129afb2..cba00ad04c1 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 d00e691d3bc..ba60ee6c0a8 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 fe318b3ed6f..31a4f289f30 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 24a743aa3e0..72b482685c1 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 240f602618f..d17b88c8cc6 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 ce7c51c99dc..cf88a1a29c4 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 8d76dc7c571..19de4d0f7c2 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 de96750e8a2..490d6d7493d 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 02ddc518379..4a6ef4e90d4 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 00000000000..494c5144247
--- /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 fe50a12a050..073273fe601 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 00000000000..0a3d1ca1dee
--- /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 d9b1ab535bb..f2293b94d19 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 9bc7be30c10..a5080b151db 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 db70418e9f1..896628c6482 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 a28d2704149..92f70fe2850 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 bb45021e9c4..b265b8c947b 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 00000000000..d0110ccac63
--- /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 e8630b3f99c..0956bdc9b2f 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 00000000000..adae3f26337
--- /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 00000000000..83a2a868f15
--- /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 00000000000..04a70d3af29
--- /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 00000000000..d23f3eff955
--- /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 156bebb725c..ac2aad35f54 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 00000000000..f34f77cd1b8
--- /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 00000000000..8be1b8d27a3
--- /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 8c643863afb..13d3d85c2d0 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 00000000000..f2b863d8647
--- /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 e6fff4485ad..5db6bc765d6 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 fe3cf227fba..0d134e323b2 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 5488f802897..ddeb4088eba 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 b08265806b5..4d1680384f2 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 e4e71a2fb49..67d476e5548 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 e94e87d038a..37659c98a4a 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 50300869247..25ed627b8d0 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 f8b80c46b1e..8e1fef0e8e0 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 f2b6eb75bd0..17873554d10 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 5c75a74de72..24d97c68311 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 9b4bc22574a..71e8be80b3c 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 d0df21058e9..50df6aa1bbb 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 c0c9374cef9..7ca866c911b 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 b910a007d54..a51ce3f5843 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 591b41616e6..397c78f0a9b 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 d54f1d9b395..f70efb2f43c 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 4fe3d2dc693..0ede710628c 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 00000000000..438c9cdf750
--- /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 233c225dd50..33e9c446a1a 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 00000000000..2e0bcbec5a5
--- /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 00000000000..9cf4c4b719a
--- /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 d94d399517f..e5cfc6b43cc 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 00000000000..89fae3fa27c
--- /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 00000000000..970528e3253
--- /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 2ca1651099b..a4b94678f3e 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 00000000000..fefbeef9c52
--- /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 00000000000..294d069aacc
--- /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 9d2be22fe16..59a98df1b7c 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 00000000000..6e491db0e63
--- /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 00000000000..605940a8433
--- /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 a2271606e4b..53e838303c4 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 00000000000..f1e891dbeca
--- /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 00000000000..8efbfcaf519
--- /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 0a5d4ab3922..3f80cb253da 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 00000000000..e3c8c7a6288
--- /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 00000000000..a511cc6c94d
--- /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 fa9ec459a92..4264e2530ef 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 00000000000..f0d97ae32bc
--- /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 00000000000..49abb836662
--- /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 4cfff84fd98..9c245972b5d 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 00000000000..0d5964ffc24
--- /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 21520b95679..c4795890019 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 c7b85e439da..96cbf1acd91 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 c313d622bce..8b38359c0e5 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 5a7d0eb9f83..c6194ed4271 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 eb772c5560a..bed5bd1289c 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 77b9d9ec72b..7d7acd1e28b 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 1ea4756931c..f54adf1db18 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 8661b6d43b2..5457bc7111e 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 34c14d0729c..ab716a4e00f 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 c975ae69118..622ac6c755b 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 d8ef93e2bcf..50127e55882 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 2524045a807..4bbe4eb9480 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 69d5b756745..38a4b893dcc 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 3f4b4b678e7..43e85474199 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 e12f543ac79..1bf7774ca11 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 a502907e8f6..d9cd9c7eb25 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 00000000000..01db37879fb
--- /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 00000000000..1f36cb0955f
--- /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 00000000000..e56bbb59892
--- /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 00000000000..22b125b5643
--- /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 00000000000..bb9716addfb
--- /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 53a142d37be..552e4f76d05 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 00000000000..7bd554c552a
--- /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 00000000000..be819649c55
--- /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 00000000000..83fabb4dfc7
--- /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 00000000000..12fadb8985a
--- /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 86f0f5e5e10..42648fc529a 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 00000000000..0587657ad4e
--- /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 00000000000..82c36588558
--- /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 4b033027f13..cb267be45a9 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 00000000000..0d57d7e26a4
--- /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 4a3c6fc890f..02d0f0be04a 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 89f8ab5e347..db8ca71596d 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 1a4b2942e3f..b621f52027b 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 e5478271a49..f2de95210fa 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 272852bf6bb..eef7af8af21 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 cfed52f085e..a5f9bb2ff41 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 da937eccc13..7b4383d832f 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 81f8c45d656..45d4a64b961 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 792faca0535..fa8ec36adb3 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 bddda38b36f..291cdb6599d 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 6af698ad0b9..acf12bd81e2 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 711d27f25cf..6a9a1fce530 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 5ee44430806..15316bd31a9 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 a683f16a878..e1e39ac6154 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 dd3182b826a..98e4d655fb3 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 7f5b5b1b141..3de9bc65960 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 ea37a1e874f..50cc07ec424 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 00000000000..7f23a59e1c5
--- /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 00000000000..fdb865b6c32
--- /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 00000000000..7e24abcf6f6
--- /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 00000000000..4851229263b
--- /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 00000000000..fdb865b6c32
--- /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 00000000000..f0a67ebe105
--- /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 00000000000..69fc4aef147
--- /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 89896499476..4d532e2b649 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 00000000000..4d1d30b58b6
--- /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 00000000000..676c0503e37
--- /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 0653a9025ef..31015b7ff4e 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 00000000000..5fb97329274
--- /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 00000000000..1cf8f0ab899
--- /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 15a27efccaf..764dad5e9a4 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 00000000000..dd5c6175008
--- /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 5f55ba23c4d..45c1e395be0 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 95d4c8f6b4a..c9480e42c3a 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 19285542064..b4e7d92295e 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 5085b6b4609..3926e3f88cc 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 cf40de4a0f5..2c454bcfcd8 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 2ce5c714db1..86d2f4844f4 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 9cfcde23d9c..29f98e4e129 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 b707fc5d46b..7137394a11b 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 9a0df845c5d..1625063426c 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 00000000000..d5cc0b77735
--- /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 3593291fdb2..7104057f55f 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 00000000000..463142c713f
--- /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 00000000000..b19940abe31
--- /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 00000000000..cda96c9ac3d
--- /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 00000000000..b8f9e5be4e4
--- /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 00000000000..d9472dcc7b6
--- /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 00000000000..3c24250cf63
--- /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 b5dc03a804c..622b5fb5c39 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 00000000000..3f9e697fc06
--- /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 00000000000..6dcc0a59954
--- /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 cb33fd8279b..01d898e8806 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 00000000000..7a3b4167a3b
--- /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 bf7a3fe7315..6b87f8acb07 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 88ec007b237..c67dc9cb5da 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 e0c1fbc6a87..1af8164565d 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 0cb17969d4f..f86cbe219c4 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 808994ac561..114d1f13924 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/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/3-Babel-AST.shot
index 098a19b4d7f..1e4827fc528 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/external-module-ref-string/snapshots/3-Babel-AST.shot
@@ -46,7 +46,7 @@ Program {
},
},
],
- sourceType: "script",
+ sourceType: "module",
range: [0, 27],
loc: {
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 864ce14bb37..abd647535f7 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 {
@@ -50,8 +52,7 @@ exports[`AST Fixtures declaration TSImportEqualsDeclaration external-module-ref-
},
},
],
-- sourceType: 'module',
-+ sourceType: 'script',
+ sourceType: 'module',
range: [0, 27],
loc: {
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts
index d4db9a64168..15fd64f11ad 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 00000000000..c6b88c003fb
--- /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 00000000000..a9513b747ea
--- /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 00000000000..de2011df9ce
--- /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 00000000000..fb137780f45
--- /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 00000000000..a9513b747ea
--- /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 00000000000..6018ccd90e0
--- /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 00000000000..12baf6e0738
--- /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 128274dff58..ab7e5c43958 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 00000000000..6caba1ae72c
--- /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 00000000000..add92930a37
--- /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 00000000000..6eb1bf9104f
--- /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 00000000000..e06bfcc1a1c
--- /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 d640ad78d53..2c69569d0fe 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 00000000000..bbce8c51c4d
--- /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 00000000000..936edbec8c8
--- /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 00000000000..5846179dd56
--- /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 00000000000..e7b584a9cd2
--- /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 00000000000..c429168c288
--- /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 00000000000..64f544addb3
--- /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 7b6a2f0a666..4c5a9b4b098 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 00000000000..5470a1ec04e
--- /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 00000000000..69166a9fa11
--- /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 e48629574cf..b84a281982b 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 00000000000..5f1be010c62
--- /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 70ec89ee02e..97c82621d04 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 c5bfaba693b..f283ed85e49 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 35856879162..4c78898903e 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 42bc3c4eb68..81a856aecb1 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 98cd5c06786..9486b7754d6 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 793c00b7e98..5a1f33b4a95 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 a9113c856a8..d05004fd0b0 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 fe6cf12f1a5..a33d62920a1 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 cb387218512..81de6defaa5 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 4b1dec3a269..d9d73d0a5b5 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 f3ce068e927..4d08ac3f08a 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 8470b26ba84..b32db7edb88 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 1438312b63c..9ea6e2ce08f 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 8e0b58b2efe..63acdce107d 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 a75c769daf9..9a35efc7c15 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 00000000000..9848b6e55cd
--- /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 082a7d854c2..60094efbe41 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 00000000000..1ed7cf1aba5
--- /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 00000000000..c7c0b7ca1d4
--- /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 0a8a833a27a..d6c0dfba3f3 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 00000000000..f8381f6dde3
--- /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 00000000000..0cc4df30bc5
--- /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 6a1c0b8eebf..a3fd19de9bd 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 00000000000..62ff96dfe97
--- /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 00000000000..3dc7480d32a
--- /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 bdb99cfb914..d390e8f8ba9 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 00000000000..354b7482759
--- /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 00000000000..be52f2461a2
--- /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 3fbcf961cfa..c857310223a 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 00000000000..1a3abc42ed7
--- /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 00000000000..4e9e941de86
--- /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 33a26d312ca..d01edfb1d18 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 00000000000..2c9165727c1
--- /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 620efabfacd..3741aeb7940 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 5dc4161ad9a..9fcac3c8efd 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 d24ddaae90d..e712b655ec3 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 46729a48255..177d41ec23b 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 ac074fe5c98..125af1ea1c7 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 75dd7304dfa..3fc7f8b34f9 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 7f00836de0d..4d0056f41a9 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 36a5fb1365f..433612e4520 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 4017d7afc49..d0488ece67a 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 66e35bee13d..e28f27ef39a 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 abf76fd1619..70ecf48cc22 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 9c2311d4b6f..ade25ba03e2 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 00000000000..26936650860
--- /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 49ee11415db..5d292ad1879 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 00000000000..374070330ed
--- /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 48f1c28a6f6..9e710ee89f4 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 00000000000..2e47480e044
--- /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 86b030f02fd..5b2c8774fa9 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 00000000000..1fb07e00228
--- /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 1d16afdfbbb..eeadb154ca4 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 ec61e55c1a6..b7deac52f60 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 5a99e367a51..b3800ab8096 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 00000000000..e4db463ec8f
--- /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 00000000000..ad7361c18b2
--- /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 00000000000..bb31b17d363
--- /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 00000000000..f778aa86d3a
--- /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 00000000000..8f26fcfe867
--- /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 00000000000..47d7105c32d
--- /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 fd832b249e4..657e47e2dc1 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 00000000000..aa16edb5ae5
--- /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 00000000000..8626f6f94c5
--- /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 00000000000..5591f2e7a89
--- /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 00000000000..088cae325e5
--- /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 00000000000..be52f742f11
--- /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 00000000000..c2b715d7443
--- /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 00000000000..f0ac1cd2c04
--- /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 3afa8aee8c6..97319591f9e 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 00000000000..300850581d6
--- /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 e47c9aa7c25..904fa17bbda 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 00000000000..0b5d774603f
--- /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 00000000000..f2641cc64de
--- /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 3e11b470029..54f1d45efe4 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 00000000000..defe8a17bba
--- /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 8fd4754eac4..766421336b4 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 6cd11e1f4b3..21c15688f30 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 00000000000..8c24b75c66c
--- /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 00000000000..635e4f5a1cf
--- /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 00000000000..1392b9b0742
--- /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 00000000000..43ad98f601b
--- /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 00000000000..635e4f5a1cf
--- /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 00000000000..f99acadf19a
--- /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 00000000000..b18ec532458
--- /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 00000000000..99587163b89
--- /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 00000000000..f7c419205f7
--- /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 7eaf3f0bba4..dc83090da35 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 00000000000..7ccef6da61f
--- /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 00000000000..bb7b44f3afe
--- /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 b11bc95c96d..eb6164b79a2 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 00000000000..ad412071cc1
--- /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 9c87ddf606f..636050c43af 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 890509a8dcb..253e63408e6 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 34001d72f46..42782e8b3a3 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 939521199a6..9bfe5c01694 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 afaff66bb43..1dbed91e698 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 9ea3fc2ca74..b6e1bc8938a 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 9e3c3e98eeb..5d3c83b6631 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 9cc16a451ec..fe331054c0f 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 15ab0a40c13..6d7232344b2 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 00000000000..8c24b75c66c
--- /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 00000000000..6dbe967b047
--- /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 00000000000..fb0803d0ca0
--- /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 00000000000..27f74be3902
--- /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 00000000000..6dbe967b047
--- /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 00000000000..2076158e5e7
--- /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 00000000000..5e6f7bc3288
--- /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 3f61a7ec4bd..a644ecb1372 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 00000000000..830f2f4e93c
--- /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 00000000000..7a42d0e079b
--- /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 6537d529262..dedcabc0bbf 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 00000000000..cd2401b6862
--- /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 cd2401b6862..89f5785e4c7 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 00000000000..c53e6c27952
--- /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 00000000000..18d3755b6a4
--- /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 00000000000..318ceeec614
--- /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 00000000000..5ce744c9338
--- /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 00000000000..18d3755b6a4
--- /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 00000000000..8ff6adabf68
--- /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 c59f8219bb5..0bf57620c6e 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 65c9ece0d43..d997027ffab 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 f8e86b5f8ba..0c7705ede31 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 56007597c38..077480be9fd 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 8ea6a51268d..a60c9f86f53 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 005dc078e1d..87e680ef9a2 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 227feb50980..9795f20c91c 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 2697799a415..b275669e12a 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 d8d3f10c6e7..0374c31feb5 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 8082a31f808..7df64b552f6 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 7b317b58121..569b7e4d6b3 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 10b9167907c..f7e6ff872f0 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 dd577b588de..a0dc5de12b9 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 b107c9499d4..f9ec50b22b4 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 384ae11b364..9c8cd46cb97 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 b8594239a06..af47a7b5819 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 4bc9b0f4854..70ed40f52e6 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 00000000000..f314b35255b
--- /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 00000000000..77e891766df
--- /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 00000000000..4e826d92c94
--- /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 00000000000..f314b35255b
--- /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 00000000000..f248419e4f7
--- /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 00000000000..de0095c3531
--- /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 00000000000..24fbc900989
--- /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 00000000000..8fc5278de62
--- /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 00000000000..7e77cd5d46e
--- /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 00000000000..24fbc900989
--- /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 00000000000..137837e3e8f
--- /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 00000000000..071d521919f
--- /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 00000000000..27d6eef74b0
--- /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 5dc28758b4e..673c8d7991f 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 8545a8f1b73..2ecff14d0fc 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 897c1151ab2..a208741af8b 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 d26beba1271..63474559676 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 4a6b377b092..97f643020bd 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 b6b30dd18c6..32c9bea08d3 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 2b3269d8cd0..903c3ee2140 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 bd3b115af80..f4e4e3be0f2 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 b19f7768a48..1ea0bf7cc10 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 0cbe6bb62c4..580ab471f03 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 e69de29bb2d..5dc28758b4e 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 c1024f11503..0d55a562b17 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 ec11bb8381d..b4eb3d8a715 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 96f034cf05c..a0583eeb7cf 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 0a1c0c86992..599d99fb007 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 55fd7a3d475..632c9be206b 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 26abb22016e..d3096826ba0 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 100c519c06c..78ff86db859 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 808470d5b6a..1a96d899ee8 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 0cc093d094f..8534f85e05c 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 2afc4cac40a..9b9176fa61e 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 1d213162cd9..1f5f801f0a0 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 b3c3aa19fab..4f18e3e3172 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 79f2d5ffd63..fa04c5159f0 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 75bdc0edd24..00000000000
--- 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 52b20d04368..00000000000
--- 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 94c61988d3b..00000000000
--- 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 ee7c1781984..00000000000
--- 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 27b36ea8b18..00000000000
--- 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 41f1a89bdc7..4bb778c38dd 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 cecb46eb91f..b5860513edf 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 c16fab78a95..8ca9138a75c 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 76e4314a3c6..806a8428363 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 105774fea63..22e205327b3 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 7949a056f9a..4586e088951 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 0ee458fa617..c24e007d6eb 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 fd302779cf1..d3111bb3ed9 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 8dd908291b3..9a3c69f5795 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 c26ec2b5985..821908cd72a 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 375fcf037db..1143bdf8ab3 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 9eb4ac8ef9b..b5c95aa7471 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 1f6d0b40e2d..926da373f7d 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 7f48bba2e58..1b4e86bf4f6 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 2e8ce280183..2aadec8144a 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 c5c6c8589ee..1786d890224 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 7ee5d769dd2..8caab469b2c 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 b08e790e91d..000f205df51 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 e127d4593df..52315ed9439 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 0bc31a58020..e676e4e254e 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 a1e4c4fac77..4941754c2d0 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 d5ff97f0998..92b38783bb6 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 6d4fd50a3c3..7ddb1aff409 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 a0d4ea6a1c6..429343b6582 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 c96a7a26e37..e10b6b46435 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 97d8e49fcd9..9dd1ddeee69 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 38002bec295..4f514e75714 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 5ca7cbead3e..9f75ee603c9 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 a3f91ac2680..e695085ca40 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 347ee854137..8532636554a 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 00000000000..b19373f54d2
--- /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 fa43c88bcf5..d42f1d4e77f 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 bd71773a1be..b7569c9892e 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 dfe6c0d1b41..dbd4936f67c 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 384922a061a..d18ba7b9b99 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 00000000000..b91b27f0f8f
--- /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 00000000000..3cdc1c9783c
--- /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 00000000000..a18d1fd05d6
--- /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 00000000000..69fd583b79f
--- /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 00000000000..3cdc1c9783c
--- /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 00000000000..69fd583b79f
--- /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 00000000000..6f375fea965
--- /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 00000000000..8b27d717875
--- /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 00000000000..b76c8be6e53
--- /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 00000000000..a767b5a6468
--- /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 00000000000..8b27d717875
--- /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 00000000000..a767b5a6468
--- /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 1ee93ef507d..51aea284158 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 00000000000..876119b3990
--- /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 00000000000..71aabcc7954
--- /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 00000000000..16431b24f4d
--- /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 00000000000..d2dd4f91eab
--- /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 00000000000..71aabcc7954
--- /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 00000000000..bc5201f9cee
--- /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 00000000000..433743dbdf0
--- /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 00000000000..83750d60313
--- /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 00000000000..d5072a95357
--- /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 00000000000..cb8ca32066b
--- /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 00000000000..83750d60313
--- /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 00000000000..37626ca0238
--- /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 00000000000..7f9318e62fd
--- /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 00000000000..340728334fd
--- /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 00000000000..b775e8717cb
--- /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 00000000000..7691ccccd84
--- /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 00000000000..340728334fd
--- /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 00000000000..21d1ea67346
--- /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 c0a9f9fd99b..064dd30612f 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 bd2b5ff603e..4fa6709d6a5 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 0d7d689095e..c3381385760 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 6b30696c30b..44e6ea89118 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 a35b55978ba..b8284df201f 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 190beb7c0dd..725f2226368 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 45e35dfc272..8d2c36f9f1a 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 680a51ad16a..40146d0cb3a 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 c167cbcb46b..caa4c4e0517 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 0775d6c2219..64e87002566 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 8e025552275..edf9cfe837c 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 0c9eb9f1468..cc7c01444f0 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 eb993d611eb..9d2bc98de48 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 06455ebe104..ba8636aaab2 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 a21b35204c9..7d464b640eb 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 1ffb8d1525b..98075319cc3 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 28594822212..d616143c031 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 b7726f7f140..ec7b71c8e2b 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 8dbdf850e40..8dd52c055f8 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 f6e62fda8a7..f7f9d748d61 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 59da487f065..d0798a51c94 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 1aa182f5d2d..04ef14bf645 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 bad308efe92..fe43005e4eb 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 b7726f7f140..ec7b71c8e2b 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 c73bf6bd05d..33b08222c86 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 18e9568f78b..a022fc363e0 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 0131efff0cb..3ea078f4e99 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 319139b4a84..a1d5ac276a7 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 982ccda73a2..add1ea89b36 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 e3438484d9d..b673ca5f0db 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 1f07e4f78e3..00c64731e73 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 ba9ee680000..3ca95ed6417 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
new file mode 100644
index 00000000000..2bb647ef340
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx
@@ -0,0 +1,11 @@
+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
new file mode 100644
index 00000000000..ba010bda2df
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,323 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component-dashed TSESTree - AST 1`] = `
+Program {
+ type: "Program",
+ body: [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: [
+ 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: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ 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: 23, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+
+ range: [91, 96],
+ loc: {
+ start: { column: 21, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+
+ range: [74, 97],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 27, line: 4 },
+ },
+ },
+ ],
+
+ 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: [36, 53],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
+ },
+ },
+
+ range: [26, 101],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 5 },
+ },
+ },
+ ],
+
+ range: [22, 103],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ declare: true,
+ global: false,
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "JSX",
+ optional: false,
+
+ range: [18, 21],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+ kind: "namespace",
+
+ range: [0, 103],
+ loc: {
+ start: { column: 0, line: 1 },
+ 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 {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ definite: false,
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "componentDashed",
+ optional: false,
+
+ range: [323, 338],
+ loc: {
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [],
+ name: JSXNamespacedName {
+ type: "JSXNamespacedName",
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "baz-bam",
+
+ range: [350, 357],
+ loc: {
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
+ },
+ },
+ namespace: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "foo-bar",
+
+ range: [342, 349],
+ loc: {
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
+ },
+ },
+
+ range: [342, 357],
+ loc: {
+ start: { column: 25, line: 11 },
+ end: { column: 40, line: 11 },
+ },
+ },
+ selfClosing: true,
+
+ range: [341, 360],
+ loc: {
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+
+ range: [341, 360],
+ loc: {
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+
+ range: [323, 360],
+ loc: {
+ start: { column: 6, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+ ],
+ declare: false,
+ kind: "const",
+
+ range: [317, 361],
+ loc: {
+ start: { column: 0, line: 11 },
+ end: { column: 44, line: 11 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 362],
+ loc: {
+ start: { column: 0, line: 1 },
+ 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
new file mode 100644
index 00000000000..7d73f939d7a
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,356 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component-dashed TSESTree - Tokens 1`] = `
+[
+ 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: "JSX",
+
+ 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 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "interface",
+
+ range: [26, 35],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 11, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "IntrinsicElements",
+
+ range: [36, 53],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ 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: 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: [74, 91],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [91, 92],
+ loc: {
+ start: { column: 21, line: 4 },
+ end: { column: 22, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "any",
+
+ range: [93, 96],
+ loc: {
+ start: { column: 23, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [96, 97],
+ loc: {
+ start: { column: 26, line: 4 },
+ end: { column: 27, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [100, 101],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 3, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ 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: 30, line: 9 },
+ end: { column: 31, line: 9 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [317, 322],
+ loc: {
+ start: { column: 0, line: 11 },
+ end: { column: 5, line: 11 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "componentDashed",
+
+ range: [323, 338],
+ loc: {
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [339, 340],
+ loc: {
+ start: { column: 22, line: 11 },
+ end: { column: 23, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [341, 342],
+ loc: {
+ start: { column: 24, line: 11 },
+ end: { column: 25, line: 11 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "foo-bar",
+
+ range: [342, 349],
+ loc: {
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [349, 350],
+ loc: {
+ start: { column: 32, line: 11 },
+ end: { column: 33, line: 11 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "baz-bam",
+
+ range: [350, 357],
+ loc: {
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [358, 359],
+ loc: {
+ start: { column: 41, line: 11 },
+ end: { column: 42, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [359, 360],
+ loc: {
+ start: { column: 42, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [360, 361],
+ loc: {
+ 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
new file mode 100644
index 00000000000..e065c2a0f7f
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/3-Babel-AST.shot
@@ -0,0 +1,299 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component-dashed Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: [
+ TSModuleDeclaration {
+ type: "TSModuleDeclaration",
+ body: TSModuleBlock {
+ type: "TSModuleBlock",
+ body: [
+ 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: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ 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: 23, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+
+ range: [91, 96],
+ loc: {
+ start: { column: 21, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+
+ range: [74, 97],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 27, line: 4 },
+ },
+ },
+ ],
+
+ range: [54, 101],
+ loc: {
+ start: { column: 30, line: 2 },
+ end: { column: 3, line: 5 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "IntrinsicElements",
+
+ range: [36, 53],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
+ },
+ },
+
+ range: [26, 101],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 5 },
+ },
+ },
+ ],
+
+ range: [22, 103],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ declare: true,
+ id: Identifier {
+ type: "Identifier",
+ name: "JSX",
+
+ range: [18, 21],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+
+ range: [0, 103],
+ loc: {
+ start: { column: 0, line: 1 },
+ 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 {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ id: Identifier {
+ type: "Identifier",
+ name: "componentDashed",
+
+ range: [323, 338],
+ loc: {
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [],
+ name: JSXNamespacedName {
+ type: "JSXNamespacedName",
+ name: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "baz-bam",
+
+ range: [350, 357],
+ loc: {
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
+ },
+ },
+ namespace: JSXIdentifier {
+ type: "JSXIdentifier",
+ name: "foo-bar",
+
+ range: [342, 349],
+ loc: {
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
+ },
+ },
+
+ range: [342, 357],
+ loc: {
+ start: { column: 25, line: 11 },
+ end: { column: 40, line: 11 },
+ },
+ },
+ selfClosing: true,
+
+ range: [341, 360],
+ loc: {
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+
+ range: [341, 360],
+ loc: {
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+
+ range: [323, 360],
+ loc: {
+ start: { column: 6, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+ ],
+ kind: "const",
+
+ range: [317, 361],
+ loc: {
+ start: { column: 0, line: 11 },
+ end: { column: 44, line: 11 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 362],
+ loc: {
+ start: { column: 0, line: 1 },
+ 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
new file mode 100644
index 00000000000..80a517390c0
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,356 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component-dashed Babel - Tokens 1`] = `
+[
+ 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: "JSX",
+
+ 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 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "interface",
+
+ range: [26, 35],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 11, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "IntrinsicElements",
+
+ range: [36, 53],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ 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: 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: [74, 91],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [91, 92],
+ loc: {
+ start: { column: 21, line: 4 },
+ end: { column: 22, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "any",
+
+ range: [93, 96],
+ loc: {
+ start: { column: 23, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [96, 97],
+ loc: {
+ start: { column: 26, line: 4 },
+ end: { column: 27, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [100, 101],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 3, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ 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: 30, line: 9 },
+ end: { column: 31, line: 9 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [317, 322],
+ loc: {
+ start: { column: 0, line: 11 },
+ end: { column: 5, line: 11 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "componentDashed",
+
+ range: [323, 338],
+ loc: {
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [339, 340],
+ loc: {
+ start: { column: 22, line: 11 },
+ end: { column: 23, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [341, 342],
+ loc: {
+ start: { column: 24, line: 11 },
+ end: { column: 25, line: 11 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "foo-bar",
+
+ range: [342, 349],
+ loc: {
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [349, 350],
+ loc: {
+ start: { column: 32, line: 11 },
+ end: { column: 33, line: 11 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "baz-bam",
+
+ range: [350, 357],
+ loc: {
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [358, 359],
+ loc: {
+ start: { column: 41, line: 11 },
+ end: { column: 42, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [359, 360],
+ loc: {
+ start: { column: 42, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [360, 361],
+ loc: {
+ 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
new file mode 100644
index 00000000000..eb7b0cfaf14
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/5-AST-Alignment-AST.shot
@@ -0,0 +1,327 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component-dashed AST Alignment - AST 1`] = `
+"Snapshot Diff:
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSModuleDeclaration {
+ type: 'TSModuleDeclaration',
+ body: TSModuleBlock {
+ type: 'TSModuleBlock',
+ 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: [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: 9, line: 3 },
+ end: { column: 12, line: 3 },
+ },
+ },
+
+ 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: 23, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+
+ range: [91, 96],
+ loc: {
+ start: { column: 21, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+
+ range: [74, 97],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 27, line: 4 },
+ },
+ },
+ ],
+
+ 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: [36, 53],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
+ },
+ },
+
+ range: [26, 101],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 5 },
+ },
+ },
+ ],
+
+ range: [22, 103],
+ loc: {
+ 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: [18, 21],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 21, line: 1 },
+ },
+ },
+- kind: 'namespace',
+
+ range: [0, 103],
+ loc: {
+ start: { column: 0, line: 1 },
+ 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 {
+ type: 'VariableDeclaration',
+ declarations: Array [
+ VariableDeclarator {
+ type: 'VariableDeclarator',
+- definite: false,
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'componentDashed',
+- optional: false,
+
+ range: [323, 338],
+ loc: {
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
+ },
+ },
+ init: JSXElement {
+ type: 'JSXElement',
+ children: Array [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: 'JSXOpeningElement',
+ attributes: Array [],
+ name: JSXNamespacedName {
+ type: 'JSXNamespacedName',
+ name: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'baz-bam',
+
+ range: [350, 357],
+ loc: {
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
+ },
+ },
+ namespace: JSXIdentifier {
+ type: 'JSXIdentifier',
+ name: 'foo-bar',
+
+ range: [342, 349],
+ loc: {
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
+ },
+ },
+
+ range: [342, 357],
+ loc: {
+ start: { column: 25, line: 11 },
+ end: { column: 40, line: 11 },
+ },
+ },
+ selfClosing: true,
+
+ range: [341, 360],
+ loc: {
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+
+ range: [341, 360],
+ loc: {
+ start: { column: 24, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+
+ range: [323, 360],
+ loc: {
+ start: { column: 6, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+ ],
+- declare: false,
+ kind: 'const',
+
+ range: [317, 361],
+ loc: {
+ start: { column: 0, line: 11 },
+ end: { column: 44, line: 11 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 362],
+ loc: {
+ start: { column: 0, line: 1 },
+ 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
new file mode 100644
index 00000000000..bae78f1bc5c
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component-dashed/snapshots/6-AST-Alignment-Tokens.shot
@@ -0,0 +1,366 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component-dashed AST Alignment - Token 1`] = `
+"Snapshot Diff:
+- TSESTree
++ Babel
+
+ 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: 'JSX',
+
+ 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 },
+ },
+ },
+- Keyword {
+- type: 'Keyword',
++ Identifier {
++ type: 'Identifier',
+ value: 'interface',
+
+ range: [26, 35],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 11, line: 2 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'IntrinsicElements',
+
+ range: [36, 53],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 29, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ 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: 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: [74, 91],
+ loc: {
+ start: { column: 4, line: 4 },
+ end: { column: 21, line: 4 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [91, 92],
+ loc: {
+ start: { column: 21, line: 4 },
+ end: { column: 22, line: 4 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'any',
+
+ range: [93, 96],
+ loc: {
+ start: { column: 23, line: 4 },
+ end: { column: 26, line: 4 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [96, 97],
+ loc: {
+ start: { column: 26, line: 4 },
+ end: { column: 27, line: 4 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [100, 101],
+ loc: {
+ start: { column: 2, line: 5 },
+ end: { column: 3, line: 5 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ 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: 30, line: 9 },
+ end: { column: 31, line: 9 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'const',
+
+ range: [317, 322],
+ loc: {
+ start: { column: 0, line: 11 },
+ end: { column: 5, line: 11 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'componentDashed',
+
+ range: [323, 338],
+ loc: {
+ start: { column: 6, line: 11 },
+ end: { column: 21, line: 11 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [339, 340],
+ loc: {
+ start: { column: 22, line: 11 },
+ end: { column: 23, line: 11 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [341, 342],
+ loc: {
+ start: { column: 24, line: 11 },
+ end: { column: 25, line: 11 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
++ JSXIdentifier {
++ type: 'JSXIdentifier',
+ value: 'foo-bar',
+
+ range: [342, 349],
+ loc: {
+ start: { column: 25, line: 11 },
+ end: { column: 32, line: 11 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [349, 350],
+ loc: {
+ start: { column: 32, line: 11 },
+ end: { column: 33, line: 11 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
++ JSXIdentifier {
++ type: 'JSXIdentifier',
+ value: 'baz-bam',
+
+ range: [350, 357],
+ loc: {
+ start: { column: 33, line: 11 },
+ end: { column: 40, line: 11 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '/',
+
+ range: [358, 359],
+ loc: {
+ start: { column: 41, line: 11 },
+ end: { column: 42, line: 11 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [359, 360],
+ loc: {
+ start: { column: 42, line: 11 },
+ end: { column: 43, line: 11 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [360, 361],
+ loc: {
+ start: { column: 43, line: 11 },
+ end: { column: 44, line: 11 },
+ },
+ },
+ ]"
+`;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx
new file mode 100644
index 00000000000..04117403f02
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx
@@ -0,0 +1,10 @@
+const x = ;
+const y = ;
+
+interface NamespacePropComponentProps {
+ "a:b": string;
+}
+
+function NamespacePropComponent(props: NamespacePropComponentProps) {
+ return {props["a:b"]}
;
+}
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
new file mode 100644
index 00000000000..71bbf93d494
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,509 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - AST 1`] = `
+Program {
+ type: "Program",
+ body: [
+ VariableDeclaration {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ definite: false,
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "x",
+ optional: false,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [
+ 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: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ definite: false,
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "y",
+ optional: false,
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [
+ 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: [
+ 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: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ 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: [
+ ReturnStatement {
+ type: "ReturnStatement",
+ argument: JSXElement {
+ type: "JSXElement",
+ children: [
+ JSXExpressionContainer {
+ type: "JSXExpressionContainer",
+ expression: MemberExpression {
+ type: "MemberExpression",
+ computed: true,
+ object: Identifier {
+ type: "Identifier",
+ decorators: [],
+ 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: [],
+ 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: [],
+ name: "NamespacePropComponent",
+ optional: false,
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ 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: {
+ 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/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 00000000000..9352a620aac
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,586 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = `
+[
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "x",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, 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 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "NamespacePropComponent",
+
+ range: [11, 33],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 33, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "a",
+
+ range: [34, 35],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 35, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [35, 36],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 36, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "b",
+
+ range: [36, 37],
+ loc: {
+ start: { column: 36, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [37, 38],
+ loc: {
+ start: { column: 37, line: 1 },
+ end: { column: 38, line: 1 },
+ },
+ },
+ JSXText {
+ type: "JSXText",
+ value: ""tight spacing"",
+
+ range: [38, 53],
+ loc: {
+ start: { column: 38, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [54, 55],
+ loc: {
+ start: { column: 54, line: 1 },
+ end: { column: 55, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [55, 56],
+ loc: {
+ start: { column: 55, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [56, 57],
+ loc: {
+ start: { column: 56, line: 1 },
+ end: { column: 57, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [58, 63],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "y",
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [66, 67],
+ loc: {
+ start: { column: 8, line: 2 },
+ end: { column: 9, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [68, 69],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 11, line: 2 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "NamespacePropComponent",
+
+ range: [69, 91],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 33, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "a",
+
+ range: [92, 93],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [94, 95],
+ loc: {
+ start: { column: 36, line: 2 },
+ end: { column: 37, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "b",
+
+ range: [96, 97],
+ loc: {
+ start: { column: 38, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [97, 98],
+ loc: {
+ start: { column: 39, line: 2 },
+ end: { column: 40, line: 2 },
+ },
+ },
+ JSXText {
+ type: "JSXText",
+ value: ""loose spacing"",
+
+ range: [98, 113],
+ loc: {
+ start: { column: 40, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [114, 115],
+ loc: {
+ start: { column: 56, line: 2 },
+ end: { column: 57, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [115, 116],
+ loc: {
+ start: { column: 57, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [116, 117],
+ loc: {
+ start: { column: 58, line: 2 },
+ end: { column: 59, line: 2 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "interface",
+
+ range: [119, 128],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponentProps",
+
+ range: [129, 156],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [157, 158],
+ loc: {
+ start: { column: 38, line: 4 },
+ end: { column: 39, line: 4 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""a:b"",
+
+ range: [163, 168],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [168, 169],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "string",
+
+ range: [170, 176],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [176, 177],
+ loc: {
+ start: { column: 17, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [178, 179],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "function",
+
+ range: [181, 189],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 8, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponent",
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [212, 213],
+ loc: {
+ start: { column: 31, line: 8 },
+ end: { column: 32, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "props",
+
+ range: [213, 218],
+ loc: {
+ start: { column: 32, line: 8 },
+ end: { column: 37, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [218, 219],
+ loc: {
+ start: { column: 37, line: 8 },
+ end: { column: 38, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponentProps",
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [247, 248],
+ loc: {
+ start: { column: 66, line: 8 },
+ end: { column: 67, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [249, 250],
+ loc: {
+ start: { column: 68, line: 8 },
+ end: { column: 69, line: 8 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "return",
+
+ range: [255, 261],
+ loc: {
+ start: { column: 4, line: 9 },
+ end: { column: 10, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [262, 263],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 12, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "div",
+
+ range: [263, 266],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 15, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [266, 267],
+ loc: {
+ start: { column: 15, line: 9 },
+ end: { column: 16, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [267, 268],
+ loc: {
+ start: { column: 16, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "props",
+
+ range: [268, 273],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [273, 274],
+ loc: {
+ start: { column: 22, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""a:b"",
+
+ range: [274, 279],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 28, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [279, 280],
+ loc: {
+ start: { column: 28, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [280, 281],
+ loc: {
+ start: { column: 29, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [281, 282],
+ loc: {
+ start: { column: 30, line: 9 },
+ end: { column: 31, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [282, 283],
+ loc: {
+ start: { column: 31, line: 9 },
+ end: { column: 32, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "div",
+
+ range: [283, 286],
+ loc: {
+ start: { column: 32, line: 9 },
+ end: { column: 35, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [286, 287],
+ loc: {
+ start: { column: 35, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [287, 288],
+ loc: {
+ start: { column: 36, line: 9 },
+ end: { column: 37, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [289, 290],
+ loc: {
+ start: { column: 0, line: 10 },
+ end: { column: 1, line: 10 },
+ },
+ },
+]
+`;
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/3-Babel-AST.shot
new file mode 100644
index 00000000000..7582f7301e5
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/3-Babel-AST.shot
@@ -0,0 +1,485 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component Babel - AST 1`] = `
+Program {
+ type: "Program",
+ body: [
+ VariableDeclaration {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ id: Identifier {
+ type: "Identifier",
+ name: "x",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [
+ 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 },
+ },
+ },
+ ],
+ kind: "const",
+
+ range: [0, 57],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 57, line: 1 },
+ },
+ },
+ VariableDeclaration {
+ type: "VariableDeclaration",
+ declarations: [
+ VariableDeclarator {
+ type: "VariableDeclarator",
+ id: Identifier {
+ type: "Identifier",
+ name: "y",
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ init: JSXElement {
+ type: "JSXElement",
+ children: [],
+ closingElement: null,
+ openingElement: JSXOpeningElement {
+ type: "JSXOpeningElement",
+ attributes: [
+ 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 },
+ },
+ },
+ ],
+ kind: "const",
+
+ range: [58, 117],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 59, line: 2 },
+ },
+ },
+ TSInterfaceDeclaration {
+ type: "TSInterfaceDeclaration",
+ body: TSInterfaceBody {
+ type: "TSInterfaceBody",
+ body: [
+ 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 },
+ },
+ },
+ 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 },
+ },
+ },
+ id: Identifier {
+ type: "Identifier",
+ name: "NamespacePropComponentProps",
+
+ 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: [
+ ReturnStatement {
+ type: "ReturnStatement",
+ argument: JSXElement {
+ type: "JSXElement",
+ children: [
+ JSXExpressionContainer {
+ type: "JSXExpressionContainer",
+ expression: MemberExpression {
+ type: "MemberExpression",
+ computed: true,
+ object: Identifier {
+ type: "Identifier",
+ name: "props",
+
+ 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: [],
+ 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 },
+ },
+ },
+ expression: false,
+ generator: false,
+ id: Identifier {
+ type: "Identifier",
+ name: "NamespacePropComponent",
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ params: [
+ Identifier {
+ type: "Identifier",
+ name: "props",
+ typeAnnotation: TSTypeAnnotation {
+ type: "TSTypeAnnotation",
+ typeAnnotation: TSTypeReference {
+ type: "TSTypeReference",
+ typeName: Identifier {
+ type: "Identifier",
+ name: "NamespacePropComponentProps",
+
+ 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/JSXNamespacedName/fixtures/component/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 00000000000..afdd8792c20
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,586 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = `
+[
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "x",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, 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 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "NamespacePropComponent",
+
+ range: [11, 33],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 33, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "a",
+
+ range: [34, 35],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 35, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [35, 36],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 36, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "b",
+
+ range: [36, 37],
+ loc: {
+ start: { column: 36, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [37, 38],
+ loc: {
+ start: { column: 37, line: 1 },
+ end: { column: 38, line: 1 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""tight spacing"",
+
+ range: [38, 53],
+ loc: {
+ start: { column: 38, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [54, 55],
+ loc: {
+ start: { column: 54, line: 1 },
+ end: { column: 55, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [55, 56],
+ loc: {
+ start: { column: 55, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [56, 57],
+ loc: {
+ start: { column: 56, line: 1 },
+ end: { column: 57, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "const",
+
+ range: [58, 63],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "y",
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [66, 67],
+ loc: {
+ start: { column: 8, line: 2 },
+ end: { column: 9, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [68, 69],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 11, line: 2 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "NamespacePropComponent",
+
+ range: [69, 91],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 33, line: 2 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "a",
+
+ range: [92, 93],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [94, 95],
+ loc: {
+ start: { column: 36, line: 2 },
+ end: { column: 37, line: 2 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "b",
+
+ range: [96, 97],
+ loc: {
+ start: { column: 38, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [97, 98],
+ loc: {
+ start: { column: 39, line: 2 },
+ end: { column: 40, line: 2 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""loose spacing"",
+
+ range: [98, 113],
+ loc: {
+ start: { column: 40, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [114, 115],
+ loc: {
+ start: { column: 56, line: 2 },
+ end: { column: 57, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [115, 116],
+ loc: {
+ start: { column: 57, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [116, 117],
+ loc: {
+ start: { column: 58, line: 2 },
+ end: { column: 59, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "interface",
+
+ range: [119, 128],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponentProps",
+
+ range: [129, 156],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [157, 158],
+ loc: {
+ start: { column: 38, line: 4 },
+ end: { column: 39, line: 4 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""a:b"",
+
+ range: [163, 168],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [168, 169],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "string",
+
+ range: [170, 176],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [176, 177],
+ loc: {
+ start: { column: 17, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [178, 179],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "function",
+
+ range: [181, 189],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 8, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponent",
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [212, 213],
+ loc: {
+ start: { column: 31, line: 8 },
+ end: { column: 32, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "props",
+
+ range: [213, 218],
+ loc: {
+ start: { column: 32, line: 8 },
+ end: { column: 37, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [218, 219],
+ loc: {
+ start: { column: 37, line: 8 },
+ end: { column: 38, line: 8 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "NamespacePropComponentProps",
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [247, 248],
+ loc: {
+ start: { column: 66, line: 8 },
+ end: { column: 67, line: 8 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [249, 250],
+ loc: {
+ start: { column: 68, line: 8 },
+ end: { column: 69, line: 8 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "return",
+
+ range: [255, 261],
+ loc: {
+ start: { column: 4, line: 9 },
+ end: { column: 10, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [262, 263],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 12, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "div",
+
+ range: [263, 266],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 15, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [266, 267],
+ loc: {
+ start: { column: 15, line: 9 },
+ end: { column: 16, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [267, 268],
+ loc: {
+ start: { column: 16, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "props",
+
+ range: [268, 273],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [273, 274],
+ loc: {
+ start: { column: 22, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""a:b"",
+
+ range: [274, 279],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 28, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [279, 280],
+ loc: {
+ start: { column: 28, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [280, 281],
+ loc: {
+ start: { column: 29, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "<",
+
+ range: [281, 282],
+ loc: {
+ start: { column: 30, line: 9 },
+ end: { column: 31, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "/",
+
+ range: [282, 283],
+ loc: {
+ start: { column: 31, line: 9 },
+ end: { column: 32, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: "JSXIdentifier",
+ value: "div",
+
+ range: [283, 286],
+ loc: {
+ start: { column: 32, line: 9 },
+ end: { column: 35, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ">",
+
+ range: [286, 287],
+ loc: {
+ start: { column: 35, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [287, 288],
+ loc: {
+ start: { column: 36, line: 9 },
+ end: { column: 37, line: 9 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [289, 290],
+ loc: {
+ start: { column: 0, line: 10 },
+ end: { column: 1, line: 10 },
+ },
+ },
+]
+`;
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
new file mode 100644
index 00000000000..45ffcb1a231
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot
@@ -0,0 +1,513 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = `
+"Snapshot Diff:
+- 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/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot
new file mode 100644
index 00000000000..2a72ccaf2fe
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot
@@ -0,0 +1,604 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] = `
+"Snapshot Diff:
+- TSESTree
++ Babel
+
+ Array [
+ Keyword {
+ type: 'Keyword',
+ value: 'const',
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'x',
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, 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 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'NamespacePropComponent',
+
+ range: [11, 33],
+ loc: {
+ start: { column: 11, line: 1 },
+ end: { column: 33, line: 1 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
++ JSXIdentifier {
++ type: 'JSXIdentifier',
+ value: 'a',
+
+ range: [34, 35],
+ loc: {
+ start: { column: 34, line: 1 },
+ end: { column: 35, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [35, 36],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 36, line: 1 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
++ JSXIdentifier {
++ type: 'JSXIdentifier',
+ value: 'b',
+
+ range: [36, 37],
+ loc: {
+ start: { column: 36, line: 1 },
+ end: { column: 37, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [37, 38],
+ loc: {
+ start: { column: 37, line: 1 },
+ end: { column: 38, line: 1 },
+ },
+ },
+- JSXText {
+- type: 'JSXText',
++ String {
++ type: 'String',
+ value: '"tight spacing"',
+
+ range: [38, 53],
+ loc: {
+ start: { column: 38, line: 1 },
+ end: { column: 53, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '/',
+
+ range: [54, 55],
+ loc: {
+ start: { column: 54, line: 1 },
+ end: { column: 55, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [55, 56],
+ loc: {
+ start: { column: 55, line: 1 },
+ end: { column: 56, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [56, 57],
+ loc: {
+ start: { column: 56, line: 1 },
+ end: { column: 57, line: 1 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'const',
+
+ range: [58, 63],
+ loc: {
+ start: { column: 0, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'y',
+
+ range: [64, 65],
+ loc: {
+ start: { column: 6, line: 2 },
+ end: { column: 7, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [66, 67],
+ loc: {
+ start: { column: 8, line: 2 },
+ end: { column: 9, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [68, 69],
+ loc: {
+ start: { column: 10, line: 2 },
+ end: { column: 11, line: 2 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'NamespacePropComponent',
+
+ range: [69, 91],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 33, line: 2 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
++ JSXIdentifier {
++ type: 'JSXIdentifier',
+ value: 'a',
+
+ range: [92, 93],
+ loc: {
+ start: { column: 34, line: 2 },
+ end: { column: 35, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [94, 95],
+ loc: {
+ start: { column: 36, line: 2 },
+ end: { column: 37, line: 2 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
++ JSXIdentifier {
++ type: 'JSXIdentifier',
+ value: 'b',
+
+ range: [96, 97],
+ loc: {
+ start: { column: 38, line: 2 },
+ end: { column: 39, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [97, 98],
+ loc: {
+ start: { column: 39, line: 2 },
+ end: { column: 40, line: 2 },
+ },
+ },
+- JSXText {
+- type: 'JSXText',
++ String {
++ type: 'String',
+ value: '"loose spacing"',
+
+ range: [98, 113],
+ loc: {
+ start: { column: 40, line: 2 },
+ end: { column: 55, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '/',
+
+ range: [114, 115],
+ loc: {
+ start: { column: 56, line: 2 },
+ end: { column: 57, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [115, 116],
+ loc: {
+ start: { column: 57, line: 2 },
+ end: { column: 58, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [116, 117],
+ loc: {
+ start: { column: 58, line: 2 },
+ end: { column: 59, line: 2 },
+ },
+ },
+- Keyword {
+- type: 'Keyword',
++ Identifier {
++ type: 'Identifier',
+ value: 'interface',
+
+ range: [119, 128],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 9, line: 4 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'NamespacePropComponentProps',
+
+ range: [129, 156],
+ loc: {
+ start: { column: 10, line: 4 },
+ end: { column: 37, line: 4 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ range: [157, 158],
+ loc: {
+ start: { column: 38, line: 4 },
+ end: { column: 39, line: 4 },
+ },
+ },
+ String {
+ type: 'String',
+ value: '"a:b"',
+
+ range: [163, 168],
+ loc: {
+ start: { column: 4, line: 5 },
+ end: { column: 9, line: 5 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [168, 169],
+ loc: {
+ start: { column: 9, line: 5 },
+ end: { column: 10, line: 5 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'string',
+
+ range: [170, 176],
+ loc: {
+ start: { column: 11, line: 5 },
+ end: { column: 17, line: 5 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [176, 177],
+ loc: {
+ start: { column: 17, line: 5 },
+ end: { column: 18, line: 5 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [178, 179],
+ loc: {
+ start: { column: 0, line: 6 },
+ end: { column: 1, line: 6 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'function',
+
+ range: [181, 189],
+ loc: {
+ start: { column: 0, line: 8 },
+ end: { column: 8, line: 8 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'NamespacePropComponent',
+
+ range: [190, 212],
+ loc: {
+ start: { column: 9, line: 8 },
+ end: { column: 31, line: 8 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '(',
+
+ range: [212, 213],
+ loc: {
+ start: { column: 31, line: 8 },
+ end: { column: 32, line: 8 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'props',
+
+ range: [213, 218],
+ loc: {
+ start: { column: 32, line: 8 },
+ end: { column: 37, line: 8 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [218, 219],
+ loc: {
+ start: { column: 37, line: 8 },
+ end: { column: 38, line: 8 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'NamespacePropComponentProps',
+
+ range: [220, 247],
+ loc: {
+ start: { column: 39, line: 8 },
+ end: { column: 66, line: 8 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ')',
+
+ range: [247, 248],
+ loc: {
+ start: { column: 66, line: 8 },
+ end: { column: 67, line: 8 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ range: [249, 250],
+ loc: {
+ start: { column: 68, line: 8 },
+ end: { column: 69, line: 8 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'return',
+
+ range: [255, 261],
+ loc: {
+ start: { column: 4, line: 9 },
+ end: { column: 10, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [262, 263],
+ loc: {
+ start: { column: 11, line: 9 },
+ end: { column: 12, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'div',
+
+ range: [263, 266],
+ loc: {
+ start: { column: 12, line: 9 },
+ end: { column: 15, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [266, 267],
+ loc: {
+ start: { column: 15, line: 9 },
+ end: { column: 16, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ range: [267, 268],
+ loc: {
+ start: { column: 16, line: 9 },
+ end: { column: 17, line: 9 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'props',
+
+ range: [268, 273],
+ loc: {
+ start: { column: 17, line: 9 },
+ end: { column: 22, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '[',
+
+ range: [273, 274],
+ loc: {
+ start: { column: 22, line: 9 },
+ end: { column: 23, line: 9 },
+ },
+ },
+ String {
+ type: 'String',
+ value: '"a:b"',
+
+ range: [274, 279],
+ loc: {
+ start: { column: 23, line: 9 },
+ end: { column: 28, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ']',
+
+ range: [279, 280],
+ loc: {
+ start: { column: 28, line: 9 },
+ end: { column: 29, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [280, 281],
+ loc: {
+ start: { column: 29, line: 9 },
+ end: { column: 30, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [281, 282],
+ loc: {
+ start: { column: 30, line: 9 },
+ end: { column: 31, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '/',
+
+ range: [282, 283],
+ loc: {
+ start: { column: 31, line: 9 },
+ end: { column: 32, line: 9 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'div',
+
+ range: [283, 286],
+ loc: {
+ start: { column: 32, line: 9 },
+ end: { column: 35, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [286, 287],
+ loc: {
+ start: { column: 35, line: 9 },
+ end: { column: 36, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [287, 288],
+ loc: {
+ start: { column: 36, line: 9 },
+ end: { column: 37, line: 9 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [289, 290],
+ loc: {
+ start: { column: 0, line: 10 },
+ end: { column: 1, line: 10 },
+ },
+ },
+ ]"
+`;
diff --git a/packages/ast-spec/src/jsx/JSXOpeningElement/spec.ts b/packages/ast-spec/src/jsx/JSXOpeningElement/spec.ts
index 710fade02fa..1c4ca8af452 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 d8e74a7e7fa..a2a4ac63734 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 ef60deece6e..3e8af6cefa6 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 36589a0f64a..4073209596d 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 3235fe1f39e..2689d71f89b 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 d41b2280b54..01308cfc10d 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 41706b97b2e..3f92666a625 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 533cf3cde41..b2257234533 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 1ca322e0c3f..019fc0221c8 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 36cf688cf9d..27cde7cfb1d 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 681409dd0ec..0544e38863c 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 591f2b9207c..856ad229ef1 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 2567fb6d198..28879c1e23d 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 00000000000..365be7ab31e
--- /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 00000000000..fd0e954ee51
--- /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 00000000000..2015736a7f2
--- /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 00000000000..365be7ab31e
--- /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 00000000000..c2e76b6b75d
--- /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 00000000000..6c591d66392
--- /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 bb695d9a0b1..500f8130606 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 00000000000..37fb30a105a
--- /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 37fb30a105a..fc418fa8c4b 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 00000000000..e48b2228671
--- /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 8afa44f7c60..2c3eef0e00a 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 00000000000..6de99caccfc
--- /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 6de99caccfc..6afce871c92 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 00000000000..67e8635916b
--- /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 43e910b9175..c9a5983adf1 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 00000000000..15c7f73220a
--- /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 15c7f73220a..67a613a53ca 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 00000000000..6e36fa86066
--- /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 00000000000..e281e0edf2a
--- /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 00000000000..40321a29047
--- /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 00000000000..772471f96e2
--- /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 00000000000..e61bb7cf0b4
--- /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 00000000000..aa6535da513
--- /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 00000000000..721146dd0f0
--- /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 2eb5b884fbe..e685ce389b5 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 00000000000..1cc73e1213a
--- /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 1cc73e1213a..08681e3fc52 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 00000000000..61594867ce5
--- /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 4c840077279..66677cbe399 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 00000000000..8ca376cb924
--- /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 8ca376cb924..fe9a7f7eec3 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 00000000000..11599244d24
--- /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 4a14ecee200..54b7990c831 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 00000000000..588fc5dd036
--- /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 588fc5dd036..d5010c61e43 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 00000000000..060e140c20f
--- /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 00000000000..81cc16ee83c
--- /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 00000000000..203ef841fa3
--- /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 00000000000..a69ed0ed1cd
--- /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 00000000000..92ac5f9b3f8
--- /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 00000000000..9ab87939ed9
--- /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 00000000000..54dece81c98
--- /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 00000000000..b81dfe8ab3e
--- /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 00000000000..bf5d8d4312f
--- /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 00000000000..d0503e6badc
--- /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 00000000000..d16d6e9f798
--- /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 00000000000..a9ca6bf4e92
--- /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 00000000000..fb7591e2089
--- /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 00000000000..886a5e2d5b0
--- /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 00000000000..824f587f17a
--- /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 fda3178b272..db761981b7e 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 00000000000..d39bd1e45e7
--- /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 d39bd1e45e7..f863933783d 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 00000000000..613bd109cea
--- /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 00000000000..af2bc132861
--- /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 00000000000..86beac1b20b
--- /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 00000000000..3dcc38e0603
--- /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 517f8d05bce..00000000000
--- 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 efedccbc060..00000000000
--- 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 a53c2df0e58..00000000000
--- 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 a495e97a9ca..00000000000
--- 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 d6d511ccbfd..00000000000
--- 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 b5d33dfde11..00000000000
--- 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 7f16295a0ea..d9de87c19aa 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 cc059ebdd97..0ab1de91b9e 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 6c1840dc9e4..b8501ee7b5b 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 4989b7b35d1..4948c148db4 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 9fad85e674f..8fd60959945 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 c7d5ecccd10..ee46582f5bd 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 fd55179386c..a96aff8a977 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 e96ac30a3b5..74e0cfac27b 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 36e577536e3..391e52d7197 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 ea291f87cbe..b706fb052fb 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 a8f2d099a99..c1365d8d10e 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 a2123358d04..ef2f2ca4f2c 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 66dc57f9ca4..e11949b56e6 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 59f0d0c3ecd..54b416cc358 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 cfebc39d3f1..0ac4e6b2c8c 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 bebd2e1766f..84875d060dd 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 f48e3a53980..5343015ddd2 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 ca850e74214..bbd26b80e71 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 c86c5ea688a..c417079cd49 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 7f4ad90fdb0..4d9cc58af3a 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 a0bf4fc41ac..acff3916587 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 6db212a6049..cf09dbcceea 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 954ff56842f..e0143b85dbb 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 f37f21626eb..d97c7ec99c2 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 dae801b4eb5..6313e008f58 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 a60f0ce742c..98fb9a32021 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 0add00e20a1..9f701dde246 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 33b93128e07..2710a0bc202 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 2a7238338d7..0b739dd9aa9 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 5a48762a733..dcef318b25b 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 62a17423cc5..9c68eb96907 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 a4c620a74b8..70b1609db0f 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 a5279df235d..bbe6bf88a4f 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 38599adfe7f..7705dd06189 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 d18ab49c711..47510cad585 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 4b0c8c0b06b..d8af856f0d4 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 94188993637..77bae5e0fa4 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 2f9dfe1a235..a61cfb5f5e7 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 4fd32ac8851..2e62c98bccf 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 89b8eb95c59..9436e8fa208 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 dd4a2c148a6..dc30f9f96cf 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 ff4be300dbe..6aef5769b95 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 6658448bad0..ba043fdb916 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 c36526457e7..107bcb11f9a 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 cbb19722f69..025639ca14b 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 91ba03ff880..7b635aa1f26 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 9ecd4e56189..37b23ebcae1 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 50e07fdec6a..8db2a072d5d 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 321258d559b..6325a410ae2 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 4a94acfc12a..9a97960820e 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 3618d7741dc..b92ad626eef 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 c937657039c..ed9cb590a61 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 65e19032f44..f579822acb1 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 3e92199a42e..bb1a1c4bac1 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 24585ee1091..998b6207d4c 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 9c0ef5e4b1d..4f9a53a7ec5 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 e225d3f8406..dd0a87e7d3d 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 1fad65fb13d..e9cb84b1934 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 eb888a48f10..95679527f61 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 fa57caf9773..30ed3a5d2b9 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 142fe962316..468b1d834e1 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 15311f58669..23d2de9832a 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 6f873dd9552..a467ad9004b 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 66ba0b55662..07399bd45ca 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 463c5cde7de..7f5aeb6fee1 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 12dd36c717a..21ac2c6a3ca 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 52b855e6931..aec123dc3e0 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 bb0b1427d25..9345b10e985 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 cdbec66bb97..137500002d8 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 baf4e31b33b..1073c725f41 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 63825cb2349..3e3d64d818c 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 ac7c601b7ec..ba394f6be49 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 b6e4b7f8e22..88e4438bb06 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 e9e2c7244b2..e58c25fa024 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 6c852735c5a..952efb71175 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 d823b4570e5..ebf99595a80 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 da2c200699a..62bd5c01b74 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 41b0e58926b..9ac4c609f85 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 f50ed36f922..056cda75ff6 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 74cc49838e1..861c924cb00 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 9bf39dac158..c632c3a9afa 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 67f56c86370..cbb9b19f345 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 86ecdb4e040..76c8fca6626 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 8b3757898e9..cd6eeae54ca 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 6b695ed3a9e..b9bbc841343 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 f215d2b9478..18e0e9767af 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 e35887f9241..48529cb0405 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 b113f663f51..4d5c6677152 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 8763d72bcca..7fa804c7c58 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 e142bb454dc..6781e3075a2 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 1443a0bda66..8227bc871a4 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 27d8a0ad1e4..959f8eb28d3 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 f5565827c15..2c8c6549a92 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 9e3032b5695..d75b7e9bb3b 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 22254044fb9..9a03b50c7b0 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 47aa2d089f3..b581e542fbd 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 6abdce915ee..068063caace 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 bf276da33e3..c720da83ff5 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 6c360848e81..2197513374b 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 6d916c72d85..1d2e6f791ee 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 61da284abee..c45a39c6ed0 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 644f6e34e87..78cbdbf91c7 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 2345a59e245..136ce8c0a90 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 74230c6766a..69ea76bfb71 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 cc50481ad32..4f20f32c5f4 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 ff7c7f9bdd3..e4442ac9ee3 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 08731622aee..1b7cbd92319 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 bcee1481572..fb9a4cf2fd1 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 8c99f343cb7..b647ce5bec9 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 2994f248b8d..2e8c6d12881 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 08f9c25204a..9d750889329 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 74a8495047c..ad237190d0e 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 8730d2fe21c..6203a0e5ab6 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 ce5f1910bb7..44c167b1a1e 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 21c719fd677..a6f0867e59c 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 1db770be545..1ca1af2cf8a 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 ca701f29c92..e88857f9766 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 05e055f1868..f9625e1c3d8 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 bc32cf62cdc..5767b8e1490 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 83d18346975..d240107e797 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 ab0d61339b4..aad8bbe2661 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 d4ed8c5b153..cba6e4ec96d 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 2fc7b07e32f..5d3fe4d7fed 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 8a7308c52fc..8e9b7c04328 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 525ff8bf7da..6afdeed4fd3 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 51feccb1a78..3ca65220e22 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 ab799166a14..2db687cb7f9 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 7d0c4c30d1a..ac37aadfa0f 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 f85238b8cce..7d54f723e05 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 286d6f2f74f..ab61cdfdda6 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 0208520f6fc..2b65620857e 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 5dac5966e17..ccff1fdb997 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 65038c760f7..10dd0ffe1bd 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 ae08e0c3a91..55963364596 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 64289d39b27..5621e6238f0 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 c4b496ef856..d79e152fe48 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 a62db8717c4..d3082546601 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 004656cc596..c3df90d7c07 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 f289b977ef4..7c05eb3cdd1 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 983df429af0..27076dd3da2 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 00000000000..79bfb11b065
--- /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 034c7264069..548efbed006 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 00000000000..d3ffef96096
--- /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 75f2472ffbc..a087b50a382 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 de0b160d2c8..75537c0edbd 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 30c981d13d0..e2f15f25d11 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 91065f7d377..370da199472 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 2993c4da95d..58f3e3de323 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 85787e9178f..1b635af9404 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 aa1998499a4..7eb5256b921 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 8c71fbb0d3c..0445aaa8063 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/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/3-Babel-AST.shot
index 7f6c1be4872..53765d7d18d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-assignment/snapshots/3-Babel-AST.shot
@@ -24,7 +24,7 @@ Program {
},
},
],
- sourceType: "script",
+ sourceType: "module",
range: [73, 87],
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 06a9e4da38e..0b1e4523efb 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: {
@@ -28,8 +30,7 @@ exports[`AST Fixtures legacy-fixtures basics export-assignment AST Alignment - A
},
},
],
-- sourceType: 'module',
-+ sourceType: 'script',
+ sourceType: 'module',
range: [73, 87],
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 acd54640c92..f1169f5926c 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 5dced47878b..b3b73fdb401 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 1981d24b541..3b057de32f4 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 73d878a12ec..2d768bbf61b 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 f14b54d6f6f..02a82deb45f 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 64dc9ab9f6f..cac3d3b9bad 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 d89a9df30ad..5e0be290b4a 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 77a16a4302d..420e9c2ef19 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 8123d01f3ce..89ac186b96d 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 201605ce2b5..28434626438 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 7422a63cf75..937557783da 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 45815b0a978..cd249e319cc 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 2691f90e0a9..efc242f4dfd 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 cafef05a22f..122e2a3401f 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 0f3b8723891..cb3489f2b02 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 596d7bfe356..1471fe30127 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 db21ea31228..20335c1996f 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 b102f45164b..e6b5545d6af 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 4d3b0b70ad0..afa8b170882 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 8526243ea23..c9dea6f3214 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 d3ce9d5bfab..ddf7996e773 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 c56c283e493..0192033c168 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 4b41be24d98..4c12ca941c0 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 66480f7b11f..47d6b2af6f2 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 8cc6dd16978..017fb0f7bed 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 dca27176e25..b34ddb187f6 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 a517f7dd0c1..098ac45c234 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 5f19d6e96e4..48c04d40f70 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 e321751787b..cb7cfa02368 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 9fe3b48e456..98998cbaa44 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 3a08ae46217..7472805c426 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 76b94490a41..4af306c530c 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 cc8333d69f8..ea042f62a70 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 101a3738026..bb4bbd0d6a1 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 ceac643045d..0b4da9c4e48 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 d8a406bb7e9..9403dbbd2a9 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 fdcd9f2678e..79b756b9373 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 3f1b0bd4bc4..71841138211 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 d11b181c592..f6ea490cce3 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 c096db788aa..af719ee6a52 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 90107e35f6d..7335f353134 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 76444e06f3c..958d02dbd05 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 3bf1239b820..359f76eafd5 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 a47e9957bd9..efeb1329956 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 28a1cf6468a..989c307d098 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 71bd9bfc1f1..19856aa2f16 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 146b379f5ba..1e6617e87dc 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 9de6b201868..590df108c3b 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 dac7d52338c..fcd4699e4b3 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 cb8e3363dc5..30ab32a0a4f 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 66d593436f1..a536f4a1981 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/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/3-Babel-AST.shot
index 6787ff3d03c..05bcdb4eb26 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-declaration/snapshots/3-Babel-AST.shot
@@ -46,7 +46,7 @@ Program {
},
},
],
- sourceType: "script",
+ sourceType: "module",
range: [73, 102],
loc: {
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 9e99b2d139b..39420f9e369 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 {
@@ -50,8 +52,7 @@ exports[`AST Fixtures legacy-fixtures basics import-equal-declaration AST Alignm
},
},
],
-- sourceType: 'module',
-+ sourceType: 'script',
+ sourceType: 'module',
range: [73, 102],
loc: {
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 2c76c91d63b..f679d5877a0 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/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/3-Babel-AST.shot
index 1583d2ccfb7..9984261a972 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-equal-type-declaration/snapshots/3-Babel-AST.shot
@@ -46,7 +46,7 @@ Program {
},
},
],
- sourceType: "script",
+ sourceType: "module",
range: [73, 107],
loc: {
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 38dd0ac42d6..77adb8004d0 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 {
@@ -50,8 +52,7 @@ exports[`AST Fixtures legacy-fixtures basics import-equal-type-declaration AST A
},
},
],
-- sourceType: 'module',
-+ sourceType: 'script',
+ sourceType: 'module',
range: [73, 107],
loc: {
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 1f3bcfef849..0d8da7b441e 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/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/3-Babel-AST.shot
index 9705cc0221d..fade9373835 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-declaration/snapshots/3-Babel-AST.shot
@@ -46,7 +46,7 @@ Program {
},
},
],
- sourceType: "script",
+ sourceType: "module",
range: [73, 109],
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 a8124bb4264..51f7701bb76 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',
++ },
++ importKind: 'value',
++ isExport: true,
++ moduleReference: TSExternalModuleReference {
++ type: 'TSExternalModuleReference',
++ expression: Literal {
++ type: 'Literal',
++ raw: '\\'bar\\'',
++ value: 'bar',
- range: [101, 106],
+- range: [101, 106],
+- loc: {
+- start: { column: 28, line: 3 },
+- end: { column: 33, line: 3 },
+- },
+- },
+-
+- 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: {
@@ -50,8 +88,7 @@ exports[`AST Fixtures legacy-fixtures basics import-export-equal-declaration AST
},
},
],
-- sourceType: 'module',
-+ sourceType: 'script',
+ sourceType: 'module',
range: [73, 109],
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 a05c975eae4..a518cab77f4 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/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/3-Babel-AST.shot
index c048f7a5d9c..1f864c4f111 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/import-export-equal-type-declaration/snapshots/3-Babel-AST.shot
@@ -46,7 +46,7 @@ Program {
},
},
],
- sourceType: "script",
+ sourceType: "module",
range: [73, 114],
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 94fa819efc7..da9c9aa685e 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',
++ },
++ importKind: 'type',
++ isExport: true,
++ moduleReference: TSExternalModuleReference {
++ type: 'TSExternalModuleReference',
++ expression: Literal {
++ type: 'Literal',
++ raw: '\\'bar\\'',
++ value: 'bar',
- range: [106, 111],
+- range: [106, 111],
+- loc: {
+- start: { column: 33, line: 3 },
+- end: { column: 38, line: 3 },
+- },
+- },
+-
+- 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: {
@@ -50,8 +88,7 @@ exports[`AST Fixtures legacy-fixtures basics import-export-equal-type-declaratio
},
},
],
-- sourceType: 'module',
-+ sourceType: 'script',
+ sourceType: 'module',
range: [73, 114],
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 ca33471e646..4388729bbf1 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 27e47052260..5775e847e8a 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 fadbb01b229..ee238f4d3eb 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 c7fc07efd94..bf6a7ff8209 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 92cbbe233f4..3331ec4e3a4 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 460aa5f7e67..61bb15fad45 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 68df555343c..c9cf66adce7 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 3260482a080..3f0bb385ba5 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 fe2b766c1de..539671c284e 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 222cc519cf2..91d204bd4e3 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 e209625b60b..fa59b2d0163 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 5c25cc16fb8..d14ea9b3058 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 882f1eedc2a..b861b28c6b1 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 6826fae73fb..2b7e65472a4 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 681e29188f4..3370dec4082 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 5d2ae168cc4..a1f3cec6078 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 63dc3c4c7b2..9e5f0b8ea1d 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 d4403d29158..62517a85070 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 541d9420d02..c78ebfa17e4 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 11ec84abe7f..1a53a43b60f 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 73d72215073..7d18cbbf9f1 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 815cf476af7..cfc7b70c381 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 4b171d07041..effb1a6217b 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 c4fc663d9e2..e4ba39d31cb 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 b0254dcb6cb..7ee2ab6c7e7 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 79507cbad05..ca5d1f2bff2 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 a876b40872a..3058a8d9433 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 cbdfb2688e0..fffa02b876d 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 5688a7f27a7..9ca0ecc7906 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 e6b93ecb73b..1a5fae1fabd 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 06c9ff9b72d..c0b2042f612 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 0f17f468b7b..af590c0b0ab 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 7208bb0dc06..68edcc2ebde 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 3f71028931f..39414f7c3b6 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 f9954e47008..21d50eb4fa9 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 89bf1373ea0..c7e54a64f06 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 da13147b30f..744740c1ac3 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 066f52e976f..31b817f0994 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 d350372e5ef..807baaad82c 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 b5725bf6f75..49b73e6d19b 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 8f452e81b3e..3529f9cd5de 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 fff61afeb9b..fae5238938d 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 7e62ff3de6a..31075870127 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 3405c7b4b91..17bbe4be48f 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 a8b94faa45d..60a3da780ff 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 d8601d44284..552644a251b 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 d5f4e726162..4ef189f802e 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 24b8986179c..80f91407215 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 0b331137fc3..0dce16b4118 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 e44cc1eb21f..59661fcd10c 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 e5af4497aaa..d19e138b046 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 f9949f44171..ee88a37d89d 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 ba49f7d863c..51752082e5b 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 134b63d05f4..2caadf4e304 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 8ae89d77588..899ea359295 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 6356986bf83..57486acf58b 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 31586978c94..606a8985400 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 0227f0b9ac0..484e493aab8 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 0099612e53a..f25cb3a8adc 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 46ac1db8b24..ca3abed0463 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 c65995495de..928f012e228 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 dd256689be6..ab4bcf6e1ff 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 cadafd1e927..88ec420d638 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 1e8a8d85074..55220826fb1 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 8b5125a5502..c56f2b5eb81 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 dc5647c5cbe..41e81dfd102 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 43dc0c615f9..3b2dc4240eb 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 633b2b7bf60..f8f7fba79fd 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 c664c59e267..5f4d6fcc648 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 1b2f2b79375..9641828c0eb 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 f45a86301ab..eb382a40c48 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 92619481bec..591495e977f 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 6b02a892b82..a48d2ed4cb3 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 5d3082bbb16..95abc2ac122 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 c124f4f8825..ede389b531e 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 8dceef59343..37073223f85 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 48119b57c75..e732d7e7225 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 19033edfa0d..7a8ca30ac4f 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 c48fbc7c676..f4dec558585 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 75095e76894..99a21d3bb10 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 070ffd82aed..98d155ef7a6 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 99034f0c682..29af9275803 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 23a4dbc9f5d..eb7bd2162c6 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 225b4642d6d..d54020e37f4 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 1e534994de5..8214d0f3e51 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 e99b60c13e3..b6d43bac4df 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 3b59325ddb6..a08cd544ed3 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 80b2ec22efd..616277e27e3 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 f58fd04a8c5..de0e8827cce 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 c5fc765d0c2..9f9b094633b 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 861f3c6fc67..ffe2ae38c04 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 c9403c51801..a36c1ee31da 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 c9e307bfb33..1dcb3545978 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 e451c313454..0ebd18b65e0 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 8175a87d5b0..7b87092ccd2 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 95d18c2f62c..d4dec2c54de 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 8daa9d702f4..b1b63f207b7 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 f7ab811dca3..21231297b43 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 eaa25a49229..53498ed9f95 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 db812258aef..960bd95fdf5 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 6831aafee65..4db97e14119 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 ba5f295254c..d3f432622b6 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 98a32fbd347..e71b995c240 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 3b65ab51b59..867fc42b1d1 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 767424fd863..210e38644ee 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 198bf8d2a0a..b416df4adad 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 807e672b1f1..028e05648aa 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 c32f552cc73..09c0093329f 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 b1e44ff5204..d0095188116 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 f26ffee877f..1604dae2c4b 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 af78d362c21..762b8a17f8d 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 c5d8b48f175..196173c257b 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 dcbca050ea5..0259325758f 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 0477b699d6b..38645b843ab 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 6450b0a1c00..d6489dbe453 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 d53c65828a2..5dc8057cb71 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 ddf991e4e45..35284cc804c 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 a14b4cb26df..f3fb0657c32 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 46fd37dbe37..2889ed0582a 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 da5fc1fa0ac..86b50d0ea33 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 b4bf6d1f888..091f3d4a2b4 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 d4b80cfc1c0..6694942a9c1 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 3ff06704e03..eafcb69bdf0 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 b3d492c1c09..7a44f897400 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 46ca24b8029..a0dca73c853 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 bc1a96cae67..62d99f330fd 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 f5d04acee7b..256b304a02d 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 b269b793948..0371377d04c 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 9b82dc5f9f2..6c6b075e434 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 c473f9f118e..313e18bc7f9 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 a516cc87f4e..31bc883b677 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 37c6b8de68f..a04914b21e1 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 3ae73b01034..f6120c1dd74 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 724bdedf9c7..212f808e37d 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 ead0a8afdd7..18334207c3b 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 81d663d91cb..4af0d045e7b 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 d1f36b0011f..eeaa588da12 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 bba1fc6c6f9..c9a2c6c1323 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 15430d8a9ab..32cc496fafb 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 26e84868cf5..f65e128096a 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 f3f2c5de74e..68ab5918c6c 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 d96b38d76a7..53aebf916f5 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 7f83badadf9..350fee4f4c8 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 c377742b959..a353497f2ec 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 7db93d05ef4..856c1022be0 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 fca6050d833..466b4987dd4 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 4ccca319ab8..f6c3e5d0432 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 8eb6a37462b..8055f6f1ce2 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 bb5100cf436..0c1628c7f84 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 1989928fcdf..29d534bf394 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 0ee3d02dc01..95dedbb1b0e 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 5eca842524b..feafd389646 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 9ba239c957c..e0535ac0dc9 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 8b7dfb95fb3..beffde570e4 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 c9d8f8739f4..9067bea2396 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 c25d16a9d1b..5ee73a232e1 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 f1244a520c3..05b18b49353 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 6ed7dcc09d3..9756a5a473e 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 3bd87f8c880..fd72e2b25fc 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 a2c14932bd7..3c694ea56b1 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 fb23e766569..ee15266961d 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 8b70a69a9c1..8310c147a49 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 2349f700577..36f2c1cf1d5 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 71fe4bac95b..837488858a5 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 23109d3d2bb..ed9374668d8 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 6b66408fdf8..71878cff80a 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 ef064f93b5c..285db979a8e 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 003d20be443..0ba46d85e33 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 9ea2f9badb6..30380db6189 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 624e3a6347f..6c182a3ea16 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 55d50aa9f5b..fd53d22a36b 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 9a02cb1d49f..eca7ce1e22c 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 09cad104b78..85b642107fb 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 c7abbe04267..d389263137d 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 e4a3ab04415..fd1f20c21c6 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 5db71f16938..8ea07ffae12 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 96cc28bc9e2..1185eb6f27c 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 e4933e5c280..27a1d0f281e 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 d29236eb3c0..f3fd3e4f191 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 8c120b192b5..d854a20c888 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 e78551dadff..772d11518e1 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 40e0a52e409..1b6b38c2c77 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 e4779292f6f..ecf8541214c 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 ad0a3b6af28..b5b95884e0e 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 abac81f19e7..a703f5597c7 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 aab5207c1cf..e0c2bb34c55 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 c21177a9eba..290ff765aed 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 129de117810..d0ef16bd7f4 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 34a322c1be7..3bdfc6deac2 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 72f39c2a9d7..e7bfc6ff2f7 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 fa1b00d30dd..674af2f29a5 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 5af6384c015..2bb556fb9a3 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 21b0358d3fe..2d084540fd4 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 87f188965e7..88ee83e0881 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 7286bec9b9e..956fec5e84a 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 be39111033a..1ef1a9d0f0b 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 6340fab4fc2..d623f02b821 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 cef0cfc863e..cd2704357cc 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 23487f4ce1c..cc9eddbeafa 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 13fe23e4d2a..fb70f302dcc 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 8dacc4ec411..5cc1db66c20 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 575a9a6bd39..5060682c9ee 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 00000000000..34abdd0420b
--- /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 3bb67741f11..2d4b418ebe6 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 00000000000..014f4d3e257
--- /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 ba41672f843..967347feff5 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 20b1afc88e8..6f4e3b145e5 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 d425ca353e6..d47eb9051c4 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 1e7daf91eaf..802e2df1233 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 3dcece695fe..58499e81b15 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 00000000000..60d72da36dd
--- /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 a645249de30..79b70db2f37 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 00000000000..d39f4065810
--- /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 d39f4065810..9d6798ba38b 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 00000000000..4cf63d00482
--- /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 403ed52cb6d..f0fdcbf56a2 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 00000000000..797630b5f8c
--- /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 797630b5f8c..5074a50f9de 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 00000000000..0c3e448daa8
--- /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 0a8ba11f7bc..cc25ca4bc8e 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 00000000000..cda29807004
--- /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 cda29807004..7b58138335d 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 00000000000..ef0323f1248
--- /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 1868f08ac3c..c156a7ba5b6 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 00000000000..519ad3a361f
--- /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 519ad3a361f..0fffeee4c5c 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 00000000000..1111df2d4d5
--- /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 bcb52edf68d..3055b0dc449 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 00000000000..17ba689c614
--- /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 17ba689c614..a6c9ea30e6f 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 00000000000..4b9fe05a0db
--- /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 0d803ce647c..ab74377190c 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 00000000000..4c89abf9f72
--- /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 4c89abf9f72..875d107ab09 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 00000000000..46332174237
--- /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 3905750f9aa..45ea7f53044 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 00000000000..f7a4fa57521
--- /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 f7a4fa57521..c8b6e5b79da 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 00000000000..577ab6fdfd2
--- /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 184f3d96b4d..69123261b06 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 00000000000..1c90fdcf540
--- /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 1c90fdcf540..a48f982c9a8 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 00000000000..4992c1bda8b
--- /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 00000000000..c7ddaf4d350
--- /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 00000000000..4330f2de54d
--- /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 00000000000..96ba6b3c25a
--- /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 00000000000..b9424b15c15
--- /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 00000000000..231a4e0b03c
--- /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 00000000000..12440d8874f
--- /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 00000000000..04350071ad7
--- /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 00000000000..5bf5b3f2503
--- /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 00000000000..406623be373
--- /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 00000000000..108f139e0c1
--- /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 00000000000..e6cdab797b6
--- /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 00000000000..665c83f9988
--- /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 00000000000..a5fa26ec178
--- /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 00000000000..4e1cb147bbf
--- /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 00000000000..bb1641bbb8a
--- /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 00000000000..ae64111c78c
--- /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 00000000000..14e18802b75
--- /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 00000000000..c16dc935997
--- /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 264bd320faa..b90437fa5b2 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 00000000000..ada94f82c3a
--- /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 ada94f82c3a..fd6c43a4704 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 00000000000..c54798556f5
--- /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 00000000000..9b3c693c259
--- /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 00000000000..edb82178308
--- /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 00000000000..30ede9e96f2
--- /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 00000000000..ddf064bf40f
--- /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 292b542dcf5..bc87ac74bbf 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 00000000000..53470554fd3
--- /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 53470554fd3..15d3db96bf3 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 00000000000..3bfdf5319d1
--- /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 4ed734c0a3d..d601da71753 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 00000000000..36d9f4ef037
--- /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 36d9f4ef037..984bdc81d29 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 00000000000..55e7b4fae1c
--- /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 13a96652b2b..3940bf8f5ae 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 00000000000..70ae64a4a82
--- /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 70ae64a4a82..1bf7e6a8b1e 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 00000000000..faf545c75f1
--- /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 b6d263475ee..7147acc9576 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 00000000000..49a27a188b9
--- /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 49a27a188b9..4c798313f87 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 00000000000..b92427a492b
--- /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 0ca583aff84..d57bbb6da4a 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 00000000000..959f932de08
--- /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 959f932de08..50357e981e2 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 00000000000..f0cb1e241b2
--- /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 1d5a7a35239..e3b090eb8f0 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 00000000000..1730fddc173
--- /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 1730fddc173..5267ec675b0 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 00000000000..ebb45418f67
--- /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 9bffb118f21..02668d51abb 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 00000000000..60a90127afa
--- /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 60a90127afa..6ea8f9cb251 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 00000000000..bfa1cb15391
--- /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 131a13aa7ee..b3cd691f7f0 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 00000000000..2afbbf45ed3
--- /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 2afbbf45ed3..910e9cc77af 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 00000000000..b78ab26d2d6
--- /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 2976cbb6ecf..33f41f8ba61 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 00000000000..0af7e82ad38
--- /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 0af7e82ad38..c022672d659 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 00000000000..93ed430d970
--- /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 32cb1ca974d..bf76c446e28 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 00000000000..0a09195bd84
--- /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 0a09195bd84..61705bea29d 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 00000000000..10b06c12006
--- /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 34d6269d02d..7d3f94f6639 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 00000000000..062e4baddd0
--- /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 062e4baddd0..9f0aaf74ac0 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 00000000000..abb471fc9c1
--- /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 01ec4dc383c..55732d2bf4a 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 00000000000..0cb366cff16
--- /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 0cb366cff16..a4a703dca99 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 00000000000..000b5cdd247
--- /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 00000000000..12254d1b48a
--- /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 00000000000..01bd31b00cb
--- /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 cd7457e4890..8cf3e746b6d 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 00000000000..62a5bb60065
--- /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 62a5bb60065..f62e1bd6555 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 00000000000..2808f07b450
--- /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 c9e45d49f90..74e32d60e43 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 00000000000..3a57033e136
--- /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 3a57033e136..a5c250cd314 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 00000000000..9af6d30fe85
--- /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 945a89aeb8e..4ae03bf3890 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 00000000000..65e263e1264
--- /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 65e263e1264..11ddafba81b 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 00000000000..af650dc5287
--- /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 0beb40de987..43f06b1fa7c 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 00000000000..6fe49dd919f
--- /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 6fe49dd919f..b4deaff7a34 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 00000000000..6e667a50f6a
--- /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 4e3c66cecea..eb8d16d999f 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 00000000000..6e4940eb9ba
--- /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 6e4940eb9ba..bdd3d867196 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 00000000000..4b4b6efa0c5
--- /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 2833ac9eb8f..9e58d0d1603 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 00000000000..7b334875fc2
--- /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 7b334875fc2..19cbad977fb 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 00000000000..dc6c9ef4c0b
--- /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 2a48d476319..95bd5eb7ffc 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 00000000000..89ed2b199bb
--- /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 00000000000..ae8600ccfdc
--- /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 00000000000..0ae40614620
--- /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 00000000000..f18a58b39b2
--- /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 099a62b2b6e..4ed8a518fdc 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 00000000000..2b47812c46c
--- /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 2b47812c46c..878ae2828d2 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 00000000000..373217628a2
--- /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 5f118120b57..684488f02c2 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 00000000000..31aaad026ea
--- /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 31aaad026ea..8579fdd31e6 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 00000000000..4866de224eb
--- /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 acfafbcff24..c178e7e591b 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 00000000000..5ba96a6641e
--- /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 5ba96a6641e..2afa3285def 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 00000000000..4f730913d19
--- /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 1f60a6e3402..8064f9d9654 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 00000000000..7a72a183ff5
--- /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 17050128c74..c12e069a650 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 37371563dad..b49a2455c85 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 406d14deb91..f34ef6e5f0e 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 09f148a9083..2786d19fdd3 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 3c9e84b6177..38b8c0d7eec 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 f0db811ffaf..e040ed835e2 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 8b0f3adc684..faa9dd7a7f4 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 63ff0bf8c59..dcf8eb70d96 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 8bcb096af8c..8cd61f41b49 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 a4c8ddcb124..af49176862a 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 1ba18827093..5abb782c861 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 1e97f5d5c08..e4b0d9dadc8 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 a1e1b7adeea..97a8f4687a6 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 fa544c6a3e8..9638d96862e 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 e0879aad4f7..535c073cbc9 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 4b4f60f3ffa..27639e3a67b 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 6f6ba7b1877..85106e819d0 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 a4bb38eda3c..c77ae1fc5ef 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 00000000000..d153d51196f
--- /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 7a9520eefe6..bc1ef7402cc 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 00000000000..3461c38ebce
--- /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 0281bcdcbc1..8732ff7462b 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 00000000000..138b3944413
--- /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 1d9549b200d..19d5df14c2b 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 00000000000..dcc869e00d2
--- /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 3256de74436..369d392b0bb 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 8995a4b18b9..95abe8bc166 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 8c520bc8957..0ea1f6bf795 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 7a69ae733f8..1c290645bdc 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 e56b3755388..dd7ddcca6f7 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 0d66ff7b55f..a2999a6fc22 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 f03ca3edb1e..2071f13fefd 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 00000000000..719a4d1f457
--- /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 00000000000..c2c925447eb
--- /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 00000000000..0cc1f717806
--- /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 00000000000..49d961c5a2f
--- /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 8c030275248..50f94cf4a55 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 888328c7c4b..e7f1056280c 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 8a4d5f4c98b..16c3a1c3475 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 5f239612d63..c38dc753a9d 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 13b43a4c786..562801ba6bc 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 ec48a91bda0..392950de414 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 0c36c85c3fb..8daae6f9517 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 b84aefb6c2c..e8ae8251a0b 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 010f9e11d87..c0b3496f741 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 137099e071b..337726590ab 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 d74da3c5e8b..667f786e034 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 95cc2b08579..514ba574c58 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 966aaf6f614..f0f1404d5e8 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 2190670be4d..30900af22c0 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 42d3d5a3c5c..89002b0a383 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 600f2728bab..837f9a425a7 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 dda047dc2e9..3ea99285bd0 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 01d21db7aba..bfed32cce86 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 02a59096f9b..6d0c6efc36c 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 8e633925fae..13aebd9d608 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 225fb3a806d..9b9c1ecf16e 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 66962c9338c..d167672eac0 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 90bc8486378..0a99fe4c889 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 72a35e38426..d24b2949995 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 75f88840e0c..7154c778112 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 3e71f1e73e3..eea7b96d473 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 7f0ff3f1301..d2240994ff9 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 66f821f85af..1b714bc6989 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 5729345d21c..799c9beb9ba 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 bc029519def..5e5c20256cf 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 c706c876155..f8289e15847 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 be2ad0cc13c..ed615cbcd19 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 169e3213d25..c44680df911 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 f451cd31629..a9d6aaafa0f 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 fe59ab02cad..7becf39220c 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 18d7b8a9fb1..323e019ff1f 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 1c3027b53b7..293811334c3 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 06360892a57..b396e883fd4 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 f033a300a71..c857057fcb4 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 1726ad50b2f..19c035fb72c 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 b67848f0878..5d1733dfb27 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 322828642b2..bccbac1b833 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 2948097fb1c..dd4b9cc383a 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 7dd96ce1e6a..8f5e827d8c8 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 a4234ce3c19..775dc0a7251 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 c5fe0cca283..6514d646011 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 a35ab7d7770..752b2d73dc6 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 8fcec2c0905..d376aae2939 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 485bc5c50e6..70a3a44d61a 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 98ba2c71171..bf666f461df 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 59b1a0bf91f..f6aad4b354a 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 a786bec4d07..be570c8c543 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 9483d5e94bc..2b07172adad 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 2f06b281d40..8ffbb928e8a 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 8d1b9c4abcb..78cfd6f6f5b 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 7a302d9a418..90262f9c0dc 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 554d54e3428..52d66c25f8d 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 6687e26e8c8..f6147ae4510 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 be2b938133d..17f5453b312 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 41bd32adba5..367d12afbcb 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 6a8370b6b8b..e889f7ff8ff 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 0500b9d57fb..7bb45645947 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 e7fab0bebdf..1290d0b54eb 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 5f191002668..bc1599183a9 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 48d1e43110b..8f98fb5c807 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 4382f42ebd5..39cb215c305 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 742fbfdcd81..0a9ea38fabe 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 cebd390f70d..13b1dbd2526 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 3cdaa13d47c..5ee5b38f53b 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 385e910cd90..c9675620d00 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 8a6935a581d..2b505af45b4 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 1a756edb61f..21aa48fbc9a 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 c5ac10f6295..60ba2df8e35 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 3d4e5e78f7e..0c3009c51c5 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 6c06c92f57d..04decd13466 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 8c89c0f442e..aae165b9340 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 9fb6b4117f7..a5e0b48f53b 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 e1c0de62017..81f3f350560 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 646e99d1564..ef00d6dd163 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 e18890770ec..368c485e82d 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 a6cf5a6a9ce..5e7781c3ef6 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 624a79fb35d..5a1e7b20c51 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 0bdfb991d52..fcdef4d6c30 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 e6d132ed161..6beae172122 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 8c1a4635b40..f70b1ed6956 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 cd82008e2c3..8c8500647fd 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 fe12ec4ef04..d57cfcd0f42 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 11ad724238e..5af936438b5 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 7c422caf01e..82119bfda8e 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 75db4f14353..2fcdfabe098 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 9b1b1ae826c..dbc54945f81 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 87b23389093..80ae05900af 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 7c92699d391..0b336f277a9 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 d1b1d336bcf..f2c26b3d6fd 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 c30d5480c1f..02cc273d157 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 d5831586688..3e272fa01fb 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 1b19115ffe8..989cdb4163c 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 5b560fa04c4..022afd59b60 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 faca7d2d1f9..3289fff4fc2 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 1c8d89c3680..6d432fe68d9 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 b815cfcfa19..2b88be0b988 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 9afebcfe430..55cf4924e65 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 5729d78a6fb..a5c59c38fe1 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 2a275a36440..85783e1a93c 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 5012a3b27dc..19b7f5d47af 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 7a6abfb9236..1d1e3d2d477 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 50b96bafcce..21655befda9 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 5653a047406..ef82ec276a6 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 c3beb71c60b..8805dcedca1 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 c396b9e2ddb..2d73832918f 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 e489dedcf78..9942b2c7959 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 e85a5a9b7bf..b07fdd831c6 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 4ac13fbd2c3..b0f8d40f163 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 f15ba271fc3..404715ae22a 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 30a5603b2a0..fbf01b73f26 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 570ef602314..44cf2dd8755 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 36213a03e94..08cdee8255c 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 a1f3c64cd6b..1b076038097 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 352030ef386..822ae4ea336 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 11f2406bcb5..9e0dd132e21 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 c87626f17e1..cd31f761574 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 f4e9993acae..2f079c26764 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 239f33768f0..f2472dfa34b 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 f467aab6aae..93ce1725a9e 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 99d8dc3bbeb..707abc21ee7 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 487dca4144b..cf045fd04e4 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 45c75cbc463..b59584ba377 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 4355a551b82..c7398b84a5b 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 64bc8b2e2f6..a734af5b7e1 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 8767560841d..44ce3bf0db0 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 7dea97ebde4..a1e56710e95 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 99fb9783e7c..46056560b92 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 73cfc3cad6b..085e71318cc 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 92d042d52fb..c18e7df81ac 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 4661a8567f5..5ae74be0a29 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 f5b3150c2e7..39b744ef4e5 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 ee875d4f166..72e55c01a01 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 861edac4e34..c6091651029 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 41466b9f8f2..a5ac7394e1d 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 9daf8bf8637..17d1d9f4695 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 2b64d5846c8..af94ebe300b 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 f7e7f886601..66cd9e9abe8 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 29698cef44e..150915876a7 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 ae11f119f07..1cc236c53e0 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 cb47a67aee4..c78aefba38d 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 742698e35d8..e032e84b0c5 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 da18ddbed86..7b4638ac81a 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 1ad2b5d62c4..4ff83eed65f 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 31eaebb2e2d..fddee09790b 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 27f2e96b44e..9626fdabc89 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 0adf4ef0127..f15ca890604 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 ab9ae31400d..f06a5479ddf 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 4798d7da045..13a4dc55881 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 9bf8457567f..2a439c04296 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 420a9327873..9fd684b8044 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 ee558c2167c..208a44e8298 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 12c89878794..76c53798a4d 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 006f5e48ba3..59f07798864 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 00000000000..15fcc76d927
--- /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 00000000000..10b3877c585
--- /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 00000000000..622f9f761c1
--- /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 00000000000..fdd63861522
--- /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 00000000000..10b3877c585
--- /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 00000000000..2ed033795ab
--- /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 00000000000..4a03af84366
--- /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 00000000000..63ae30ee6f5
--- /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 00000000000..20c1175484e
--- /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 00000000000..500c7d90879
--- /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 00000000000..63ae30ee6f5
--- /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 00000000000..8865ee198d9
--- /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 0cf3c4a911d..56b5f559529 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 81d69e1e604..e338dbf677e 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 a6d847de1c2..ef5668193ae 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 a1609757d3c..272b11db8f6 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 beab46e12b9..73bffe1a371 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 0fd5e92e286..74a35f8fcd8 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 4c7658d5f79..07a3ebcc8fc 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 b8aa62a507c..2a8f32cddbb 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 99c1b4bfa76..dcd6e04ab45 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 6b9faf086d6..09f4c2fef77 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 e4ea2237032..894c1752a12 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 274981ae125..7a64e239d88 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 6a0bab05f37..67a3d5754e1 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 27b0483a19b..d8b4d9eadee 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 132ed8b6e37..124790f2fbc 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 f6ed4a29e37..c8d0f76fe9d 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 2ae40e1f3f4..9d3bd6eaa12 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 d212dd9308f..32a31c4e8e4 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 9c4dee68d2b..125a353ad2f 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 3d17a9cdd49..076a347f025 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 183080d0ea2..a8c6cf44d81 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 b6d1dee5b19..8ff0271450e 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 97670b76950..ffc7d16c1be 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 2363475fdb4..05e22d460f7 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 fa67e5d5be0..5a7a38bb6cb 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 f3f3121a24c..e92dc3b1d94 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 11f14029939..4b1dc68aa05 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 15e908f2a61..a77f9f4551d 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 5572b5335c8..edd2373c7cd 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 737f0d3abc7..f8731ecd937 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 71d3cd47f02..1f5ca163794 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 eba1adb09f4..49e154acacc 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 439f20b8d92..56a976debdb 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 71ee0e188f1..2bc3d071c6d 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 4687caca30c..d22b0f6d6f9 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 64cbd211b5d..874eddf9050 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 981d3e4bfbc..2af61b6a3d0 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 2a50d483de2..4c17ab31e05 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 249dc8e4253..812a9a584fd 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 a5476c5645a..6846f0270b8 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 21c5d81390d..5a0302a6b4d 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 4add40cf5d1..d5e84b269a2 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 eb7f3b8a588..dc82e1e4638 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 47c6ccd25b6..623b81b8b4d 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 341ae78b252..b1d7a768004 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 80b85b253f0..90fa3b6e9a2 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 65601c74de4..12c0c5b4e40 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 f24056fd5d6..6a5035aefdf 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 2971baddac5..cc71f3fee6e 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 3579f6bbe03..832132ccc64 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 6b8bb7862af..147fb616c0c 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 14bbb7928aa..bc2c908f083 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 1d0bc76f127..a1295bfa7a9 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 619c6a57d5d..50f129faf58 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 f5fd336a960..9ae5cd1f31d 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 00000000000..e1a5a7980c3
--- /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 00000000000..f723750f0ee
--- /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 00000000000..cf149c8bdc2
--- /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 00000000000..79c7461a897
--- /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 00000000000..f723750f0ee
--- /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 00000000000..51974790455
--- /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 b2eea1a78e0..3eb30235d9b 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 00000000000..0f620d4925e
--- /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 00000000000..a18ec232c74
--- /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 00000000000..3ddaaa553ab
--- /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 00000000000..be7ee0f9c84
--- /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 00000000000..a18ec232c74
--- /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 00000000000..be7ee0f9c84
--- /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 00000000000..2067882f9e2
--- /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 00000000000..bfe056cd787
--- /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 00000000000..6ace2444c88
--- /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 00000000000..42d0ee954c5
--- /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 00000000000..bfe056cd787
--- /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 00000000000..26b43912008
--- /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 db5abd4063a..8b81c4f77bb 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 c83b8721eed..f6d530c084f 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 634c307ad2c..b6ec9fdf6ec 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 9d88fe7f6b4..c7b5b340b2f 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 b78996d1405..b3a25fd3811 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 f2501e6585c..00000000000
--- 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 00000000000..95f993b9e4d
--- /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 4b7b8657e76..67a51cd0dd1 100644
--- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot
+++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot
@@ -1,30 +1,80 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AST Fixtures List fixtures with AST differences 1`] = `
-Set {
+[
+ "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 @@ Set {
"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,22 +118,47 @@ Set {
"element/AccessorProperty/fixtures/with-annotation-no-value/fixture.ts",
"element/AccessorProperty/fixtures/with-annotation-with-value/fixture.ts",
"expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture.ts",
+ "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",
@@ -97,6 +185,7 @@ Set {
"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",
@@ -109,9 +198,18 @@ Set {
"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",
@@ -120,23 +218,35 @@ Set {
"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",
@@ -147,35 +257,98 @@ Set {
"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",
@@ -196,10 +369,13 @@ Set {
"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",
@@ -213,8 +389,15 @@ Set {
"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",
@@ -227,14 +410,32 @@ Set {
"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",
@@ -260,5 +461,5 @@ Set {
"special/TSTypeParameter/fixtures/interface-const-modifier/fixture.ts",
"special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts",
"special/TSTypeParameter/fixtures/method-const-modifiers/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 bdb34fe6b4b..3baa5a85efc 100644
--- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot
+++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot
@@ -2,11 +2,10 @@
exports[`AST Fixtures List fixtures with Error differences 1`] = `
{
- "Babel errored but TSESTree didn't": Set {
+ "Babel errored but TSESTree didn't": [
"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,39 +39,19 @@ 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": Set {
+ ],
+ "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-with-differences-tokens.shot b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot
index 7a512bf413c..b15734b809f 100644
--- a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot
+++ b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`AST Fixtures List fixtures with Token differences 1`] = `
-Set {
+[
"declaration/ClassDeclaration/fixtures/implements-many/fixture.ts",
"declaration/ClassDeclaration/fixtures/implements-one/fixture.ts",
"declaration/ExportDefaultDeclaration/fixtures/interface/fixture.ts",
@@ -26,6 +26,8 @@ Set {
"element/AccessorProperty/fixtures/modifier-private/fixture.ts",
"element/AccessorProperty/fixtures/modifier-protected/fixture.ts",
"element/AccessorProperty/fixtures/modifier-public/fixture.ts",
+ "jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx",
+ "jsx/JSXNamespacedName/fixtures/component/fixture.tsx",
"legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts",
"legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts",
"legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture.ts",
@@ -129,5 +131,5 @@ Set {
"special/TSTypeParameter/fixtures/interface-const-modifier-multiple/fixture.ts",
"special/TSTypeParameter/fixtures/interface-const-modifier/fixture.ts",
"special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts",
-}
+]
`;
diff --git a/packages/ast-spec/tests/fixtures-without-babel-support.shot b/packages/ast-spec/tests/fixtures-without-babel-support.shot
index 0ecfffa63d0..d2037dc15b3 100644
--- a/packages/ast-spec/tests/fixtures-without-babel-support.shot
+++ b/packages/ast-spec/tests/fixtures-without-babel-support.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures List fixtures we expect babel to not support 1`] = `Map {}`;
+exports[`AST Fixtures List fixtures we expect babel to not support 1`] = `[]`;
diff --git a/packages/ast-spec/tests/fixtures.test.ts b/packages/ast-spec/tests/fixtures.test.ts
index df70fe613eb..55fcebf6104 100644
--- a/packages/ast-spec/tests/fixtures.test.ts
+++ b/packages/ast-spec/tests/fixtures.test.ts
@@ -1,5 +1,5 @@
import fs from 'fs';
-import glob from 'glob';
+import glob = require('glob');
import makeDir from 'make-dir';
import path from 'path';
@@ -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++),
);
});
@@ -326,22 +337,35 @@ describe('AST Fixtures', () => {
// once we've run all the tests, snapshot the list of fixtures that have differences for easy reference
it('List fixtures with AST differences', () => {
- expect(fixturesWithASTDifferences).toMatchSpecificSnapshot(
+ expect(
+ Array.from(fixturesWithASTDifferences).sort(),
+ ).toMatchSpecificSnapshot(
path.resolve(__dirname, 'fixtures-with-differences-ast.shot'),
);
});
it('List fixtures with Token differences', () => {
- expect(fixturesWithTokenDifferences).toMatchSpecificSnapshot(
+ expect(
+ Array.from(fixturesWithTokenDifferences).sort(),
+ ).toMatchSpecificSnapshot(
path.resolve(__dirname, 'fixtures-with-differences-tokens.shot'),
);
});
it('List fixtures with Error differences', () => {
- expect(fixturesWithErrorDifferences).toMatchSpecificSnapshot(
+ expect(
+ Object.fromEntries(
+ Object.entries(fixturesWithErrorDifferences).map(([key, value]) => [
+ key,
+ Array.from(value).sort(),
+ ]),
+ ),
+ ).toMatchSpecificSnapshot(
path.resolve(__dirname, 'fixtures-with-differences-errors.shot'),
);
});
it('List fixtures we expect babel to not support', () => {
- expect(fixturesConfiguredToExpectBabelToNotSupport).toMatchSpecificSnapshot(
+ expect(
+ Array.from(fixturesConfiguredToExpectBabelToNotSupport).sort(),
+ ).toMatchSpecificSnapshot(
path.resolve(__dirname, 'fixtures-without-babel-support.shot'),
);
});
diff --git a/packages/ast-spec/tests/util/parsers/babel.ts b/packages/ast-spec/tests/util/parsers/babel.ts
index 5e874be85af..37ad64aeb4a 100644
--- a/packages/ast-spec/tests/util/parsers/babel.ts
+++ b/packages/ast-spec/tests/util/parsers/babel.ts
@@ -1,10 +1,10 @@
-import type { ParserPlugin } from '@babel/eslint-parser';
+import type { ParserOptions } from '@babel/core';
import { parse } from '@babel/eslint-parser';
import type { Fixture, ParserResponse } from './parser-types';
import { ParserResponseType } from './parser-types';
-const PLUGINS: ParserPlugin[] = [
+const PLUGINS: NonNullable = [
'decoratorAutoAccessors',
// TODO - enable classFeatures instead of classProperties when we support it
// 'classFeatures',
diff --git a/packages/ast-spec/tests/util/parsers/parser-types.ts b/packages/ast-spec/tests/util/parsers/parser-types.ts
index 4538d8ed4a9..496ba192236 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 c04f3d12ae2..a517c0eed31 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 6cfe656f4bf..e73330a2f57 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 00000000000..5906c6e0ee7
--- /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/tsconfig.build.json b/packages/ast-spec/tsconfig.build.json
index 89b0284199a..2812814bb30 100644
--- a/packages/ast-spec/tsconfig.build.json
+++ b/packages/ast-spec/tsconfig.build.json
@@ -2,6 +2,7 @@
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"composite": true,
+ "jsx": "preserve",
"outDir": "./dist",
"rootDir": "./src",
"resolveJsonModule": true
diff --git a/packages/ast-spec/tsconfig.json b/packages/ast-spec/tsconfig.json
index 35ae2aa3a17..e9ea868f11b 100644
--- a/packages/ast-spec/tsconfig.json
+++ b/packages/ast-spec/tsconfig.json
@@ -4,14 +4,7 @@
"composite": false,
"rootDir": "."
},
- "include": [
- "src",
- "typings",
- "tests",
- "tools",
- "./rollup.config.ts",
- "**/fixtures/**/config.ts"
- ],
+ "include": ["src", "typings", "tests", "tools", "**/fixtures/**/config.ts"],
"exclude": ["**/fixtures/**/fixture.ts"],
"references": [{ "path": "../typescript-estree/tsconfig.build.json" }]
}
diff --git a/packages/ast-spec/typings/global.d.ts b/packages/ast-spec/typings/global.d.ts
index 4464c06fbcf..7dd0713ea5d 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 aaea63583ca..4fc91a03b5f 100644
--- a/packages/eslint-plugin-internal/CHANGELOG.md
+++ b/packages/eslint-plugin-internal/CHANGELOG.md
@@ -3,6 +3,180 @@
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
+
+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.61.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.1...v5.61.0) (2023-07-03)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+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.60.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.0...v5.60.1) (2023-06-26)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+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.60.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.11...v5.60.0) (2023-06-19)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.11](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.10...v5.59.11) (2023-06-12)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.10](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.9...v5.59.10) (2023-06-12)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.9](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.8...v5.59.9) (2023-06-05)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.8](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.7...v5.59.8) (2023-05-29)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.6...v5.59.7) (2023-05-22)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.5...v5.59.6) (2023-05-15)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.4...v5.59.5) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.3...v5.59.4) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.2...v5.59.3) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.1...v5.59.2) (2023-05-01)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.59.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.0...v5.59.1) (2023-04-24)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+# [5.59.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.58.0...v5.59.0) (2023-04-17)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+# [5.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
+# [5.57.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.56.0...v5.57.0) (2023-03-27)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
+
+
+
+
+
# [5.56.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.55.0...v5.56.0) (2023-03-20)
diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json
index 44c57e36fb9..1dbfdbdddea 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.56.0",
+ "version": "6.0.0",
"private": true,
"main": "dist/index.js",
"scripts": {
@@ -14,9 +14,10 @@
},
"dependencies": {
"@types/prettier": "*",
- "@typescript-eslint/scope-manager": "5.56.0",
- "@typescript-eslint/type-utils": "5.56.0",
- "@typescript-eslint/utils": "5.56.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 e7ac6302d69..0aad8a17fa7 100644
--- a/packages/eslint-plugin-internal/project.json
+++ b/packages/eslint-plugin-internal/project.json
@@ -5,10 +5,13 @@
"implicitDependencies": [],
"targets": {
"lint": {
- "executor": "@nrwl/linter:eslint",
+ "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 0c671d8432f..7b34aa0fd26 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 fd7279c3823..8c4676a32ad 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 28f7439472b..758328efe21 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 313a32eea5b..be81846a116 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 4099e2f02be..e042f328614 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 260e222194b..f56f93ee81f 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 b0b80f56cc3..5e75c5e2b7e 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 35d2f13d329..45590e5012d 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 1cde420e337..46eb2edabbe 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 f5745996d38..f9dee0411ab 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 ea162462ca6..44f9f6118ba 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 2d72dc3d18a..46def434875 100644
--- a/packages/eslint-plugin-tslint/CHANGELOG.md
+++ b/packages/eslint-plugin-tslint/CHANGELOG.md
@@ -3,6 +3,203 @@
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
+
+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.61.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.1...v5.61.0) (2023-07-03)
+
+
+### Features
+
+* support TypeScript 5.1 ([#7088](https://github.com/typescript-eslint/typescript-eslint/issues/7088)) ([4bf2d73](https://github.com/typescript-eslint/typescript-eslint/commit/4bf2d7360eaf74c9ef87b196ff4c459b8f50800b))
+
+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.60.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.0...v5.60.1) (2023-06-26)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+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.60.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.11...v5.60.0) (2023-06-19)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.11](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.10...v5.59.11) (2023-06-12)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.10](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.9...v5.59.10) (2023-06-12)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.9](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.8...v5.59.9) (2023-06-05)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.8](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.7...v5.59.8) (2023-05-29)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.6...v5.59.7) (2023-05-22)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.5...v5.59.6) (2023-05-15)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.4...v5.59.5) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.3...v5.59.4) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.2...v5.59.3) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.1...v5.59.2) (2023-05-01)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.59.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.0...v5.59.1) (2023-04-24)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+# [5.59.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.58.0...v5.59.0) (2023-04-17)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+# [5.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
+# [5.57.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.56.0...v5.57.0) (2023-03-27)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
+
+
+
+
+
# [5.56.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.55.0...v5.56.0) (2023-03-20)
**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 57c414230ec..d02ff879760 100644
--- a/packages/eslint-plugin-tslint/README.md
+++ b/packages/eslint-plugin-tslint/README.md
@@ -5,6 +5,8 @@
[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/eslint-plugin-tslint.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin-tslint)
[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/eslint-plugin-tslint.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin-tslint)
-👉 See **https://typescript-eslint.io/architecture/eslint-plugin-tslint** for documentation on this package.
+👉 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 a29cb347ea0..4a794f7d032 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.56.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,16 +46,18 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/utils": "5.56.0",
- "lodash": "^4.17.21"
+ "@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": {
- "@types/lodash": "*",
- "@typescript-eslint/parser": "5.56.0"
+ "@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 29bcb865041..b69d03550d0 100644
--- a/packages/eslint-plugin-tslint/project.json
+++ b/packages/eslint-plugin-tslint/project.json
@@ -5,10 +5,13 @@
"implicitDependencies": [],
"targets": {
"lint": {
- "executor": "@nrwl/linter:eslint",
+ "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 97b77e7d080..23b7558b80f 100644
--- a/packages/eslint-plugin-tslint/src/rules/config.ts
+++ b/packages/eslint-plugin-tslint/src/rules/config.ts
@@ -1,10 +1,28 @@
import { ESLintUtils } from '@typescript-eslint/utils';
-import memoize from 'lodash/memoize';
+import path from 'path';
import type { RuleSeverity } from 'tslint';
import { Configuration } from 'tslint';
import { CustomLinter } from '../custom-linter';
+function memoize unknown>(
+ func: T,
+ resolver: (...args: Parameters) => string,
+): T {
+ const cache = new Map>();
+ const memoized = function (...args) {
+ const key = resolver(...(args as Parameters));
+
+ if (cache.has(key)) {
+ return cache.get(key)!;
+ }
+ const result = func(...args);
+ cache.set(key, result as ReturnType);
+ return result;
+ } as T;
+ return memoized;
+}
+
// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const version: string = require('../../package.json');
@@ -15,14 +33,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';
@@ -65,7 +83,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',
@@ -102,10 +119,10 @@ export default createRule({
context,
[{ rules: tslintRules, rulesDirectory: tslintRulesDirectory, lintFile }],
) {
- const fileName = context.getFilename();
+ const fileName = path.resolve(context.getCwd(), 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 1ca8bbace36..00000000000
--- 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 00000000000..e1173e87a22
--- /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 2d923f2e41f..76537897f03 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 6c0d8cdf994..238cc318506 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 ce8f56e7294..86650784975 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 b2f22d5b95d..4ba17c6d60a 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 4443a498877..6fc0bf0c164 100644
--- a/packages/eslint-plugin/CHANGELOG.md
+++ b/packages/eslint-plugin/CHANGELOG.md
@@ -3,6 +3,286 @@
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)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [comma-spacing] allow no space after trailing comma in objects and arrays ([#6938](https://github.com/typescript-eslint/typescript-eslint/issues/6938)) ([24bdacc](https://github.com/typescript-eslint/typescript-eslint/commit/24bdacc7e5df40c92031a1bd7e9815d66a35b31d))
+* **eslint-plugin:** [prefer-includes] escape special characters ([#7161](https://github.com/typescript-eslint/typescript-eslint/issues/7161)) ([5a347a5](https://github.com/typescript-eslint/typescript-eslint/commit/5a347a5978bc5737412bd12d61eb6058163cf4a0)), closes [#7145](https://github.com/typescript-eslint/typescript-eslint/issues/7145)
+* **eslint-plugin:** replace auto-fix of class literal property style rule with suggestion ([#7054](https://github.com/typescript-eslint/typescript-eslint/issues/7054)) ([a8c824a](https://github.com/typescript-eslint/typescript-eslint/commit/a8c824a1e84453f93cd2b464fc102bc878c1aff3))
+
+
+### Features
+
+* **eslint-plugin:** [prefer-nullish-coalescing] add `ignorePrimitives` option ([#6487](https://github.com/typescript-eslint/typescript-eslint/issues/6487)) ([6edaa04](https://github.com/typescript-eslint/typescript-eslint/commit/6edaa04565576f0af7e60bc08602bd781c847804))
+
+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.61.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.1...v5.61.0) (2023-07-03)
+
+
+### Features
+
+* **eslint-plugin:** [ban-types] ban types in extends and implements ([#7129](https://github.com/typescript-eslint/typescript-eslint/issues/7129)) ([997783f](https://github.com/typescript-eslint/typescript-eslint/commit/997783ff108ca18af709667ef3fdfa7134a8eefe))
+* use graphemer instead of grapheme-splitter ([#7069](https://github.com/typescript-eslint/typescript-eslint/issues/7069)) ([faea3ff](https://github.com/typescript-eslint/typescript-eslint/commit/faea3ff8b4d750974c41262b44db314f20d0c99c))
+
+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.60.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.60.0...v5.60.1) (2023-06-26)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+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.60.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.11...v5.60.0) (2023-06-19)
+
+
+### Features
+
+* **eslint-plugin:** [restrict-plus-operands] add allow* options ([#6161](https://github.com/typescript-eslint/typescript-eslint/issues/6161)) ([def09f8](https://github.com/typescript-eslint/typescript-eslint/commit/def09f88cdb4a85cebb8619b45931f7e2c88dfc0))
+
+
+
+
+
+## [5.59.11](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.10...v5.59.11) (2023-06-12)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+
+
+
+
+## [5.59.10](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.9...v5.59.10) (2023-06-12)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+
+
+
+
+## [5.59.9](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.8...v5.59.9) (2023-06-05)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+
+
+
+
+## [5.59.8](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.7...v5.59.8) (2023-05-29)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+
+
+
+
+## [5.59.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.6...v5.59.7) (2023-05-22)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+
+
+
+
+## [5.59.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.5...v5.59.6) (2023-05-15)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+
+
+
+
+## [5.59.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.4...v5.59.5) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+
+
+
+
+## [5.59.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.3...v5.59.4) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+
+
+
+
+## [5.59.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.2...v5.59.3) (2023-05-08)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+
+
+
+
+## [5.59.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.1...v5.59.2) (2023-05-01)
+
+**Note:** Version bump only for package @typescript-eslint/eslint-plugin
+
+
+
+
+
+## [5.59.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.59.0...v5.59.1) (2023-04-24)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [prefer-regexp-exec] skip malformed regexes ([#6935](https://github.com/typescript-eslint/typescript-eslint/issues/6935)) ([05ed60e](https://github.com/typescript-eslint/typescript-eslint/commit/05ed60e25f1de9d1bb83d56c81a349130960bec8))
+* **eslint-plugin:** [unified-signatures] no parameters function ([#6940](https://github.com/typescript-eslint/typescript-eslint/issues/6940)) ([2970861](https://github.com/typescript-eslint/typescript-eslint/commit/297086154acc568a0ae8eb41c8977b7a7ba4e0ed))
+
+
+
+
+
+# [5.59.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.58.0...v5.59.0) (2023-04-17)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [no-unnecessary-condition] allow nullish coalescing for naked type parameter ([#6910](https://github.com/typescript-eslint/typescript-eslint/issues/6910)) ([3e5f858](https://github.com/typescript-eslint/typescript-eslint/commit/3e5f8583f1e4fe045c2fe2143d6f280b7381f96b))
+
+
+### Features
+
+* **eslint-plugin:** [ban-types] add NonNullable suggestion and allow custom suggestions ([#6876](https://github.com/typescript-eslint/typescript-eslint/issues/6876)) ([ff65235](https://github.com/typescript-eslint/typescript-eslint/commit/ff65235246bb6214fb64f0e0317373ca99f8bcbe))
+
+
+
+
+
+# [5.58.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.1...v5.58.0) (2023-04-10)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [unified-signatures] allow overloads with different named and different number of parameters ([#6877](https://github.com/typescript-eslint/typescript-eslint/issues/6877)) ([939d665](https://github.com/typescript-eslint/typescript-eslint/commit/939d6656ebcb94fab048a08d719b3e77362ab5b4))
+
+
+### Features
+
+* **eslint-plugin:** [no-unsafe-enum-comparison] add rule ([#6107](https://github.com/typescript-eslint/typescript-eslint/issues/6107)) ([915f9c2](https://github.com/typescript-eslint/typescript-eslint/commit/915f9c2dc8934eef491a672786ec9f016f3658ba))
+
+
+
+
+
+## [5.57.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.57.0...v5.57.1) (2023-04-03)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [strict-boolean-expressions] support mixed enums in allowNullableEnum option ([#6740](https://github.com/typescript-eslint/typescript-eslint/issues/6740)) ([49be8a8](https://github.com/typescript-eslint/typescript-eslint/commit/49be8a814c82f3784308ef5a6e90478eb56e55c1))
+
+
+
+
+
+# [5.57.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.56.0...v5.57.0) (2023-03-27)
+
+
+### Bug Fixes
+
+* **eslint-plugin:** [no-unnecessary-boolean-literal-compare] simplify fixer and add support for double negation ([#6620](https://github.com/typescript-eslint/typescript-eslint/issues/6620)) ([81c8519](https://github.com/typescript-eslint/typescript-eslint/commit/81c85193d27d2e7f6d12bc259088b9b73dbe1e8b))
+* **eslint-plugin:** correct crashes with getTypeArguments for ts < 3.7 ([#6767](https://github.com/typescript-eslint/typescript-eslint/issues/6767)) ([59eab58](https://github.com/typescript-eslint/typescript-eslint/commit/59eab587890a915387444d00c4a9387aed602718))
+
+
+### Features
+
+* **eslint-plugin:** [consistent-type-assertions] add suggestions for objectLiteralTypeAssertions ([#6642](https://github.com/typescript-eslint/typescript-eslint/issues/6642)) ([720e811](https://github.com/typescript-eslint/typescript-eslint/commit/720e81138b66c94c60c4a4471b86b7d8567b6df0))
+* **eslint-plugin:** [consistent-type-assertions] autofix angle bracket assertions to as ([#6641](https://github.com/typescript-eslint/typescript-eslint/issues/6641)) ([ad8ea64](https://github.com/typescript-eslint/typescript-eslint/commit/ad8ea64dbdf06c92ff72b48022f041693a8d7076))
+* **eslint-plugin:** add `no-duplicate-type-constituents` rule ([#5728](https://github.com/typescript-eslint/typescript-eslint/issues/5728)) ([bc31078](https://github.com/typescript-eslint/typescript-eslint/commit/bc31078cf86d69eee881e4a7daeffa347c1d82a7))
+
+
+
+
+
# [5.56.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.55.0...v5.56.0) (2023-03-20)
diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md
index 9c98f8c7d4b..3f894c88344 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/README.md b/packages/eslint-plugin/docs/rules/README.md
index 04e2d987056..71da9b1fd15 100644
--- a/packages/eslint-plugin/docs/rules/README.md
+++ b/packages/eslint-plugin/docs/rules/README.md
@@ -13,11 +13,11 @@ See [Configs](/linting/configs) for how to enable recommended rules using config
import RulesTable from "@site/src/components/RulesTable";
-
+
## Extension Rules
In some cases, ESLint provides a rule itself, but it doesn't support TypeScript syntax; either it crashes, or it ignores the syntax, or it falsely reports against it.
In these cases, we create what we call an extension rule; a rule within our plugin that has the same functionality, but also supports TypeScript.
-
+
diff --git a/packages/eslint-plugin/docs/rules/ban-types.md b/packages/eslint-plugin/docs/rules/ban-types.md
index 3f2e663669a..7109e24e845 100644
--- a/packages/eslint-plugin/docs/rules/ban-types.md
+++ b/packages/eslint-plugin/docs/rules/ban-types.md
@@ -111,7 +111,9 @@ const defaultTypes = {
'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.',
'- If you want a type meaning "any object", you probably want `object` instead.',
'- If you want a type meaning "any value", you probably want `unknown` instead.',
+ '- If you really want a type meaning "any non-nullish value", you probably want `NonNullable` instead.',
].join('\n'),
+ suggest: ['object', 'unknown', 'NonNullable'],
},
'{}': {
message: [
@@ -119,7 +121,14 @@ const defaultTypes = {
'- If you want a type meaning "any object", you probably want `object` instead.',
'- If you want a type meaning "any value", you probably want `unknown` instead.',
'- If you want a type meaning "empty object", you probably want `Record` instead.',
+ '- If you really want a type meaning "any non-nullish value", you probably want `NonNullable` instead.',
].join('\n'),
+ suggest: [
+ 'object',
+ 'unknown',
+ 'Record',
+ 'NonNullable',
+ ],
},
};
```
@@ -139,6 +148,7 @@ The values can be:
- An object with the following properties:
- `message: string` - the message to display when the type is matched.
- `fixWith?: string` - a string to replace the banned type with when the fixer is run. If this is omitted, no fix will be done.
+ - `suggest?: string[]` - a list of suggested replacements for the banned type.
### `extendDefaults`
diff --git a/packages/eslint-plugin/docs/rules/camelcase.md b/packages/eslint-plugin/docs/rules/camelcase.md
index 1b3c0e89318..aae38de928b 100644
--- a/packages/eslint-plugin/docs/rules/camelcase.md
+++ b/packages/eslint-plugin/docs/rules/camelcase.md
@@ -5,6 +5,6 @@ This rule has been deprecated in favour of the [`naming-convention`](./naming-co
:::
diff --git a/packages/eslint-plugin/docs/rules/comma-dangle.md b/packages/eslint-plugin/docs/rules/comma-dangle.md
index 1f11f9cf3ac..d25ec9e0ccb 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/explicit-member-accessibility.md b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md
index 87d7d23b038..51fa8523582 100644
--- a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md
+++ b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md
@@ -7,7 +7,7 @@ description: 'Require explicit accessibility modifiers on class properties and m
> See **https://typescript-eslint.io/rules/explicit-member-accessibility** for documentation.
TypeScript allows placing explicit `public`, `protected`, and `private` accessibility modifiers in front of class members.
-The modifiers exist solely in the type system and just server to describe who is allowed to access those members.
+The modifiers exist solely in the type system and just serve to describe who is allowed to access those members.
Leaving off accessibility modifiers makes for less code to read and write.
Members are `public` by default.
diff --git a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md
index 2995d3b2c7e..e48af85195d 100644
--- a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md
+++ b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md
@@ -56,7 +56,7 @@ export var fn = function (): number {
};
// A return value of type string
-export var arrowFn = (arg: string): string => `test ${arg}`;
+export var arrowFn = (): string => 'test';
// All arguments should be typed
export var arrowFn = (arg: string): string => `test ${arg}`;
diff --git a/packages/eslint-plugin/docs/rules/lines-around-comment.md b/packages/eslint-plugin/docs/rules/lines-around-comment.md
index 4ed071a2298..a3fbb5579d0 100644
--- a/packages/eslint-plugin/docs/rules/lines-around-comment.md
+++ b/packages/eslint-plugin/docs/rules/lines-around-comment.md
@@ -11,24 +11,14 @@ 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
In addition to the options supported by the `lines-around-comment` rule in ESLint core, the rule adds the following options:
-- `allowEnumEnd: true` doesn't require a blank line after an interface body block end
-- `allowEnumStart: true` doesn't require a blank line before an interface body block start
+- `allowEnumEnd: true` doesn't require a blank line after an enum body block end
+- `allowEnumStart: true` doesn't require a blank line before an enum body block start
- `allowInterfaceEnd: true` doesn't require a blank line before an interface body block end
- `allowInterfaceStart: true` doesn't require a blank line after an interface body block start
- `allowModuleEnd: true` doesn't require a blank line before a module body block end
diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md
index ab0405592c4..53c381c9e74 100644
--- a/packages/eslint-plugin/docs/rules/naming-convention.md
+++ b/packages/eslint-plugin/docs/rules/naming-convention.md
@@ -104,10 +104,10 @@ For information about how each selector is applied, see ["How does the rule eval
The `format` option defines the allowed formats for the identifier. This option accepts an array of the following values, and the identifier can match any of them:
- `camelCase` - standard camelCase format - no underscores are allowed between characters, and consecutive capitals are allowed (i.e. both `myID` and `myId` are valid).
-- `strictCamelCase` - same as `camelCase`, but consecutive capitals are not allowed (i.e. `myId` is valid, but `myID` is not).
- `PascalCase` - same as `camelCase`, except the first character must be upper-case.
-- `StrictPascalCase` - same as `strictCamelCase`, except the first character must be upper-case.
- `snake_case` - standard snake_case format - all characters must be lower-case, and underscores are allowed.
+- `strictCamelCase` - same as `camelCase`, but consecutive capitals are not allowed (i.e. `myId` is valid, but `myID` is not).
+- `StrictPascalCase` - same as `strictCamelCase`, except the first character must be upper-case.
- `UPPER_CASE` - same as `snake_case`, except all characters must be upper-case.
Instead of an array, you may also pass `null`. This signifies "this selector shall not have its format checked".
@@ -118,8 +118,8 @@ This can be useful if you want to enforce no particular format for a specific se
The `custom` option defines a custom regex that the identifier must (or must not) match. This option allows you to have a bit more finer-grained control over identifiers, letting you ban (or force) certain patterns and substrings.
Accepts an object with the following properties:
-- `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)`
- `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`.
+- `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)`
#### `filter`
@@ -129,8 +129,8 @@ You can use this to include or exclude specific identifiers from specific config
Accepts an object with the following properties:
-- `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)`
- `match` - true if the identifier _must_ match the `regex`, false if the identifier _must not_ match the `regex`.
+- `regex` - a string that is then passed into RegExp to create a new regular expression: `new RegExp(regex)`
Alternatively, `filter` accepts a regular expression (anything accepted into `new RegExp(filter)`). In this case, it's treated as if you had passed an object with the regex and `match: true`.
@@ -138,12 +138,12 @@ Alternatively, `filter` accepts a regular expression (anything accepted into `ne
The `leadingUnderscore` / `trailingUnderscore` options control whether leading/trailing underscores are considered valid. Accepts one of the following values:
-- `forbid` - a leading/trailing underscore is not allowed at all.
-- `require` - a single leading/trailing underscore must be included.
-- `requireDouble` - two leading/trailing underscores must be included.
- `allow` - existence of a single leading/trailing underscore is not explicitly enforced.
- `allowDouble` - existence of a double leading/trailing underscore is not explicitly enforced.
- `allowSingleOrDouble` - existence of a single or a double leading/trailing underscore is not explicitly enforced.
+- `forbid` - a leading/trailing underscore is not allowed at all.
+- `require` - a single leading/trailing underscore must be included.
+- `requireDouble` - two leading/trailing underscores must be included.
#### `prefix` / `suffix`
@@ -163,27 +163,27 @@ If these are provided, the identifier must start with one of the provided values
- The name must match _all_ of the modifiers.
- For example, if you provide `{ modifiers: ['private','readonly','static'] }`, then it will only match something that is `private static readonly`, and something that is just `private` will not match.
- The following `modifiers` are allowed:
+ - `abstract`,`override`,`private`,`protected`,`readonly`,`static` - matches any member explicitly declared with the given modifier.
+ - `async` - matches any method, function, or function variable which is async via the `async` keyword (e.g. does not match functions that return promises without using `async` keyword)
- `const` - matches a variable declared as being `const` (`const x = 1`).
- `destructured` - matches a variable declared via an object destructuring pattern (`const {x, z = 2}`).
- Note that this does not match renamed destructured properties (`const {x: y, a: b = 2}`).
- - `global` - matches a variable/function declared in the top-level scope.
- `exported` - matches anything that is exported from the module.
- - `unused` - matches anything that is not used.
- - `requiresQuotes` - matches any name that requires quotes as it is not a valid identifier (i.e. has a space, a dash, etc in it).
- - `public` - matches any member that is either explicitly declared as `public`, or has no visibility modifier (i.e. implicitly public).
- - `abstract`,`override`,`private`,`protected`,`readonly`,`static` - matches any member explicitly declared with the given modifier.
+ - `global` - matches a variable/function declared in the top-level scope.
- `#private` - matches any member with a private identifier (an identifier that starts with `#`)
- - `async` - matches any method, function, or function variable which is async via the `async` keyword (e.g. does not match functions that return promises without using `async` keyword)
+ - `public` - matches any member that is either explicitly declared as `public`, or has no visibility modifier (i.e. implicitly public).
+ - `requiresQuotes` - matches any name that requires quotes as it is not a valid identifier (i.e. has a space, a dash, etc in it).
+ - `unused` - matches anything that is not used.
- `types` allows you to specify which types to match. This option supports simple, primitive types only (`array`,`boolean`,`function`,`number`,`string`).
- The name must match _one_ of the types.
- **_NOTE - Using this option will require that you lint with type information._**
- For example, this lets you do things like enforce that `boolean` variables are prefixed with a verb.
- The following `types` are allowed:
- - `boolean` matches any type assignable to `boolean | null | undefined`
- - `string` matches any type assignable to `string | null | undefined`
- - `number` matches any type assignable to `number | null | undefined`
- `array` matches any type assignable to `Array | null | undefined`
+ - `boolean` matches any type assignable to `boolean | null | undefined`
- `function` matches any type assignable to `Function | null | undefined`
+ - `number` matches any type assignable to `number | null | undefined`
+ - `string` matches any type assignable to `string | null | undefined`
The ordering of selectors does not matter. The implementation will automatically sort the selectors to ensure they match from most-specific to least specific. It will keep checking selectors in that order until it finds one that matches the name. See ["How does the rule automatically order selectors?"](#how-does-the-rule-automatically-order-selectors)
@@ -195,57 +195,57 @@ There are two types of selectors, individual selectors, and grouped selectors.
Individual Selectors match specific, well-defined sets. There is no overlap between each of the individual selectors.
-- `variable` - matches any `let` / `const` / `var` variable name.
- - Allowed `modifiers`: `async`, `const`, `destructured`, `exported`, `global`, `unused`.
+- `accessor` - matches any accessor.
+ - Allowed `modifiers`: `abstract`, `override`, `private`, `protected`, `public`, `requiresQuotes`, `static`.
- Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
-- `function` - matches any named function declaration or named function expression.
- - Allowed `modifiers`: `async`, `exported`, `global`, `unused`.
+- `class` - matches any class declaration.
+ - Allowed `modifiers`: `abstract`, `exported`, `unused`.
- Allowed `types`: none.
-- `parameter` - matches any function parameter. Does not match parameter properties.
- - Allowed `modifiers`: `destructured`, `unused`.
- - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`.
-- `classProperty` - matches any class property. Does not match properties that have direct function expression or arrow function expression values.
- - Allowed `modifiers`: `abstract`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`.
- - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
-- `objectLiteralProperty` - matches any object literal property. Does not match properties that have direct function expression or arrow function expression values.
- - Allowed `modifiers`: `public`, `requiresQuotes`.
- - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
-- `typeProperty` - matches any object type property. Does not match properties that have direct function expression or arrow function expression values.
- - Allowed `modifiers`: `public`, `readonly`, `requiresQuotes`.
- - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
-- `parameterProperty` - matches any parameter property.
- - Allowed `modifiers`: `private`, `protected`, `public`, `readonly`.
- - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
- `classMethod` - matches any class method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors.
- Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `requiresQuotes`, `static`.
- Allowed `types`: none.
-- `objectLiteralMethod` - matches any object literal method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors.
- - Allowed `modifiers`: `async`, `public`, `requiresQuotes`.
- - Allowed `types`: none.
-- `typeMethod` - matches any object type method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors.
- - Allowed `modifiers`: `public`, `requiresQuotes`.
- - Allowed `types`: none.
-- `accessor` - matches any accessor.
- - Allowed `modifiers`: `abstract`, `override`, `private`, `protected`, `public`, `requiresQuotes`, `static`.
+- `classProperty` - matches any class property. Does not match properties that have direct function expression or arrow function expression values.
+ - Allowed `modifiers`: `abstract`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`.
- Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
+- `enum` - matches any enum declaration.
+ - Allowed `modifiers`: `exported`, `unused`.
+ - Allowed `types`: none.
- `enumMember` - matches any enum member.
- Allowed `modifiers`: `requiresQuotes`.
- Allowed `types`: none.
-- `class` - matches any class declaration.
- - Allowed `modifiers`: `abstract`, `exported`, `unused`.
+- `function` - matches any named function declaration or named function expression.
+ - Allowed `modifiers`: `async`, `exported`, `global`, `unused`.
- Allowed `types`: none.
- `interface` - matches any interface declaration.
- Allowed `modifiers`: `exported`, `unused`.
- Allowed `types`: none.
+- `objectLiteralMethod` - matches any object literal method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors.
+ - Allowed `modifiers`: `async`, `public`, `requiresQuotes`.
+ - Allowed `types`: none.
+- `objectLiteralProperty` - matches any object literal property. Does not match properties that have direct function expression or arrow function expression values.
+ - Allowed `modifiers`: `public`, `requiresQuotes`.
+ - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
+- `parameter` - matches any function parameter. Does not match parameter properties.
+ - Allowed `modifiers`: `destructured`, `unused`.
+ - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
+- `parameterProperty` - matches any parameter property.
+ - Allowed `modifiers`: `private`, `protected`, `public`, `readonly`.
+ - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
- `typeAlias` - matches any type alias declaration.
- Allowed `modifiers`: `exported`, `unused`.
- Allowed `types`: none.
-- `enum` - matches any enum declaration.
- - Allowed `modifiers`: `exported`, `unused`.
+- `typeMethod` - matches any object type method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors.
+ - Allowed `modifiers`: `public`, `requiresQuotes`.
- Allowed `types`: none.
- `typeParameter` - matches any generic type parameter declaration.
- Allowed `modifiers`: `unused`.
- Allowed `types`: none.
+- `typeProperty` - matches any object type property. Does not match properties that have direct function expression or arrow function expression values.
+ - Allowed `modifiers`: `public`, `readonly`, `requiresQuotes`.
+ - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
+- `variable` - matches any `const` / `let` / `var` variable name.
+ - Allowed `modifiers`: `async`, `const`, `destructured`, `exported`, `global`, `unused`.
+ - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
##### Group Selectors
@@ -254,20 +254,20 @@ Group Selectors are provided for convenience, and essentially bundle up sets of
- `default` - matches everything.
- Allowed `modifiers`: all modifiers.
- Allowed `types`: none.
-- `variableLike` - matches the same as `function`, `parameter` and `variable`.
- - Allowed `modifiers`: `async`, `unused`.
- - Allowed `types`: none.
- `memberLike` - matches the same as `accessor`, `enumMember`, `method`, `parameterProperty`, `property`.
- Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`.
- Allowed `types`: none.
-- `typeLike` - matches the same as `class`, `enum`, `interface`, `typeAlias`, `typeParameter`.
- - Allowed `modifiers`: `abstract`, `unused`.
+- `method` - matches the same as `classMethod`, `objectLiteralMethod`, `typeMethod`.
+ - Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`.
- Allowed `types`: none.
- `property` - matches the same as `classProperty`, `objectLiteralProperty`, `typeProperty`.
- Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`.
- Allowed `types`: `array`, `boolean`, `function`, `number`, `string`.
-- `method` - matches the same as `classMethod`, `objectLiteralMethod`, `typeMethod`.
- - Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`.
+- `typeLike` - matches the same as `class`, `enum`, `interface`, `typeAlias`, `typeParameter`.
+ - Allowed `modifiers`: `abstract`, `unused`.
+ - Allowed `types`: none.
+- `variableLike` - matches the same as `function`, `parameter` and `variable`.
+ - Allowed `modifiers`: `async`, `unused`.
- Allowed `types`: none.
## FAQ
@@ -278,18 +278,18 @@ This is a big rule, and there's a lot of docs. Here are a few clarifications tha
Each selector is checked in the following way:
-1. check the `selector`
- 1. if `selector` is one individual selector → the name's type must be of that type.
- 1. if `selector` is a group selector → the name's type must be one of the grouped types.
- 1. if `selector` is an array of selectors → apply the above for each selector in the array.
1. check the `filter`
1. if `filter` is omitted → skip this step.
- 1. if the name matches the `filter` → continue evaluating this selector.
- 1. if the name does not match the `filter` → skip this selector and continue to the next selector.
-1. check the `types`
+ 2. if the name matches the `filter` → continue evaluating this selector.
+ 3. if the name does not match the `filter` → skip this selector and continue to the next selector.
+2. check the `selector`
+ 1. if `selector` is one individual selector → the name's type must be of that type.
+ 2. if `selector` is a group selector → the name's type must be one of the grouped types.
+ 3. if `selector` is an array of selectors → apply the above for each selector in the array.
+3. check the `types`
1. if `types` is omitted → skip this step.
- 1. if the name has a type in `types` → continue evaluating this selector.
- 1. if the name does not have a type in `types` → skip this selector and continue to the next selector.
+ 2. if the name has a type in `types` → continue evaluating this selector.
+ 3. if the name does not have a type in `types` → skip this selector and continue to the next selector.
A name is considered to pass the config if it:
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 7409f5e134e..a5493c7e50f 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 5f523a7b0f4..9bf40498092 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-duplicate-type-constituents.md b/packages/eslint-plugin/docs/rules/no-duplicate-type-constituents.md
new file mode 100644
index 00000000000..879d0c6ca74
--- /dev/null
+++ b/packages/eslint-plugin/docs/rules/no-duplicate-type-constituents.md
@@ -0,0 +1,61 @@
+---
+description: 'Disallow duplicate constituents of union or intersection types.'
+---
+
+> 🛑 This file is source code, not the primary documentation location! 🛑
+>
+> See **https://typescript-eslint.io/rules/no-duplicate-type-constituents** for documentation.
+
+TypeScript supports types ("constituents") within union and intersection types being duplicates of each other.
+However, developers typically expect each constituent to be unique within its intersection or union.
+Duplicate values make the code overly verbose and generally reduce readability.
+
+## Rule Details
+
+This rule disallows duplicate union or intersection constituents.
+We consider types to be duplicate if they evaluate to the same result in the type system.
+For example, given `type A = string` and `type T = string | A`, this rule would flag that `A` is the same type as `string`.
+
+
+
+### ❌ Incorrect
+
+```ts
+type T1 = 'A' | 'A';
+
+type T2 = A | A | B;
+
+type T3 = { a: string } & { a: string };
+
+type T4 = [1, 2, 3] | [1, 2, 3];
+
+type StringA = string;
+type StringB = string;
+type T5 = StringA | StringB;
+```
+
+### ✅ Correct
+
+```ts
+type T1 = 'A' | 'B';
+
+type T2 = A | B | C;
+
+type T3 = { a: string } & { b: string };
+
+type T4 = [1, 2, 3] | [1, 2, 3, 4];
+
+type StringA = string;
+type NumberB = number;
+type T5 = StringA | NumberB;
+```
+
+## Options
+
+### `ignoreIntersections`
+
+When set to true, duplicate checks on intersection type constituents are ignored.
+
+### `ignoreUnions`
+
+When set to true, duplicate checks on union type constituents are ignored.
diff --git a/packages/eslint-plugin/docs/rules/no-floating-promises.md b/packages/eslint-plugin/docs/rules/no-floating-promises.md
index 289e42f903c..246a50be096 100644
--- a/packages/eslint-plugin/docs/rules/no-floating-promises.md
+++ b/packages/eslint-plugin/docs/rules/no-floating-promises.md
@@ -83,7 +83,7 @@ With this option set to `true`, and if you are using `no-void`, you should turn
### `ignoreIIFE`
-This allows you to skip checking of async IIFEs (Immediately Invocated function Expressions).
+This allows you to skip checking of async IIFEs (Immediately Invoked function Expressions).
Examples of **correct** code for this rule with `{ ignoreIIFE: true }`:
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 ea75c981890..00000000000
--- 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 16a91864d59..00000000000
--- 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 a9774ebdde1..78bdf64c009 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-unnecessary-boolean-literal-compare.md b/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md
index 69c9a33441b..d41eee1a090 100644
--- a/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md
+++ b/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md
@@ -115,16 +115,16 @@ if (!(someNullCondition ?? true)) {
## Fixer
-| Comparison | Fixer Output | Notes |
-| :----------------------------: | ------------------------------- | ----------------------------------------------------------------------------------- |
-| `booleanVar === true` | `booleanVar` | |
-| `booleanVar !== true` | `!booleanVar` | |
-| `booleanVar === false` | `!booleanVar` | |
-| `booleanVar !== false` | `booleanVar` | |
-| `nullableBooleanVar === true` | `nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` |
-| `nullableBooleanVar !== true` | `!nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` |
-| `nullableBooleanVar === false` | `nullableBooleanVar ?? true` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` |
-| `nullableBooleanVar !== false` | `!(nullableBooleanVar ?? true)` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` |
+| Comparison | Fixer Output | Notes |
+| :-------------------------------: | ------------------------------- | ----------------------------------------------------------------------------------- |
+| `booleanVar === true` | `booleanVar` | |
+| `booleanVar !== true` | `!booleanVar` | |
+| `booleanVar === false` | `!booleanVar` | |
+| `booleanVar !== false` | `booleanVar` | |
+| `nullableBooleanVar === true` | `nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` |
+| `nullableBooleanVar !== true` | `!nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` |
+| `!(nullableBooleanVar === false)` | `nullableBooleanVar ?? true` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` |
+| `!(nullableBooleanVar !== false)` | `!(nullableBooleanVar ?? true)` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` |
## Not To Use It
diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md
index b8672d945d5..5fd0e70d653 100644
--- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md
+++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md
@@ -7,8 +7,8 @@ description: 'Disallow unnecessary constraints on generic types.'
> See **https://typescript-eslint.io/rules/no-unnecessary-type-constraint** for documentation.
Generic type parameters (``) in TypeScript may be "constrained" with an [`extends` keyword](https://www.typescriptlang.org/docs/handbook/generics.html#generic-constraints).
-When no `extends` is provided, type parameters default a constraint to `any`.
-It is therefore redundant to `extend` from `any`.
+When no `extends` is provided, type parameters default a constraint to `unknown`.
+It is therefore redundant to `extend` from `any` or `unknown`.
## Examples
@@ -19,8 +19,12 @@ It is therefore redundant to `extend` from `any`.
```ts
interface FooAny {}
+interface FooUnknown {}
+
type BarAny = {};
+type BarUnknown = {};
+
class BazAny {
quxAny() {}
}
diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md b/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md
new file mode 100644
index 00000000000..f5705826073
--- /dev/null
+++ b/packages/eslint-plugin/docs/rules/no-unsafe-enum-comparison.md
@@ -0,0 +1,77 @@
+---
+description: 'Disallow comparing an enum value with a non-enum value.'
+---
+
+> 🛑 This file is source code, not the primary documentation location! 🛑
+>
+> See **https://typescript-eslint.io/rules/no-unsafe-enum-comparison** for documentation.
+
+The TypeScript compiler can be surprisingly lenient when working with enums.
+For example, it will allow you to compare enum values against numbers even though they might not have any type overlap:
+
+```ts
+enum Fruit {
+ Apple,
+ Banana,
+}
+
+declare let fruit: Fruit;
+
+fruit === 999; // No error
+```
+
+This rule flags when an enum typed value is compared to a non-enum `number`.
+
+## Examples
+
+
+
+### ❌ Incorrect
+
+```ts
+enum Fruit {
+ Apple,
+}
+
+declare let fruit: Fruit;
+
+fruit === 999;
+```
+
+```ts
+enum Vegetable {
+ Asparagus = 'asparagus',
+}
+
+declare let vegetable: Vegetable;
+
+vegetable === 'asparagus';
+```
+
+### ✅ Correct
+
+```ts
+enum Fruit {
+ Apple,
+}
+
+declare let fruit: Fruit;
+
+fruit === Fruit.Banana;
+```
+
+```ts
+enum Vegetable {
+ Asparagus = 'asparagus',
+}
+
+declare let vegetable: Vegetable;
+
+vegetable === Vegetable.Asparagus;
+```
+
+
+
+## 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-includes.md b/packages/eslint-plugin/docs/rules/prefer-includes.md
index 8c1a709c2de..793014008be 100644
--- a/packages/eslint-plugin/docs/rules/prefer-includes.md
+++ b/packages/eslint-plugin/docs/rules/prefer-includes.md
@@ -57,7 +57,7 @@ const userDefined: {
str.includes(value);
array.includes(value);
-readonlyArray.includes(value);
+!readonlyArray.includes(value);
typedArray.includes(value);
maybe?.includes('');
userDefined.includes(value);
diff --git a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md
index d2fc95f4066..451f7dff1d4 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);
@@ -131,6 +142,29 @@ a ?? (b && c && d);
**_NOTE:_** Errors for this specific case will be presented as suggestions (see below), instead of fixes. This is because it is not always safe to automatically convert `||` to `??` within a mixed logical expression, as we cannot tell the intended precedence of the operator. Note that by design, `??` requires parentheses when used with `&&` or `||` in the same expression.
+### `ignorePrimitives`
+
+If you would like to ignore certain primitive types that can be falsy then you may pass an object containing a boolean value for each primitive:
+
+- `string: true`, ignores `null` or `undefined` unions with `string` (default: false).
+- `number: true`, ignores `null` or `undefined` unions with `number` (default: false).
+- `bigint: true`, ignores `null` or `undefined` unions with `bigint` (default: false).
+- `boolean: true`, ignores `null` or `undefined` unions with `boolean` (default: false).
+
+Incorrect code for `ignorePrimitives: { string: true }`, and correct code for `ignorePrimitives: { string: false }`:
+
+```ts
+const foo: string | undefined = 'bar';
+foo || 'a string';
+```
+
+Correct code for `ignorePrimitives: { string: true }`:
+
+```ts
+const foo: string | undefined = 'bar';
+foo ?? 'a string';
+```
+
## When Not To Use It
If you are not using TypeScript 3.7 (or greater), then you will not be able to use this rule, as the operator is not supported.
diff --git a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md
index 4a9ada8b08f..6efb88b17ae 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 b1e912abe37..703b16fa3f0 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 f4ccd6fc21a..dcc86305d25 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 fc823f6da9f..9428ea11524 100644
--- a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md
+++ b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md
@@ -18,70 +18,180 @@ This rule reports when a `+` operation combines two values of different types, o
### ❌ Incorrect
```ts
-var foo = '5.5' + 5;
-var foo = 1n + 1;
+let foo = '5.5' + 5;
+let foo = 1n + 1;
```
### ✅ Correct
```ts
-var foo = parseInt('5.5', 10) + 10;
-var foo = 1n + 1n;
+let foo = parseInt('5.5', 10) + 10;
+let foo = 1n + 1n;
```
## Options
-### `checkCompoundAssignments`
+:::caution
+We generally recommend against using these options, as they limit which varieties of incorrect `+` usage can be checked.
+This in turn severely limits the validation that the rule can do to ensure that resulting strings and numbers are correct.
+
+Safer alternatives to using the `allow*` options include:
+
+- Using variadic forms of logging APIs to avoid needing to `+` values.
+ ```ts
+ // Remove this line
+ console.log('The result is ' + true);
+ // Add this line
+ console.log('The result is', true);
+ ```
+- Using `.toFixed()` to coerce numbers to well-formed string representations:
+ ```ts
+ const number = 1.123456789;
+ const result = 'The number is ' + number.toFixed(2);
+ // result === 'The number is 1.12'
+ ```
+- Calling `.toString()` on other types to mark explicit and intentional string coercion:
+ ```ts
+ const arg = '11';
+ const regex = /[0-9]/;
+ const result =
+ 'The result of ' +
+ regex.toString() +
+ '.test("' +
+ arg +
+ '") is ' +
+ regex.test(arg).toString();
+ // result === 'The result of /[0-9]/.test("11") is true'
+ ```
+
+:::
-Examples of code for this rule with `{ checkCompoundAssignments: true }`:
+### `allowAny`
+
+Examples of code for this rule with `{ allowAny: true }`:
#### ❌ Incorrect
```ts
-/*eslint @typescript-eslint/restrict-plus-operands: ["error", { "checkCompoundAssignments": true }]*/
+let fn = (a: number, b: []) => a + b;
+let fn = (a: string, b: []) => a + b;
+```
-let foo: string | undefined;
-foo += 'some data';
+#### ✅ Correct
-let bar: string = '';
-bar += 0;
+```ts
+let fn = (a: number, b: any) => a + b;
+let fn = (a: string, b: any) => a + b;
+```
+
+### `allowBoolean`
+
+Examples of code for this rule with `{ allowBoolean: true }`:
+
+
+
+#### ❌ Incorrect
+
+```ts
+let fn = (a: number, b: unknown) => a + b;
+let fn = (a: string, b: unknown) => a + b;
```
#### ✅ Correct
```ts
-/*eslint @typescript-eslint/restrict-plus-operands: ["error", { "checkCompoundAssignments": true }]*/
+let fn = (a: number, b: boolean) => a + b;
+let fn = (a: string, b: boolean) => a + b;
+```
-let foo: number = 0;
-foo += 1;
+### `allowNullish`
-let bar = '';
-bar += 'test';
+Examples of code for this rule with `{ allowNullish: true }`:
+
+
+
+#### ❌ Incorrect
+
+```ts
+let fn = (a: number, b: unknown) => a + b;
+let fn = (a: number, b: never) => a + b;
+let fn = (a: string, b: unknown) => a + b;
+let fn = (a: string, b: never) => a + b;
```
-### `allowAny`
+#### ✅ Correct
-Examples of code for this rule with `{ allowAny: true }`:
+```ts
+let fn = (a: number, b: undefined) => a + b;
+let fn = (a: number, b: null) => a + b;
+let fn = (a: string, b: undefined) => a + b;
+let fn = (a: string, b: null) => a + b;
+```
+
+### `allowNumberAndString`
+
+Examples of code for this rule with `{ allowNumberAndString: true }`:
#### ❌ Incorrect
```ts
-var fn = (a: any, b: boolean) => a + b;
-var fn = (a: any, b: []) => a + b;
-var fn = (a: any, b: {}) => a + b;
+let fn = (a: number, b: unknown) => a + b;
+let fn = (a: number, b: never) => a + b;
```
#### ✅ Correct
```ts
-var fn = (a: any, b: any) => a + b;
-var fn = (a: any, b: string) => a + b;
-var fn = (a: any, b: bigint) => a + b;
-var fn = (a: any, b: number) => a + b;
+let fn = (a: number, b: string) => a + b;
+let fn = (a: number, b: number | string) => a + b;
+```
+
+### `allowRegExp`
+
+Examples of code for this rule with `{ allowRegExp: true }`:
+
+
+
+#### ❌ Incorrect
+
+```ts
+let fn = (a: number, b: RegExp) => a + b;
+```
+
+#### ✅ Correct
+
+```ts
+let fn = (a: string, b: RegExp) => a + b;
+```
+
+### `skipCompoundAssignments`
+
+Examples of code for this rule with `{ skipCompoundAssignments: true }`:
+
+
+
+#### ❌ Incorrect
+
+```ts
+let foo: string | undefined;
+foo += 'some data';
+
+let bar: string = '';
+bar += 0;
+```
+
+#### ✅ Correct
+
+```ts
+let foo: number = 0;
+foo += 1;
+
+let bar = '';
+bar += 'test';
```
## When Not To Use It
diff --git a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md
index d7afae0ee26..eeb7c488160 100644
--- a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md
+++ b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md
@@ -6,9 +6,19 @@ description: 'Enforce template literal expressions to be of `string` type.'
>
> See **https://typescript-eslint.io/rules/restrict-template-expressions** for documentation.
-JavaScript will call `toString()` on an object when it is converted to a string, such as when `+` adding to a string or in `${}` template literals.
-The default Object `.toString()` returns `"[object Object]"`, which is often not what was intended.
-This rule reports on values used in a template literal string that aren't primitives and don't define a more useful `.toString()` method.
+JavaScript automatically [converts an object to a string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String#string_coercion) in a string context, such as when concatenating it with a string using `+` or embedding it in a template literal using `${}`.
+The default `toString()` method of objects returns `"[object Object]"`, which is often not what was intended.
+This rule reports on values used in a template literal string that aren't strings, numbers, or BigInts, optionally allowing other data types that provide useful stringification results.
+
+:::note
+
+This rule intentionally does not allow objects with a custom `toString()` method to be used in template literals, because the stringification result may not be user-friendly.
+
+For example, arrays have a custom [`toString()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/toString) method, which only calls `join()` internally, which joins the array elements with commas. This means that (1) array elements are not necessarily stringified to useful results (2) the commas don't have spaces after them, making the result not user-friendly. The best way to format arrays is to use [`Intl.ListFormat`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat), which even supports adding the "and" conjunction where necessary.
+You must explicitly call `object.toString()` if you want to use this object in a template literal.
+The [`no-base-to-string`](./no-base-to-string.md) rule can be used to guard this case against producing `"[object Object]"` by accident.
+
+:::
## Examples
@@ -47,6 +57,8 @@ const msg1 = `arg = ${arg}`;
const msg2 = `arg = ${arg || 'zero'}`;
```
+This option controls both numbers and BigInts.
+
### `allowBoolean`
Examples of additional **correct** code for this rule with `{ allowBoolean: true }`:
diff --git a/packages/eslint-plugin/docs/rules/sort-type-constituents.md b/packages/eslint-plugin/docs/rules/sort-type-constituents.md
index 264ef2b52df..025e31ccad4 100644
--- a/packages/eslint-plugin/docs/rules/sort-type-constituents.md
+++ b/packages/eslint-plugin/docs/rules/sort-type-constituents.md
@@ -60,18 +60,18 @@ type T2 = { a: string } & { b: string };
type T3 = [1, 2, 3] & [1, 2, 4];
type T4 =
- | any
- | string
| A
| B
| number[]
| string[]
+ | any
+ | string
| readonly number[]
| readonly string[]
| 'a'
- | 'b'
| 'a'
| 'b'
+ | 'b'
| (() => string)
| (() => void)
| { a: string }
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 edaa195df6b..00000000000
--- 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 f48f7c98497..af8fa6da529 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 36cfab06592..090ddf5f9b9 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 609eb3a7bb5..3ef37a6391a 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 53a17f6fc33..7b4715f81f7 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 fdeb10bd84a..5b2bcd96605 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -1,24 +1,31 @@
{
"name": "@typescript-eslint/eslint-plugin",
- "version": "5.56.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",
"index.d.ts",
+ "rules.d.ts",
"package.json",
"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 +35,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,43 +48,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.56.0",
- "@typescript-eslint/type-utils": "5.56.0",
- "@typescript-eslint/utils": "5.56.0",
+ "@eslint-community/regexpp": "^4.5.1",
+ "@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",
- "ignore": "^5.2.0",
+ "graphemer": "^1.4.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.4",
+ "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": "*",
- "chalk": "^5.0.1",
- "cross-fetch": "^3.1.5",
- "grapheme-splitter": "^1.0.4",
+ "@typescript-eslint/rule-schema-to-typescript-types": "6.0.0",
+ "@typescript-eslint/rule-tester": "6.0.0",
+ "ajv": "^6.12.6",
+ "chalk": "^5.3.0",
+ "cross-fetch": "*",
+ "jest-specific-snapshot": "*",
"json-schema": "*",
- "markdown-table": "^3.0.2",
- "marked": "^4.0.15",
+ "markdown-table": "^3.0.3",
+ "marked": "^5.1.1",
"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 72ca4c7a9d0..2b5c17d2ff5 100644
--- a/packages/eslint-plugin/project.json
+++ b/packages/eslint-plugin/project.json
@@ -5,10 +5,11 @@
"implicitDependencies": [],
"targets": {
"lint": {
- "executor": "@nrwl/linter:eslint",
+ "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 00000000000..9a5272d205c
--- /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 63ce9b1305a..184a241a66f 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'],
@@ -59,6 +62,7 @@ export = {
'no-dupe-class-members': 'off',
'@typescript-eslint/no-dupe-class-members': 'error',
'@typescript-eslint/no-duplicate-enum-values': 'error',
+ '@typescript-eslint/no-duplicate-type-constituents': 'error',
'@typescript-eslint/no-dynamic-delete': 'error',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'error',
@@ -104,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',
@@ -115,6 +118,7 @@ export = {
'@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-expressions': 'off',
diff --git a/packages/eslint-plugin/src/configs/base.ts b/packages/eslint-plugin/src/configs/base.ts
index 528e00c7778..628ed42b760 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 00000000000..38a7ffd079d
--- /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 af3c0050c01..d6e13341060 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 369d33d6687..00000000000
--- 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 00000000000..ab0f5039461
--- /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 10b1d04581f..d8654cd45e0 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 00000000000..dfba0b81c7f
--- /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 c63b4173452..98553e52bf7 100644
--- a/packages/eslint-plugin/src/configs/strict.ts
+++ b/packages/eslint-plugin/src/configs/strict.ts
@@ -1,47 +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/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 00000000000..5c73ae3845b
--- /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 00000000000..863a50eecda
--- /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 03899ac43cb..ece2bb0a20f 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 498a9bf5ae1..0534cc8ce0d 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 f353207e7d5..cd4a1f89cb2 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 ab9f97da7c2..fca9fd83de0 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 511a951280e..7de0718bde6 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 849fbcc911e..4453649b717 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 f21dda8a249..8352eff2f2d 100644
--- a/packages/eslint-plugin/src/rules/ban-types.ts
+++ b/packages/eslint-plugin/src/rules/ban-types.ts
@@ -5,13 +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 = [
@@ -20,7 +21,7 @@ export type Options = [
extendDefaults?: boolean;
},
];
-export type MessageIds = 'bannedTypeMessage';
+export type MessageIds = 'bannedTypeMessage' | 'bannedTypeReplacement';
function removeSpaces(str: string): string {
return str.replace(/\s/g, '');
@@ -34,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 '';
}
@@ -88,7 +89,9 @@ const defaultTypes: Types = {
'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.',
'- If you want a type meaning "any object", you probably want `object` instead.',
'- If you want a type meaning "any value", you probably want `unknown` instead.',
+ '- If you really want a type meaning "any non-nullish value", you probably want `NonNullable` instead.',
].join('\n'),
+ suggest: ['object', 'unknown', 'NonNullable'],
},
'{}': {
message: [
@@ -96,7 +99,14 @@ const defaultTypes: Types = {
'- If you want a type meaning "any object", you probably want `object` instead.',
'- If you want a type meaning "any value", you probably want `unknown` instead.',
'- If you want a type meaning "empty object", you probably want `Record` instead.',
+ '- If you really want a type meaning "any non-nullish value", you probably want `NonNullable` instead.',
].join('\n'),
+ suggest: [
+ 'object',
+ 'unknown',
+ 'Record',
+ 'NonNullable',
+ ],
},
};
@@ -120,32 +130,69 @@ export default util.createRule({
type: 'suggestion',
docs: {
description: 'Disallow certain types',
- recommended: 'error',
+ recommended: 'recommended',
},
fixable: 'code',
+ hasSuggestions: true,
messages: {
bannedTypeMessage: "Don't use `{{name}}` as a type.{{customMessage}}",
+ bannedTypeReplacement: 'Replace `{{name}}` with `{{replacement}}`.',
},
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' },
- },
- additionalProperties: false,
- },
- ],
+ $ref: '#/items/0/$defs/banConfig',
},
},
extendDefaults: {
@@ -182,6 +229,10 @@ export default util.createRule({
const customMessage = getCustomMessage(bannedType);
const fixWith =
bannedType && typeof bannedType === 'object' && bannedType.fixWith;
+ const suggest =
+ bannedType && typeof bannedType === 'object'
+ ? bannedType.suggest
+ : undefined;
context.report({
node: typeNode,
@@ -193,6 +244,15 @@ export default util.createRule({
fix: fixWith
? (fixer): TSESLint.RuleFix => fixer.replaceText(typeNode, fixWith)
: null,
+ suggest: suggest?.map(replacement => ({
+ messageId: 'bannedTypeReplacement',
+ data: {
+ name,
+ replacement,
+ },
+ fix: (fixer): TSESLint.RuleFix =>
+ fixer.replaceText(typeNode, replacement),
+ })),
});
}
@@ -227,10 +287,16 @@ export default util.createRule({
TSTypeReference(node): void {
checkBannedTypes(node.typeName);
- if (node.typeParameters) {
+ if (node.typeArguments) {
checkBannedTypes(node);
}
},
+ TSInterfaceHeritage(node): void {
+ checkBannedTypes(node);
+ },
+ TSClassImplements(node): void {
+ checkBannedTypes(node);
+ },
};
},
});
diff --git a/packages/eslint-plugin/src/rules/block-spacing.ts b/packages/eslint-plugin/src/rules/block-spacing.ts
index 745132978f7..8141a979cf0 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 43d4ba63c3c..2e471cb8853 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 ed49b144e47..bd9e0895e71 100644
--- a/packages/eslint-plugin/src/rules/class-literal-property-style.ts
+++ b/packages/eslint-plugin/src/rules/class-literal-property-style.ts
@@ -1,10 +1,14 @@
-import type { TSESTree } from '@typescript-eslint/utils';
+import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as util from '../util';
type Options = ['fields' | 'getters'];
-type MessageIds = 'preferFieldStyle' | 'preferGetterStyle';
+type MessageIds =
+ | 'preferFieldStyle'
+ | 'preferFieldStyleSuggestion'
+ | 'preferGetterStyle'
+ | 'preferGetterStyleSuggestion';
interface NodeWithModifiers {
accessibility?: TSESTree.Accessibility;
@@ -13,7 +17,7 @@ interface NodeWithModifiers {
const printNodeModifiers = (
node: NodeWithModifiers,
- final: 'readonly' | 'get',
+ final: 'get' | 'readonly',
): string =>
`${node.accessibility ?? ''}${
node.static ? ' static' : ''
@@ -43,14 +47,21 @@ export default util.createRule({
docs: {
description:
'Enforce that literals on classes are exposed in a consistent style',
- recommended: 'strict',
+ recommended: 'stylistic',
},
- fixable: 'code',
+ hasSuggestions: true,
messages: {
preferFieldStyle: 'Literals should be exposed using readonly fields.',
+ preferFieldStyleSuggestion: 'Replace the literals with readonly fields.',
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]) {
@@ -60,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;
}
@@ -80,18 +91,23 @@ export default util.createRule({
context.report({
node: node.key,
messageId: 'preferFieldStyle',
- fix(fixer) {
- const sourceCode = context.getSourceCode();
- const name = sourceCode.getText(node.key);
-
- let text = '';
-
- text += printNodeModifiers(node, 'readonly');
- text += node.computed ? `[${name}]` : name;
- text += ` = ${sourceCode.getText(argument)};`;
-
- return fixer.replaceText(node, text);
- },
+ suggest: [
+ {
+ messageId: 'preferFieldStyleSuggestion',
+ fix(fixer): TSESLint.RuleFix {
+ const sourceCode = context.getSourceCode();
+ const name = sourceCode.getText(node.key);
+
+ let text = '';
+
+ text += printNodeModifiers(node, 'readonly');
+ text += node.computed ? `[${name}]` : name;
+ text += ` = ${sourceCode.getText(argument)};`;
+
+ return fixer.replaceText(node, text);
+ },
+ },
+ ],
});
},
}),
@@ -110,18 +126,23 @@ export default util.createRule({
context.report({
node: node.key,
messageId: 'preferGetterStyle',
- fix(fixer) {
- const sourceCode = context.getSourceCode();
- const name = sourceCode.getText(node.key);
-
- let text = '';
-
- text += printNodeModifiers(node, 'get');
- text += node.computed ? `[${name}]` : name;
- text += `() { return ${sourceCode.getText(value)}; }`;
-
- return fixer.replaceText(node, text);
- },
+ suggest: [
+ {
+ messageId: 'preferGetterStyleSuggestion',
+ fix(fixer): TSESLint.RuleFix {
+ const sourceCode = context.getSourceCode();
+ const name = sourceCode.getText(node.key);
+
+ let text = '';
+
+ text += printNodeModifiers(node, 'get');
+ text += node.computed ? `[${name}]` : name;
+ text += `() { return ${sourceCode.getText(value)}; }`;
+
+ return fixer.replaceText(node, text);
+ },
+ },
+ ],
});
},
}),
diff --git a/packages/eslint-plugin/src/rules/comma-dangle.ts b/packages/eslint-plugin/src/rules/comma-dangle.ts
index 149218c4e7e..125cb47a325 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,9 @@ export default util.createRule({
'always-multiline': forceCommaIfMultiline,
'only-multiline': allowCommaIfMultiline,
never: forbidComma,
- ignore: (): void => {},
+ // https://github.com/typescript-eslint/typescript-eslint/issues/7220
+ // eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/no-empty-function
+ ignore: () => {},
};
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 a1ebcc181f2..9c6e64cfc5c 100644
--- a/packages/eslint-plugin/src/rules/comma-spacing.ts
+++ b/packages/eslint-plugin/src/rules/comma-spacing.ts
@@ -3,6 +3,8 @@ import { AST_TOKEN_TYPES } from '@typescript-eslint/utils';
import {
createRule,
+ isClosingBraceToken,
+ isClosingBracketToken,
isClosingParenToken,
isCommaToken,
isTokenOnSameLine,
@@ -14,7 +16,7 @@ type Options = [
after: boolean;
},
];
-type MessageIds = 'unexpected' | 'missing';
+type MessageIds = 'missing' | 'unexpected';
export default createRule({
name: 'comma-spacing',
@@ -22,7 +24,6 @@ export default createRule({
type: 'layout',
docs: {
description: 'Enforce consistent spacing before and after commas',
- recommended: false,
extendsBaseRule: true,
},
fixable: 'whitespace',
@@ -135,6 +136,14 @@ export default createRule({
return;
}
+ if (
+ spaceAfter &&
+ nextToken &&
+ (isClosingBraceToken(nextToken) || isClosingBracketToken(nextToken))
+ ) {
+ return;
+ }
+
if (!spaceAfter && nextToken && nextToken.type === AST_TOKEN_TYPES.Line) {
return;
}
diff --git a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts
index dfcb5d4a63d..8719d0b5dc5 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 535692f3fa8..5aece3ea480 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 66268b0adc6..9903f15e19e 100644
--- a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts
+++ b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts
@@ -1,37 +1,45 @@
-import type { TSESTree } from '@typescript-eslint/utils';
+import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
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'
+ | 'replaceObjectTypeAssertionWithAnnotation'
+ | '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',
meta: {
type: 'suggestion',
+ fixable: 'code',
+ hasSuggestions: true,
docs: {
description: 'Enforce consistent usage of type assertions',
- recommended: 'strict',
+ recommended: 'stylistic',
},
messages: {
as: "Use 'as {{cast}}' instead of '<{{cast}}>'.",
'angle-bracket': "Use '<{{cast}}>' instead of 'as {{cast}}'.",
never: 'Do not use any type assertions.',
unexpectedObjectTypeAssertion: 'Always prefer const x: T = { ... }.',
+ replaceObjectTypeAssertionWithAnnotation:
+ 'Use const x: {{cast}} = { ... } instead.',
+ replaceObjectTypeAssertionWithSatisfies:
+ 'Use const x = { ... } satisfies {{cast}} instead.',
},
schema: [
{
@@ -40,6 +48,7 @@ export default util.createRule({
type: 'object',
properties: {
assertionStyle: {
+ type: 'string',
enum: ['never'],
},
},
@@ -50,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'],
},
},
@@ -83,8 +94,30 @@ export default util.createRule({
);
}
+ function getTextWithParentheses(node: TSESTree.Node): string {
+ // Capture parentheses before and after the node
+ let beforeCount = 0;
+ let afterCount = 0;
+
+ if (util.isParenthesized(node, sourceCode)) {
+ const bodyOpeningParen = sourceCode.getTokenBefore(
+ node,
+ util.isOpeningParenToken,
+ )!;
+ const bodyClosingParen = sourceCode.getTokenAfter(
+ node,
+ util.isClosingParenToken,
+ )!;
+
+ beforeCount = node.range[0] - bodyOpeningParen.range[0];
+ afterCount = bodyClosingParen.range[1] - node.range[1];
+ }
+
+ return sourceCode.getText(node, beforeCount, afterCount);
+ }
+
function reportIncorrectAssertionType(
- node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression,
+ node: TSESTree.TSAsExpression | TSESTree.TSTypeAssertion,
): void {
const messageId = options.assertionStyle;
@@ -100,6 +133,19 @@ export default util.createRule({
messageId !== 'never'
? { cast: sourceCode.getText(node.typeAnnotation) }
: {},
+ fix:
+ messageId === 'as'
+ ? (fixer): TSESLint.RuleFix[] => [
+ fixer.replaceText(
+ node,
+ getTextWithParentheses(node.expression),
+ ),
+ fixer.insertTextAfter(
+ node,
+ ` as ${getTextWithParentheses(node.typeAnnotation)}`,
+ ),
+ ]
+ : undefined,
});
}
@@ -122,7 +168,7 @@ export default util.createRule({
}
function checkExpression(
- node: TSESTree.TSTypeAssertion | TSESTree.TSAsExpression,
+ node: TSESTree.TSAsExpression | TSESTree.TSTypeAssertion,
): void {
if (
options.assertionStyle === 'never' ||
@@ -134,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 ||
@@ -148,9 +193,42 @@ export default util.createRule({
checkType(node.typeAnnotation) &&
node.expression.type === AST_NODE_TYPES.ObjectExpression
) {
+ const suggest: TSESLint.ReportSuggestionArray = [];
+ if (
+ node.parent?.type === AST_NODE_TYPES.VariableDeclarator &&
+ !node.parent.id.typeAnnotation
+ ) {
+ const { parent } = node;
+ suggest.push({
+ messageId: 'replaceObjectTypeAssertionWithAnnotation',
+ data: { cast: sourceCode.getText(node.typeAnnotation) },
+ fix: fixer => [
+ fixer.insertTextAfter(
+ parent.id,
+ `: ${sourceCode.getText(node.typeAnnotation)}`,
+ ),
+ fixer.replaceText(node, getTextWithParentheses(node.expression)),
+ ],
+ });
+ }
+ suggest.push({
+ messageId: 'replaceObjectTypeAssertionWithSatisfies',
+ data: { cast: sourceCode.getText(node.typeAnnotation) },
+ fix: fixer => [
+ fixer.replaceText(node, getTextWithParentheses(node.expression)),
+ fixer.insertTextAfter(
+ node,
+ ` satisfies ${context
+ .getSourceCode()
+ .getText(node.typeAnnotation)}`,
+ ),
+ ],
+ });
+
context.report({
node,
messageId: 'unexpectedObjectTypeAssertion',
+ suggest,
});
}
}
diff --git a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts
index fdf7ac947c6..b504081ee4a 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 54364054690..e65451ded1d 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 4c5cf771901..dfa5e48ed65 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 ba9d5da7b4e..e76ce14fa05 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 9f0b0d1304b..d79c8fcdb5e 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
new file mode 100644
index 00000000000..e629d00e7be
--- /dev/null
+++ b/packages/eslint-plugin/src/rules/enum-utils/shared.ts
@@ -0,0 +1,40 @@
+import * as tsutils from 'ts-api-utils';
+import * as ts from 'typescript';
+
+import * as util from '../../util';
+
+/*
+ * If passed an enum member, returns the type of the parent. Otherwise,
+ * returns itself.
+ *
+ * For example:
+ * - `Fruit` --> `Fruit`
+ * - `Fruit.Apple` --> `Fruit`
+ */
+function getBaseEnumType(typeChecker: ts.TypeChecker, type: ts.Type): ts.Type {
+ const symbol = type.getSymbol()!;
+ if (!tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.EnumMember)) {
+ return type;
+ }
+
+ return typeChecker.getTypeAtLocation(symbol.valueDeclaration!.parent);
+}
+
+/**
+ * A type can have 0 or more enum types. For example:
+ * - 123 --> []
+ * - {} --> []
+ * - Fruit.Apple --> [Fruit]
+ * - Fruit.Apple | Vegetable.Lettuce --> [Fruit, Vegetable]
+ * - Fruit.Apple | Vegetable.Lettuce | 123 --> [Fruit, Vegetable]
+ * - T extends Fruit --> [Fruit]
+ */
+export function getEnumTypes(
+ typeChecker: ts.TypeChecker,
+ type: ts.Type,
+): ts.Type[] {
+ return tsutils
+ .unionTypeParts(type)
+ .filter(subType => util.isTypeFlagSet(subType, ts.TypeFlags.EnumLiteral))
+ .map(type => getBaseEnumType(typeChecker, type));
+}
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 b19ec1527ec..e57465be836 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 3fc42a956f6..d95a58dc281 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 e7552e0cbd8..1ac7e70bb9f 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 31d8fa41046..b72c54951f9 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 19796054a4c..f2f3805d800 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 e1d871103ec..f5cf92c28d1 100644
--- a/packages/eslint-plugin/src/rules/index.ts
+++ b/packages/eslint-plugin/src/rules/index.ts
@@ -37,7 +37,7 @@ 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';
import noEmptyInterface from './no-empty-interface';
@@ -48,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';
@@ -65,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';
@@ -84,6 +82,7 @@ import noUnsafeArgument from './no-unsafe-argument';
import noUnsafeAssignment from './no-unsafe-assignment';
import noUnsafeCall from './no-unsafe-call';
import noUnsafeDeclarationMerging from './no-unsafe-declaration-merging';
+import noUnsafeEnumComparison from './no-unsafe-enum-comparison';
import noUnsafeMemberAccess from './no-unsafe-member-access';
import noUnsafeReturn from './no-unsafe-return';
import noUnusedExpressions from './no-unused-expressions';
@@ -121,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';
@@ -173,7 +171,7 @@ 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,
'no-empty-interface': noEmptyInterface,
@@ -184,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,
@@ -201,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,
@@ -220,6 +216,7 @@ export default {
'no-unsafe-assignment': noUnsafeAssignment,
'no-unsafe-call': noUnsafeCall,
'no-unsafe-declaration-merging': noUnsafeDeclarationMerging,
+ 'no-unsafe-enum-comparison': noUnsafeEnumComparison,
'no-unsafe-member-access': noUnsafeMemberAccess,
'no-unsafe-return': noUnsafeReturn,
'no-unused-expressions': noUnusedExpressions,
@@ -257,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 27bdf3c75a5..fabbe73898a 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 2d4d3f5c11d..096f3b7493e 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 aa09fb3d1b8..893c70db767 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 478667040c5..f7cdef33b2e 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 2f37b365dae..e88e42d477a 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 53d2019e97d..e0055a385e1 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 cadd1023058..29b748e88cf 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 93b21408511..ee8ea18ebf8 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 02900ab1d8b..1b26c18ecb2 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 c4e6e36b303..945777dd7fb 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 ff91d2e156d..2cb6d9fed62 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 9772f91ced8..a1d63d31bad 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 d5c15994b8b..fd0910050e0 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 c2b87ccc33b..4c80a167a0f 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 1c6c0ae31d1..d3e52d377cf 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 2b6105890ea..fc71f275d7c 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 8b8521491f2..9d74c87117c 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 6268a9e6c75..5e91950ed20 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 62945ac689b..66ac9e28c51 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 62c1a8feb80..95689cae513 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 4bb011d1234..8aeb1c4200b 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 c84fd26468f..00000000000
--- 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
new file mode 100644
index 00000000000..c6e31acf586
--- /dev/null
+++ b/packages/eslint-plugin/src/rules/no-duplicate-type-constituents.ts
@@ -0,0 +1,207 @@
+import type { TSESTree } from '@typescript-eslint/utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
+import type { Type } from 'typescript';
+
+import * as util from '../util';
+
+export type Options = [
+ {
+ ignoreIntersections?: boolean;
+ ignoreUnions?: boolean;
+ },
+];
+
+export type MessageIds = 'duplicate';
+
+const astIgnoreKeys = new Set(['range', 'loc', 'parent']);
+
+const isSameAstNode = (actualNode: unknown, expectedNode: unknown): boolean => {
+ if (actualNode === expectedNode) {
+ return true;
+ }
+ if (
+ actualNode &&
+ expectedNode &&
+ typeof actualNode === 'object' &&
+ typeof expectedNode === 'object'
+ ) {
+ if (Array.isArray(actualNode) && Array.isArray(expectedNode)) {
+ if (actualNode.length !== expectedNode.length) {
+ return false;
+ }
+ return !actualNode.some(
+ (nodeEle, index) => !isSameAstNode(nodeEle, expectedNode[index]),
+ );
+ }
+ const actualNodeKeys = Object.keys(actualNode).filter(
+ key => !astIgnoreKeys.has(key),
+ );
+ const expectedNodeKeys = Object.keys(expectedNode).filter(
+ key => !astIgnoreKeys.has(key),
+ );
+ if (actualNodeKeys.length !== expectedNodeKeys.length) {
+ return false;
+ }
+ if (
+ actualNodeKeys.some(
+ actualNodeKey =>
+ !Object.prototype.hasOwnProperty.call(expectedNode, actualNodeKey),
+ )
+ ) {
+ return false;
+ }
+ if (
+ actualNodeKeys.some(
+ actualNodeKey =>
+ !isSameAstNode(
+ actualNode[actualNodeKey as keyof typeof actualNode],
+ expectedNode[actualNodeKey as keyof typeof expectedNode],
+ ),
+ )
+ ) {
+ return false;
+ }
+ return true;
+ }
+ return false;
+};
+
+export default util.createRule({
+ name: 'no-duplicate-type-constituents',
+ meta: {
+ type: 'suggestion',
+ docs: {
+ description:
+ 'Disallow duplicate constituents of union or intersection types',
+ recommended: 'recommended',
+ requiresTypeChecking: true,
+ },
+ fixable: 'code',
+ messages: {
+ duplicate: '{{type}} type constituent is duplicated with {{previous}}.',
+ },
+ schema: [
+ {
+ additionalProperties: false,
+ type: 'object',
+ properties: {
+ ignoreIntersections: {
+ type: 'boolean',
+ },
+ ignoreUnions: {
+ type: 'boolean',
+ },
+ },
+ },
+ ],
+ },
+ defaultOptions: [
+ {
+ ignoreIntersections: false,
+ ignoreUnions: false,
+ },
+ ],
+ create(context, [{ ignoreIntersections, ignoreUnions }]) {
+ const parserServices = util.getParserServices(context);
+ const checker = parserServices.program.getTypeChecker();
+
+ function checkDuplicate(
+ node: TSESTree.TSIntersectionType | TSESTree.TSUnionType,
+ ): void {
+ const cachedTypeMap = new Map();
+ node.types.reduce(
+ (uniqueConstituents, constituentNode) => {
+ const duplicatedPreviousConstituentInAst = uniqueConstituents.find(
+ ele => isSameAstNode(ele, constituentNode),
+ );
+ if (duplicatedPreviousConstituentInAst) {
+ reportDuplicate(
+ {
+ duplicated: constituentNode,
+ duplicatePrevious: duplicatedPreviousConstituentInAst,
+ },
+ node,
+ );
+ return uniqueConstituents;
+ }
+ const constituentNodeType = checker.getTypeAtLocation(
+ parserServices.esTreeNodeToTSNodeMap.get(constituentNode),
+ );
+ const duplicatedPreviousConstituentInType =
+ cachedTypeMap.get(constituentNodeType);
+ if (duplicatedPreviousConstituentInType) {
+ reportDuplicate(
+ {
+ duplicated: constituentNode,
+ duplicatePrevious: duplicatedPreviousConstituentInType,
+ },
+ node,
+ );
+ return uniqueConstituents;
+ }
+ cachedTypeMap.set(constituentNodeType, constituentNode);
+ return [...uniqueConstituents, constituentNode];
+ },
+ [],
+ );
+ }
+ function reportDuplicate(
+ duplicateConstituent: {
+ duplicated: TSESTree.TypeNode;
+ duplicatePrevious: TSESTree.TypeNode;
+ },
+ parentNode: TSESTree.TSIntersectionType | TSESTree.TSUnionType,
+ ): void {
+ const sourceCode = context.getSourceCode();
+ const beforeTokens = sourceCode.getTokensBefore(
+ duplicateConstituent.duplicated,
+ { filter: token => token.value === '|' || token.value === '&' },
+ );
+ const beforeUnionOrIntersectionToken =
+ beforeTokens[beforeTokens.length - 1];
+ const bracketBeforeTokens = sourceCode.getTokensBetween(
+ beforeUnionOrIntersectionToken,
+ duplicateConstituent.duplicated,
+ );
+ const bracketAfterTokens = sourceCode.getTokensAfter(
+ duplicateConstituent.duplicated,
+ { count: bracketBeforeTokens.length },
+ );
+ const reportLocation: TSESTree.SourceLocation = {
+ start: duplicateConstituent.duplicated.loc.start,
+ end:
+ bracketAfterTokens.length > 0
+ ? bracketAfterTokens[bracketAfterTokens.length - 1].loc.end
+ : duplicateConstituent.duplicated.loc.end,
+ };
+ context.report({
+ data: {
+ type:
+ parentNode.type === AST_NODE_TYPES.TSIntersectionType
+ ? 'Intersection'
+ : 'Union',
+ previous: sourceCode.getText(duplicateConstituent.duplicatePrevious),
+ },
+ messageId: 'duplicate',
+ node: duplicateConstituent.duplicated,
+ loc: reportLocation,
+ fix: fixer => {
+ return [
+ beforeUnionOrIntersectionToken,
+ ...bracketBeforeTokens,
+ duplicateConstituent.duplicated,
+ ...bracketAfterTokens,
+ ].map(token => fixer.remove(token));
+ },
+ });
+ }
+ return {
+ ...(!ignoreIntersections && {
+ TSIntersectionType: checkDuplicate,
+ }),
+ ...(!ignoreUnions && {
+ TSUnionType: checkDuplicate,
+ }),
+ };
+ },
+});
diff --git a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts
index 09d5b5420d8..0d1127f8a92 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 a78e4b86db4..e77981eab30 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 d74034114bb..12499f3b95c 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 65b253a8a33..fd2ddeefbe2 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 a69cd262d6e..082c3d212a6 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 a44276a0a76..b3a150ad201 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 6fcfb4871ee..d2860771c53 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 b7b93c8c77c..21dda4c686d 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 c4ce3db8e1c..b0a34e03340 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';
@@ -16,8 +16,20 @@ type Options = [
type MessageId =
| 'floating'
| 'floatingVoid'
- | 'floatingFixVoid'
- | 'floatingFixAwait';
+ | 'floatingUselessRejectionHandler'
+ | 'floatingUselessRejectionHandlerVoid'
+ | 'floatingFixAwait'
+ | 'floatingFixVoid';
+
+const messageBase =
+ 'Promises must be awaited, end with a call to .catch, or end with a call to .then with a rejection handler.';
+
+const messageBaseVoid =
+ 'Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler' +
+ ' or be explicitly marked as ignored with the `void` operator.';
+
+const messageRejectionHandler =
+ 'A rejection handler that is not a function will be ignored.';
export default util.createRule({
name: 'no-floating-promises',
@@ -25,18 +37,19 @@ export default util.createRule({
docs: {
description:
'Require Promise-like statements to be handled appropriately',
- recommended: 'error',
+ recommended: 'recommended',
requiresTypeChecking: true,
},
hasSuggestions: true,
messages: {
- floating:
- 'Promises must be awaited, end with a call to .catch, or end with a call to .then with a rejection handler.',
+ floating: messageBase,
floatingFixAwait: 'Add await operator.',
- floatingVoid:
- 'Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler' +
- ' or be explicitly marked as ignored with the `void` operator.',
+ floatingVoid: messageBaseVoid,
floatingFixVoid: 'Add void operator to ignore.',
+ floatingUselessRejectionHandler:
+ messageBase + ' ' + messageRejectionHandler,
+ floatingUselessRejectionHandlerVoid:
+ messageBaseVoid + ' ' + messageRejectionHandler,
},
schema: [
{
@@ -48,7 +61,7 @@ export default util.createRule({
},
ignoreIIFE: {
description:
- 'Whether to ignore async IIFEs (Immediately Invocated Function Expressions).',
+ 'Whether to ignore async IIFEs (Immediately Invoked Function Expressions).',
type: 'boolean',
},
},
@@ -65,8 +78,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 {
@@ -80,16 +93,23 @@ export default util.createRule({
expression = expression.expression;
}
- if (isUnhandledPromise(checker, expression)) {
+ const { isUnhandled, nonFunctionHandler } = isUnhandledPromise(
+ checker,
+ expression,
+ );
+
+ if (isUnhandled) {
if (options.ignoreVoid) {
context.report({
node,
- messageId: 'floatingVoid',
+ messageId: nonFunctionHandler
+ ? 'floatingUselessRejectionHandlerVoid'
+ : 'floatingVoid',
suggest: [
{
messageId: 'floatingFixVoid',
fix(fixer): TSESLint.RuleFix | TSESLint.RuleFix[] {
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(
+ const tsNode = services.esTreeNodeToTSNodeMap.get(
node.expression,
);
if (isHigherPrecedenceThanUnary(tsNode)) {
@@ -110,7 +130,9 @@ export default util.createRule({
} else {
context.report({
node,
- messageId: 'floating',
+ messageId: nonFunctionHandler
+ ? 'floatingUselessRejectionHandler'
+ : 'floating',
suggest: [
{
messageId: 'floatingFixAwait',
@@ -124,7 +146,7 @@ export default util.createRule({
'await',
);
}
- const tsNode = parserServices.esTreeNodeToTSNodeMap.get(
+ const tsNode = services.esTreeNodeToTSNodeMap.get(
node.expression,
);
if (isHigherPrecedenceThanUnary(tsNode)) {
@@ -148,7 +170,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);
@@ -168,16 +190,31 @@ export default util.createRule({
);
}
+ function isValidRejectionHandler(rejectionHandler: TSESTree.Node): boolean {
+ return (
+ services.program
+ .getTypeChecker()
+ .getTypeAtLocation(
+ services.esTreeNodeToTSNodeMap.get(rejectionHandler),
+ )
+ .getCallSignatures().length > 0
+ );
+ }
+
function isUnhandledPromise(
checker: ts.TypeChecker,
node: TSESTree.Node,
- ): boolean {
+ ): { isUnhandled: boolean; nonFunctionHandler?: boolean } {
// First, check expressions whose resulting types may not be promise-like
if (node.type === AST_NODE_TYPES.SequenceExpression) {
// Any child in a comma expression could return a potentially unhandled
// promise, so we check them all regardless of whether the final returned
// value is promise-like.
- return node.expressions.some(item => isUnhandledPromise(checker, item));
+ return (
+ node.expressions
+ .map(item => isUnhandledPromise(checker, item))
+ .find(result => result.isUnhandled) ?? { isUnhandled: false }
+ );
}
if (
@@ -191,27 +228,50 @@ 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))
- ) {
- return false;
+ if (!isPromiseLike(checker, services.esTreeNodeToTSNodeMap.get(node))) {
+ return { isUnhandled: false };
}
if (node.type === AST_NODE_TYPES.CallExpression) {
- // If the outer expression is a call, it must be either a `.then()` or
- // `.catch()` that handles the promise.
- return (
- !isPromiseCatchCallWithHandler(node) &&
- !isPromiseThenCallWithRejectionHandler(node) &&
- !isPromiseFinallyCallWithHandler(node)
- );
+ // If the outer expression is a call, a `.catch()` or `.then()` with
+ // rejection handler handles the promise.
+
+ const catchRejectionHandler = getRejectionHandlerFromCatchCall(node);
+ if (catchRejectionHandler) {
+ if (isValidRejectionHandler(catchRejectionHandler)) {
+ return { isUnhandled: false };
+ } else {
+ return { isUnhandled: true, nonFunctionHandler: true };
+ }
+ }
+
+ const thenRejectionHandler = getRejectionHandlerFromThenCall(node);
+ if (thenRejectionHandler) {
+ if (isValidRejectionHandler(thenRejectionHandler)) {
+ return { isUnhandled: false };
+ } else {
+ return { isUnhandled: true, nonFunctionHandler: true };
+ }
+ }
+
+ // `x.finally()` is transparent to resolution of the promise, so check `x`.
+ // ("object" in this context is the `x` in `x.finally()`)
+ const promiseFinallyObject = getObjectFromFinallyCall(node);
+ if (promiseFinallyObject) {
+ return isUnhandledPromise(checker, promiseFinallyObject);
+ }
+
+ // All other cases are unhandled.
+ return { isUnhandled: true };
} else if (node.type === AST_NODE_TYPES.ConditionalExpression) {
// We must be getting the promise-like value from one of the branches of the
// ternary. Check them directly.
- return (
- isUnhandledPromise(checker, node.alternate) ||
- isUnhandledPromise(checker, node.consequent)
- );
+ const alternateResult = isUnhandledPromise(checker, node.alternate);
+ if (alternateResult.isUnhandled) {
+ return alternateResult;
+ } else {
+ return isUnhandledPromise(checker, node.consequent);
+ }
} else if (
node.type === AST_NODE_TYPES.MemberExpression ||
node.type === AST_NODE_TYPES.Identifier ||
@@ -220,18 +280,20 @@ export default util.createRule({
// If it is just a property access chain or a `new` call (e.g. `foo.bar` or
// `new Promise()`), the promise is not handled because it doesn't have the
// necessary then/catch call at the end of the chain.
- return true;
+ return { isUnhandled: true };
} else if (node.type === AST_NODE_TYPES.LogicalExpression) {
- return (
- isUnhandledPromise(checker, node.left) ||
- isUnhandledPromise(checker, node.right)
- );
+ const leftResult = isUnhandledPromise(checker, node.left);
+ if (leftResult.isUnhandled) {
+ return leftResult;
+ } else {
+ return isUnhandledPromise(checker, node.right);
+ }
}
// We conservatively return false for all other types of expressions because
// we don't want to accidentally fail if the promise is handled internally but
// we just can't tell.
- return false;
+ return { isUnhandled: false };
}
},
});
@@ -293,35 +355,42 @@ function isFunctionParam(
return false;
}
-function isPromiseCatchCallWithHandler(
+function getRejectionHandlerFromCatchCall(
expression: TSESTree.CallExpression,
-): boolean {
- return (
+): TSESTree.CallExpressionArgument | undefined {
+ if (
expression.callee.type === AST_NODE_TYPES.MemberExpression &&
expression.callee.property.type === AST_NODE_TYPES.Identifier &&
expression.callee.property.name === 'catch' &&
expression.arguments.length >= 1
- );
+ ) {
+ return expression.arguments[0];
+ } else {
+ return undefined;
+ }
}
-function isPromiseThenCallWithRejectionHandler(
+function getRejectionHandlerFromThenCall(
expression: TSESTree.CallExpression,
-): boolean {
- return (
+): TSESTree.CallExpressionArgument | undefined {
+ if (
expression.callee.type === AST_NODE_TYPES.MemberExpression &&
expression.callee.property.type === AST_NODE_TYPES.Identifier &&
expression.callee.property.name === 'then' &&
expression.arguments.length >= 2
- );
+ ) {
+ return expression.arguments[1];
+ } else {
+ return undefined;
+ }
}
-function isPromiseFinallyCallWithHandler(
+function getObjectFromFinallyCall(
expression: TSESTree.CallExpression,
-): boolean {
- return (
- expression.callee.type === AST_NODE_TYPES.MemberExpression &&
+): TSESTree.Expression | undefined {
+ return expression.callee.type === AST_NODE_TYPES.MemberExpression &&
expression.callee.property.type === AST_NODE_TYPES.Identifier &&
- expression.callee.property.name === 'finally' &&
- expression.arguments.length >= 1
- );
+ expression.callee.property.name === 'finally'
+ ? expression.callee.object
+ : undefined;
}
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 34590d4e569..ab6e9832165 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 bed757b8072..00000000000
--- 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 d88cd05ff6f..0560d7647c4 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 941aa93e72a..0e814a0ca48 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 1bc83c07c70..54823f7be39 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 36236d0b4af..c1acdb24fe7 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 9f938ac438f..4808a439f5a 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 9e24cef086c..f4e4b50825c 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 2c0d84364e4..8a07f975ab1 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 604e82d2186..92a03c9078d 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