diff --git a/.all-contributorsrc b/.all-contributorsrc
index 3223dd887fc0..9302be7a782e 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -58,6 +58,13 @@
"profile": "https://github.com/G-Rath",
"contributions": []
},
+ {
+ "login": "JoshuaKGoldberg",
+ "name": "Josh Goldberg",
+ "avatar_url": "https://avatars.githubusercontent.com/u/3335181?v=4",
+ "profile": "https://github.com/JoshuaKGoldberg",
+ "contributions": []
+ },
{
"login": "nzakas",
"name": "Nicholas C. Zakas",
@@ -73,10 +80,10 @@
"contributions": []
},
{
- "login": "JoshuaKGoldberg",
- "name": "Josh Goldberg",
- "avatar_url": "https://avatars.githubusercontent.com/u/3335181?v=4",
- "profile": "https://github.com/JoshuaKGoldberg",
+ "login": "yeonjuan",
+ "name": "YeonJuan",
+ "avatar_url": "https://avatars.githubusercontent.com/u/41323220?v=4",
+ "profile": "https://github.com/yeonjuan",
"contributions": []
},
{
@@ -87,10 +94,10 @@
"contributions": []
},
{
- "login": "yeonjuan",
- "name": "YeonJuan",
- "avatar_url": "https://avatars.githubusercontent.com/u/41323220?v=4",
- "profile": "https://github.com/yeonjuan",
+ "login": "phaux",
+ "name": "Nikita Stefaniak",
+ "avatar_url": "https://avatars.githubusercontent.com/u/1270987?v=4",
+ "profile": "https://github.com/phaux",
"contributions": []
},
{
@@ -135,13 +142,6 @@
"profile": "https://github.com/mysticatea",
"contributions": []
},
- {
- "login": "phaux",
- "name": "Nikita Stefaniak",
- "avatar_url": "https://avatars.githubusercontent.com/u/1270987?v=4",
- "profile": "https://github.com/phaux",
- "contributions": []
- },
{
"login": "azz",
"name": "Lucas Azzola",
@@ -170,6 +170,13 @@
"profile": "https://github.com/macklinu",
"contributions": []
},
+ {
+ "login": "JounQin",
+ "name": "JounQin",
+ "avatar_url": "https://avatars.githubusercontent.com/u/8336744?v=4",
+ "profile": "https://github.com/JounQin",
+ "contributions": []
+ },
{
"login": "lukyth",
"name": "Kanitkorn Sujautra",
@@ -207,7 +214,7 @@
},
{
"login": "ldrick",
- "name": "Ricky Lippmann",
+ "name": "ldrick",
"avatar_url": "https://avatars.githubusercontent.com/u/3674067?v=4",
"profile": "https://github.com/ldrick",
"contributions": []
@@ -352,6 +359,20 @@
"profile": "https://github.com/timkraut",
"contributions": []
},
+ {
+ "login": "magurotuna",
+ "name": "Yusuke Tanaka",
+ "avatar_url": "https://avatars.githubusercontent.com/u/23649474?v=4",
+ "profile": "https://github.com/magurotuna",
+ "contributions": []
+ },
+ {
+ "login": "Zzzen",
+ "name": "Zzzen",
+ "avatar_url": "https://avatars.githubusercontent.com/u/6630042?v=4",
+ "profile": "https://github.com/Zzzen",
+ "contributions": []
+ },
{
"login": "koooge",
"name": "koooge",
diff --git a/.eslintignore b/.eslintignore
index 3c9816ccb5cc..255b369df6b0 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -7,3 +7,6 @@ coverage
__snapshots__
packages/eslint-plugin-tslint/tests
+
+# Files copied as part of the build
+packages/types/src/ast-spec.ts
diff --git a/.eslintrc.js b/.eslintrc.js
index 5d944cceacbe..c02abfbd7a8d 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -7,6 +7,7 @@ module.exports = {
'import',
'eslint-comments',
'@typescript-eslint/internal',
+ 'simple-import-sort',
],
env: {
es6: true,
@@ -261,5 +262,27 @@ module.exports = {
'@typescript-eslint/internal/prefer-ast-types-enum': 'off',
},
},
+ // ast spec specific standardization
+ {
+ files: ['packages/ast-spec/src/**/*.ts'],
+ rules: {
+ '@typescript-eslint/consistent-type-imports': [
+ 'error',
+ { prefer: 'type-imports', disallowTypeAnnotations: true },
+ ],
+ '@typescript-eslint/no-unused-vars': 'error',
+ '@typescript-eslint/sort-type-union-intersection-members': 'error',
+ 'import/first': 'error',
+ 'import/newline-after-import': 'error',
+ 'import/no-duplicates': 'error',
+ 'simple-import-sort/imports': 'error',
+ },
+ },
+ {
+ files: ['rollup.config.ts'],
+ rules: {
+ 'import/no-default-export': 'off',
+ },
+ },
],
};
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0cae9596da6e..9e1a349e5aa3 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -32,7 +32,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- - uses: actions/cache@v1
+ - uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -74,7 +74,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- - uses: actions/cache@v1
+ - uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -160,7 +160,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- - uses: actions/cache@v1
+ - uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -203,7 +203,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- - uses: actions/cache@v1
+ - uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -242,7 +242,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- - uses: actions/cache@v1
+ - uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -324,7 +324,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- - uses: actions/cache@v1
+ - uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
diff --git a/.github/workflows/generate-contributors.yml b/.github/workflows/generate-contributors.yml
index fed052364bc0..c45a78430669 100644
--- a/.github/workflows/generate-contributors.yml
+++ b/.github/workflows/generate-contributors.yml
@@ -1,7 +1,8 @@
name: "Generate contributors"
on:
- workflow_dispatch:
+ schedule:
+ - cron: "0 0 1 * *"
env:
PRIMARY_NODE_VERSION: 12
@@ -21,7 +22,7 @@ jobs:
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- - uses: actions/cache@v1
+ - uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
diff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.yml
deleted file mode 100644
index 327d5947236a..000000000000
--- a/.github/workflows/manual-release.yml
+++ /dev/null
@@ -1,65 +0,0 @@
-# This workflow is used on the rare occassion we need to manually cut a release.
-# It can be triggered via the Github UI or the Github API.
-
-name: Manual publish to Github Releases and NPM
-
-on:
- workflow_dispatch:
-
-jobs:
- release:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2
- with:
- # Check out as an admin to allow for pushing back to master
- token: ${{ secrets.JAMES_HENRY_GH_TOKEN }}
- # Check out the branch that was specified as part of the trigger
- ref: ${{ github.ref }}
- # We need to fetch all tags and branches
- fetch-depth: 0
-
- - name: Verify head of master hasn't changed
- run: |
- # We ensure that the latest commit on master is still the one we expected when
- # we started the release job, otherwise we exit
- if [ "$GITHUB_SHA" != "$(git rev-parse --verify HEAD)" ]; then
- echo "ERROR: The commit SHA at the HEAD of master has changed"
- echo "Expected: $GITHUB_SHA"
- echo "Actual: $(git rev-parse --verify HEAD)"
- exit 1;
- fi
-
- - name: Get yarn cache directory path
- id: yarn-cache-dir-path
- run: echo "::set-output name=dir::$(yarn cache dir)"
-
- - uses: actions/cache@v2
- id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
- with:
- path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
- key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
- restore-keys: |
- ${{ runner.os }}-yarn-
-
- - name: Install dependencies
- run: |
- yarn --ignore-engines --frozen-lockfile --ignore-scripts
- yarn check:clean-workspace-after-install
-
- - name: Run build
- run: |
- yarn build
-
- - name: Determine what version to release and publish to Github (--yes skips the confirmation prompt)
- run: |
- # Required for github release to work
- git config user.name 'James Henry'
- git config user.email 'james@henry.sc'
-
- GH_TOKEN=${{ secrets.JAMES_HENRY_GH_TOKEN }} npx lerna version --loglevel=silly --yes --conventional-commits --exact --force-publish --github-release -m "chore: publish %s"
-
- - name: Publish the updated versions to NPM (--yes skips the confirmation prompt)
- run: npx lerna publish from-package --yes
- env:
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
diff --git a/.gitignore b/.gitignore
index b7d08022ef73..95ec54effa37 100644
--- a/.gitignore
+++ b/.gitignore
@@ -67,3 +67,7 @@ dist
_ts3.4
*.tsbuildinfo
.watchmanconfig
+.rollup.cache
+
+# Files copied as part of the build
+packages/types/src/ast-spec.ts
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 20830a2fa0b8..f0677068d037 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -13,8 +13,8 @@
// typescript auto-format settings
"typescript.tsdk": "node_modules/typescript/lib",
- "javascript.preferences.importModuleSpecifier": "auto",
- "typescript.preferences.importModuleSpecifier": "auto",
+ "javascript.preferences.importModuleSpecifier": "project-relative",
+ "typescript.preferences.importModuleSpecifier": "project-relative",
"javascript.preferences.quoteStyle": "single",
"typescript.preferences.quoteStyle": "single",
"editor.defaultFormatter": "esbenp.prettier-vscode",
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0a1c7c9bdf60..288eede8e2cd 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,23 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Bug Fixes
+
+* **scope-manager:** fix visiting TSAsExpression in assignment ([#3355](https://github.com/typescript-eslint/typescript-eslint/issues/3355)) ([87521a0](https://github.com/typescript-eslint/typescript-eslint/commit/87521a024103bc5fc643861649bee9a288f55b7b))
+
+
+### Features
+
+* **experimental-utils:** Include `getCwd()` in `RuleContext` type ([#3308](https://github.com/typescript-eslint/typescript-eslint/issues/3308)) ([2b75c11](https://github.com/typescript-eslint/typescript-eslint/commit/2b75c11d69bee88ca0cb77d7efd32b8d0387e6b3))
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/typescript-eslint
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 5616c037282c..0a2e0963cfcc 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -16,75 +16,81 @@ Thanks goes to these wonderful people ([emoji key](https://github.com/all-contri
 Patricio Trevino
|
 Gareth Jones
|
+  Josh Goldberg
|
 Nicholas C. Zakas
|
 Jed Fox
|
-  Josh Goldberg
|
-  Ben Lichtman
|
 YeonJuan
|
+  Ben Lichtman
|
+  Nikita Stefaniak
|
 Scott O'Hara
|
 Retsam
|
-  Sosuke Suzuki
|
+  Sosuke Suzuki
|
 Kai Cataldo
|
 Rasmus Eneman
|
 Toru Nagashima
|
-  Nikita Stefaniak
|
 Lucas Azzola
|
 Danny Fritz
|
 Ika
|
 mackie
|
+  JounQin
|
 Kanitkorn Sujautra
|
-  cherryblossom000
|
+  cherryblossom000
|
 Simen Bekkhus
|
 Anix
|
 Pete Gonzalez
|
-  Ricky Lippmann
|
-  Susisu
|
+  ldrick
|
+  Susisu
|
 G r e y
|
 Gavin Barron
|
 Kevin Partington
|
 Lucas Duailibe
|
-  Validark
|
+  Validark
|
 Pavel Birukov
|
 Shahar Dawn Or
|
 ulrichb
|
 Daniil Dubrava
|
-  Daniel Nixon
|
+  Daniel Nixon
|
 Denys Kniazevych
|
 Dimitri Mitropoulos
|
 Ian MacLeod
|
 Jonathan Delgado
|
-  Philipp A.
|
+  Philipp A.
|
 Pig Fang
|
 Tadhg McDonald-Jensen
|
 Thomas den Hollander
|
 Tim Kraut
|
-  koooge
|
+  Yusuke Tanaka
|
+  Zzzen
|
+  koooge
|
 thomas michael wallace
|
 Bence Dányi
|
+
+
 Soobin Bak
|
+
This list is auto-generated using `yarn generate-contributors`. It shows the top 100 contributors with > 3 contributions.
diff --git a/lerna.json b/lerna.json
index 559d00dca269..222524221fd6 100644
--- a/lerna.json
+++ b/lerna.json
@@ -1,5 +1,5 @@
{
- "version": "4.22.1",
+ "version": "4.23.0",
"npmClient": "yarn",
"useWorkspaces": true,
"stream": true
diff --git a/package.json b/package.json
index 431c13ac5668..4464751bb450 100644
--- a/package.json
+++ b/package.json
@@ -17,7 +17,7 @@
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
},
"scripts": {
- "build": "lerna run build",
+ "build": "lerna run build --ignore ast-spec",
"check:clean-workspace-after-install": "git diff --quiet --exit-code",
"check:configs": "lerna run check:configs",
"check:docs": "lerna run check:docs",
@@ -83,7 +83,7 @@
"@types/jest-specific-snapshot": "^0.5.5",
"@types/lodash": "^4.14.149",
"@types/marked": "^2.0.0",
- "@types/node": "^14.14.27",
+ "@types/node": "^15.0.2",
"@types/node-fetch": "^2.5.10",
"@types/prettier": "^2.2.1",
"@types/rimraf": "^3.0.0",
@@ -98,6 +98,7 @@
"eslint-plugin-eslint-plugin": "^3.0.0",
"eslint-plugin-import": "^2.22.0",
"eslint-plugin-jest": "^24.1.3",
+ "eslint-plugin-simple-import-sort": "^7.0.0",
"glob": "^7.1.6",
"husky": "^5.0.9",
"jest": "^26.6.3",
diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md
new file mode 100644
index 000000000000..d892d6b7659d
--- /dev/null
+++ b/packages/ast-spec/CHANGELOG.md
@@ -0,0 +1,11 @@
+# Change Log
+
+All notable changes to this project will be documented in this file.
+See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Features
+
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
diff --git a/packages/ast-spec/LICENSE b/packages/ast-spec/LICENSE
new file mode 100644
index 000000000000..7e7370143b26
--- /dev/null
+++ b/packages/ast-spec/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 TypeScript ESLint and other contributors
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/packages/ast-spec/README.md b/packages/ast-spec/README.md
new file mode 100644
index 000000000000..7c954398395b
--- /dev/null
+++ b/packages/ast-spec/README.md
@@ -0,0 +1,24 @@
+TypeScript-ESTree AST Specification
+
+
+
+
+
+
+
+This is the complete specification for the TypeScript-ESTree AST.
+
+It includes:
+
+- Node definitions as TypeScript types (the specification)
+- Logic for converting from the TypeScript AST to the TypeScript-ESTree AST.
+- Tests/Fixtures/Examples for each Node
+
+**You probably don't want to use it directly.**
+
+If you're building an ESLint plugin, consider using [`@typescript-eslint/experimental-utils`](../experimental-utils).
+If you're parsing TypeScript code, consider using [`@typescript-eslint/typescript-estree`](../typescript-estree).
+
+## Contributing
+
+[See the contributing guide here](../../CONTRIBUTING.md)
diff --git a/packages/ast-spec/api-extractor.json b/packages/ast-spec/api-extractor.json
new file mode 100644
index 000000000000..f474f3bf26fd
--- /dev/null
+++ b/packages/ast-spec/api-extractor.json
@@ -0,0 +1,31 @@
+{
+ "mainEntryPointFilePath": "/dist/index.d.ts",
+ "apiReport": {
+ "enabled": false
+ },
+ "docModel": {
+ "enabled": false
+ },
+ "dtsRollup": {
+ "enabled": true,
+ "untrimmedFilePath": "/dist/ast-spec.ts"
+ },
+ "tsdocMetadata": {
+ "enabled": false
+ },
+ "messages": {
+ "extractorMessageReporting": {
+ "default": {
+ "logLevel": "none"
+ },
+ "ae-forgotten-export": {
+ "logLevel": "none"
+ }
+ },
+ "tsdocMessageReporting": {
+ "default": {
+ "logLevel": "none"
+ }
+ }
+ }
+}
diff --git a/packages/ast-spec/jest.config.js b/packages/ast-spec/jest.config.js
new file mode 100644
index 000000000000..c23ca67fbc68
--- /dev/null
+++ b/packages/ast-spec/jest.config.js
@@ -0,0 +1,20 @@
+'use strict';
+
+// @ts-check
+/** @type {import('@jest/types').Config.InitialOptions} */
+module.exports = {
+ globals: {
+ 'ts-jest': {
+ isolatedModules: true,
+ },
+ },
+ testEnvironment: 'node',
+ transform: {
+ ['^.+\\.tsx?$']: 'ts-jest',
+ },
+ testRegex: ['./tests/.+\\.test\\.ts$'],
+ collectCoverage: false,
+ collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
+ moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'],
+ coverageReporters: ['text-summary', 'lcov'],
+};
diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json
new file mode 100644
index 000000000000..646db4030555
--- /dev/null
+++ b/packages/ast-spec/package.json
@@ -0,0 +1,46 @@
+{
+ "name": "@typescript-eslint/ast-spec",
+ "version": "4.23.0",
+ "description": "TypeScript-ESTree AST spec",
+ "private": true,
+ "keywords": [
+ "eslint",
+ "typescript",
+ "estree"
+ ],
+ "engines": {
+ "node": "^8.10.0 || ^10.13.0 || >=11.10.1"
+ },
+ "files": [
+ "dist",
+ "package.json",
+ "README.md",
+ "LICENSE"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/typescript-eslint/typescript-eslint.git",
+ "directory": "packages/ast-spec"
+ },
+ "bugs": {
+ "url": "https://github.com/typescript-eslint/typescript-eslint/issues"
+ },
+ "license": "MIT",
+ "main": "dist/index.js",
+ "types": "dist/index.d.ts",
+ "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",
+ "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
+ "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
+ "typecheck": "tsc -p tsconfig.json --noEmit"
+ },
+ "funding": {
+ "type": "opencollective",
+ "url": "https://opencollective.com/typescript-eslint"
+ },
+ "devDependencies": {
+ "@microsoft/api-extractor": "^7.13.2"
+ }
+}
diff --git a/packages/types/src/ast-node-types.ts b/packages/ast-spec/src/ast-node-types.ts
similarity index 88%
rename from packages/types/src/ast-node-types.ts
rename to packages/ast-spec/src/ast-node-types.ts
index f233d60f8aeb..6aa0087d5eb2 100644
--- a/packages/types/src/ast-node-types.ts
+++ b/packages/ast-spec/src/ast-node-types.ts
@@ -1,4 +1,4 @@
-enum AST_NODE_TYPES {
+export enum AST_NODE_TYPES {
ArrayExpression = 'ArrayExpression',
ArrayPattern = 'ArrayPattern',
ArrowFunctionExpression = 'ArrowFunctionExpression',
@@ -164,23 +164,3 @@ enum AST_NODE_TYPES {
TSUnknownKeyword = 'TSUnknownKeyword',
TSVoidKeyword = 'TSVoidKeyword',
}
-
-export { AST_NODE_TYPES };
-
-// Below is a special type-only test which ensures that we don't accidentally leave unused keys in this enum
-// eslint-disable-next-line import/first -- purposely down here to colocate it with this hack of a test
-import type { Node } from './ts-estree';
-
-type GetKeys = keyof Extract;
-
-type AllKeys = {
- readonly [T in AST_NODE_TYPES]: GetKeys;
-};
-
-type TakesString> = T;
-
-// @ts-expect-error: purposely unused
-type _Test =
- // forcing the test onto a new line so it isn't covered by the expect error
- // If there are any enum members that don't have a corresponding TSESTree.Node, then this line will error with "Type 'string | number | symbol' is not assignable to type 'string'."
- void | TakesString;
diff --git a/packages/types/src/ast-token-types.ts b/packages/ast-spec/src/ast-token-types.ts
similarity index 87%
rename from packages/types/src/ast-token-types.ts
rename to packages/ast-spec/src/ast-token-types.ts
index 144befece83e..f839d8dfae59 100644
--- a/packages/types/src/ast-token-types.ts
+++ b/packages/ast-spec/src/ast-token-types.ts
@@ -1,4 +1,4 @@
-enum AST_TOKEN_TYPES {
+export enum AST_TOKEN_TYPES {
Boolean = 'Boolean',
Identifier = 'Identifier',
JSXIdentifier = 'JSXIdentifier',
@@ -15,5 +15,3 @@ enum AST_TOKEN_TYPES {
Block = 'Block',
Line = 'Line',
}
-
-export { AST_TOKEN_TYPES };
diff --git a/packages/ast-spec/src/base/Accessibility.ts b/packages/ast-spec/src/base/Accessibility.ts
new file mode 100644
index 000000000000..d52942f43ab2
--- /dev/null
+++ b/packages/ast-spec/src/base/Accessibility.ts
@@ -0,0 +1 @@
+export type Accessibility = 'private' | 'protected' | 'public';
diff --git a/packages/ast-spec/src/base/BaseNode.ts b/packages/ast-spec/src/base/BaseNode.ts
new file mode 100644
index 000000000000..362f156832b4
--- /dev/null
+++ b/packages/ast-spec/src/base/BaseNode.ts
@@ -0,0 +1,22 @@
+// import type { Node } from '../unions/Node';
+import type { Range } from './Range';
+import type { SourceLocation } from './SourceLocation';
+
+export interface BaseNode {
+ /**
+ * The source location information of the node.
+ * @see {SourceLocation}
+ */
+ loc: SourceLocation;
+ /**
+ * @see {Range}
+ */
+ range: Range;
+ /**
+ * The parent node of the current node
+ */
+ // parent?: Node;
+
+ // every node *will* have a type, but let the nodes define their own exact string
+ // type: string;
+}
diff --git a/packages/ast-spec/src/base/BaseToken.ts b/packages/ast-spec/src/base/BaseToken.ts
new file mode 100644
index 000000000000..cdf0d1286438
--- /dev/null
+++ b/packages/ast-spec/src/base/BaseToken.ts
@@ -0,0 +1,8 @@
+import type { BaseNode } from './BaseNode';
+
+/*
+ * Token and Comment are pseudo-nodes to represent pieces of source code
+ */
+export interface BaseToken extends BaseNode {
+ value: string;
+}
diff --git a/packages/ast-spec/src/base/BinaryExpressionBase.ts b/packages/ast-spec/src/base/BinaryExpressionBase.ts
new file mode 100644
index 000000000000..926491d49855
--- /dev/null
+++ b/packages/ast-spec/src/base/BinaryExpressionBase.ts
@@ -0,0 +1,8 @@
+import type { Expression } from '../unions/Expression';
+import type { BaseNode } from './BaseNode';
+
+export interface BinaryExpressionBase extends BaseNode {
+ operator: string;
+ left: Expression;
+ right: Expression;
+}
diff --git a/packages/ast-spec/src/base/ClassDeclarationBase.ts b/packages/ast-spec/src/base/ClassDeclarationBase.ts
new file mode 100644
index 000000000000..f104b739b517
--- /dev/null
+++ b/packages/ast-spec/src/base/ClassDeclarationBase.ts
@@ -0,0 +1,20 @@
+import type { Identifier } from '../expression/Identifier/spec';
+import type { ClassBody } from '../special/ClassBody/spec';
+import type { Decorator } from '../special/Decorator/spec';
+import type { TSClassImplements } from '../special/TSClassImplements/spec';
+import type { TSTypeParameterDeclaration } from '../special/TSTypeParameterDeclaration/spec';
+import type { TSTypeParameterInstantiation } from '../special/TSTypeParameterInstantiation/spec';
+import type { LeftHandSideExpression } from '../unions/LeftHandSideExpression';
+import type { BaseNode } from './BaseNode';
+
+export interface ClassDeclarationBase extends BaseNode {
+ typeParameters?: TSTypeParameterDeclaration;
+ superTypeParameters?: TSTypeParameterInstantiation;
+ id: Identifier | null;
+ body: ClassBody;
+ superClass: LeftHandSideExpression | null;
+ implements?: TSClassImplements[];
+ abstract?: boolean;
+ declare?: boolean;
+ decorators?: Decorator[];
+}
diff --git a/packages/ast-spec/src/base/ClassPropertyBase.ts b/packages/ast-spec/src/base/ClassPropertyBase.ts
new file mode 100644
index 000000000000..8ac19b05fa55
--- /dev/null
+++ b/packages/ast-spec/src/base/ClassPropertyBase.ts
@@ -0,0 +1,34 @@
+import type { Decorator } from '../special/Decorator/spec';
+import type { TSTypeAnnotation } from '../special/TSTypeAnnotation/spec';
+import type { Expression } from '../unions/Expression';
+import type {
+ PropertyName,
+ PropertyNameComputed,
+ PropertyNameNonComputed,
+} from '../unions/PropertyName';
+import type { Accessibility } from './Accessibility';
+import type { BaseNode } from './BaseNode';
+
+interface ClassPropertyBase extends BaseNode {
+ key: PropertyName;
+ value: Expression | null;
+ computed: boolean;
+ static: boolean;
+ declare: boolean;
+ readonly?: boolean;
+ decorators?: Decorator[];
+ accessibility?: Accessibility;
+ optional?: boolean;
+ definite?: boolean;
+ typeAnnotation?: TSTypeAnnotation;
+}
+
+export interface ClassPropertyComputedNameBase extends ClassPropertyBase {
+ key: PropertyNameComputed;
+ computed: true;
+}
+
+export interface ClassPropertyNonComputedNameBase extends ClassPropertyBase {
+ key: PropertyNameNonComputed;
+ computed: false;
+}
diff --git a/packages/ast-spec/src/base/FunctionDeclarationBase.ts b/packages/ast-spec/src/base/FunctionDeclarationBase.ts
new file mode 100644
index 000000000000..50b7aa97bf2f
--- /dev/null
+++ b/packages/ast-spec/src/base/FunctionDeclarationBase.ts
@@ -0,0 +1,18 @@
+import type { Identifier } from '../expression/Identifier/spec';
+import type { TSTypeAnnotation } from '../special/TSTypeAnnotation/spec';
+import type { TSTypeParameterDeclaration } from '../special/TSTypeParameterDeclaration/spec';
+import type { BlockStatement } from '../statement/BlockStatement/spec';
+import type { Parameter } from '../unions/Parameter';
+import type { BaseNode } from './BaseNode';
+
+export interface FunctionDeclarationBase extends BaseNode {
+ id: Identifier | null;
+ generator: boolean;
+ expression: boolean;
+ async: boolean;
+ params: Parameter[];
+ body?: BlockStatement | null;
+ returnType?: TSTypeAnnotation;
+ typeParameters?: TSTypeParameterDeclaration;
+ declare?: boolean;
+}
diff --git a/packages/ast-spec/src/base/LineAndColumnData.ts b/packages/ast-spec/src/base/LineAndColumnData.ts
new file mode 100644
index 000000000000..740ebe6fa467
--- /dev/null
+++ b/packages/ast-spec/src/base/LineAndColumnData.ts
@@ -0,0 +1,10 @@
+export interface LineAndColumnData {
+ /**
+ * Line number (1-indexed)
+ */
+ line: number;
+ /**
+ * Column number on the line (0-indexed)
+ */
+ column: number;
+}
diff --git a/packages/ast-spec/src/base/LiteralBase.ts b/packages/ast-spec/src/base/LiteralBase.ts
new file mode 100644
index 000000000000..01a480ddc3cb
--- /dev/null
+++ b/packages/ast-spec/src/base/LiteralBase.ts
@@ -0,0 +1,6 @@
+import type { BaseNode } from './BaseNode';
+
+export interface LiteralBase extends BaseNode {
+ raw: string;
+ value: RegExp | bigint | boolean | number | string | null;
+}
diff --git a/packages/ast-spec/src/base/MethodDefinitionBase.ts b/packages/ast-spec/src/base/MethodDefinitionBase.ts
new file mode 100644
index 000000000000..fe8846062106
--- /dev/null
+++ b/packages/ast-spec/src/base/MethodDefinitionBase.ts
@@ -0,0 +1,35 @@
+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 {
+ PropertyName,
+ PropertyNameComputed,
+ PropertyNameNonComputed,
+} from '../unions/PropertyName';
+import type { Accessibility } from './Accessibility';
+import type { BaseNode } from './BaseNode';
+
+/** this should not be directly used - instead use MethodDefinitionComputedNameBase or MethodDefinitionNonComputedNameBase */
+interface MethodDefinitionBase extends BaseNode {
+ key: PropertyName;
+ value: FunctionExpression | TSEmptyBodyFunctionExpression;
+ computed: boolean;
+ static: boolean;
+ kind: 'constructor' | 'get' | 'method' | 'set';
+ optional?: boolean;
+ decorators?: Decorator[];
+ accessibility?: Accessibility;
+ typeParameters?: TSTypeParameterDeclaration;
+}
+
+export interface MethodDefinitionComputedNameBase extends MethodDefinitionBase {
+ key: PropertyNameComputed;
+ computed: true;
+}
+
+export interface MethodDefinitionNonComputedNameBase
+ extends MethodDefinitionBase {
+ key: PropertyNameNonComputed;
+ computed: false;
+}
diff --git a/packages/ast-spec/src/base/OptionalRangeAndLoc.ts b/packages/ast-spec/src/base/OptionalRangeAndLoc.ts
new file mode 100644
index 000000000000..d9b8cc9f874d
--- /dev/null
+++ b/packages/ast-spec/src/base/OptionalRangeAndLoc.ts
@@ -0,0 +1,11 @@
+import type { Range } from './Range';
+import type { SourceLocation } from './SourceLocation';
+
+// TODO - breaking change move this into `typescript-estree`
+export type OptionalRangeAndLoc = Pick<
+ T,
+ Exclude
+> & {
+ range?: Range;
+ loc?: SourceLocation;
+};
diff --git a/packages/ast-spec/src/base/Range.ts b/packages/ast-spec/src/base/Range.ts
new file mode 100644
index 000000000000..e78f71e3f747
--- /dev/null
+++ b/packages/ast-spec/src/base/Range.ts
@@ -0,0 +1,6 @@
+/**
+ * An array of two numbers.
+ * Both numbers are a 0-based index which is the position in the array of source code characters.
+ * The first is the start position of the node, the second is the end position of the node.
+ */
+export type Range = [number, number];
diff --git a/packages/ast-spec/src/base/SourceLocation.ts b/packages/ast-spec/src/base/SourceLocation.ts
new file mode 100644
index 000000000000..e1a8e272a6fc
--- /dev/null
+++ b/packages/ast-spec/src/base/SourceLocation.ts
@@ -0,0 +1,12 @@
+import type { LineAndColumnData } from './LineAndColumnData';
+
+export interface SourceLocation {
+ /**
+ * The position of the first character of the parsed source region
+ */
+ start: LineAndColumnData;
+ /**
+ * The position of the first character after the parsed source region
+ */
+ end: LineAndColumnData;
+}
diff --git a/packages/ast-spec/src/base/TSFunctionSignatureBase.ts b/packages/ast-spec/src/base/TSFunctionSignatureBase.ts
new file mode 100644
index 000000000000..0da1e7b414d6
--- /dev/null
+++ b/packages/ast-spec/src/base/TSFunctionSignatureBase.ts
@@ -0,0 +1,10 @@
+import type { TSTypeAnnotation } from '../special/TSTypeAnnotation/spec';
+import type { TSTypeParameterDeclaration } from '../special/TSTypeParameterDeclaration/spec';
+import type { Parameter } from '../unions/Parameter';
+import type { BaseNode } from './BaseNode';
+
+export interface TSFunctionSignatureBase extends BaseNode {
+ params: Parameter[];
+ returnType?: TSTypeAnnotation;
+ typeParameters?: TSTypeParameterDeclaration;
+}
diff --git a/packages/ast-spec/src/base/TSHeritageBase.ts b/packages/ast-spec/src/base/TSHeritageBase.ts
new file mode 100644
index 000000000000..b3ed1770b674
--- /dev/null
+++ b/packages/ast-spec/src/base/TSHeritageBase.ts
@@ -0,0 +1,8 @@
+import type { TSTypeParameterInstantiation } from '../special/TSTypeParameterInstantiation/spec';
+import type { Expression } from '../unions/Expression';
+import type { BaseNode } from './BaseNode';
+
+export interface TSHeritageBase extends BaseNode {
+ expression: Expression;
+ typeParameters?: TSTypeParameterInstantiation;
+}
diff --git a/packages/ast-spec/src/base/UnaryExpressionBase.ts b/packages/ast-spec/src/base/UnaryExpressionBase.ts
new file mode 100644
index 000000000000..feb681ccbc3c
--- /dev/null
+++ b/packages/ast-spec/src/base/UnaryExpressionBase.ts
@@ -0,0 +1,10 @@
+import type { UnaryExpression } from '../expression/UnaryExpression/spec';
+import type { LeftHandSideExpression } from '../unions/LeftHandSideExpression';
+import type { Literal } from '../unions/Literal';
+import type { BaseNode } from './BaseNode';
+
+export interface UnaryExpressionBase extends BaseNode {
+ operator: string;
+ prefix: boolean;
+ argument: LeftHandSideExpression | Literal | UnaryExpression;
+}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/spec.ts b/packages/ast-spec/src/declaration/ClassDeclaration/spec.ts
new file mode 100644
index 000000000000..2154b8863a02
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { ClassDeclarationBase } from '../../base/ClassDeclarationBase';
+
+export interface ClassDeclaration extends ClassDeclarationBase {
+ type: AST_NODE_TYPES.ClassDeclaration;
+}
diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts
new file mode 100644
index 000000000000..e9657a7536fa
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { Expression } from '../../unions/Expression';
+
+export interface ExportAllDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.ExportAllDeclaration;
+ source: Expression | null;
+ exportKind: 'type' | 'value';
+ exported: Identifier | null;
+}
diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts
new file mode 100644
index 000000000000..f34b6e44668f
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { ExportDeclaration } from '../../unions/ExportDeclaration';
+import type { Expression } from '../../unions/Expression';
+
+export interface ExportDefaultDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.ExportDefaultDeclaration;
+ declaration: ExportDeclaration | Expression;
+ exportKind: 'type' | 'value';
+}
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts
new file mode 100644
index 000000000000..021fea1c6330
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts
@@ -0,0 +1,13 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { ExportSpecifier } from '../../special/ExportSpecifier/spec';
+import type { ExportDeclaration } from '../../unions/ExportDeclaration';
+import type { Expression } from '../../unions/Expression';
+
+export interface ExportNamedDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.ExportNamedDeclaration;
+ declaration: ExportDeclaration | null;
+ specifiers: ExportSpecifier[];
+ source: Expression | null;
+ exportKind: 'type' | 'value';
+}
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/spec.ts b/packages/ast-spec/src/declaration/FunctionDeclaration/spec.ts
new file mode 100644
index 000000000000..59d7c4ffe39d
--- /dev/null
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { FunctionDeclarationBase } from '../../base/FunctionDeclarationBase';
+import type { BlockStatement } from '../../statement/BlockStatement/spec';
+
+export interface FunctionDeclaration extends FunctionDeclarationBase {
+ type: AST_NODE_TYPES.FunctionDeclaration;
+ body: BlockStatement;
+}
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/spec.ts b/packages/ast-spec/src/declaration/TSDeclareFunction/spec.ts
new file mode 100644
index 000000000000..88bd4aff2f21
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { FunctionDeclarationBase } from '../../base/FunctionDeclarationBase';
+
+export interface TSDeclareFunction extends FunctionDeclarationBase {
+ type: AST_NODE_TYPES.TSDeclareFunction;
+}
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSEnumDeclaration/spec.ts
new file mode 100644
index 000000000000..1c1530d501ff
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/spec.ts
@@ -0,0 +1,14 @@
+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;
+ id: Identifier;
+ members: TSEnumMember[];
+ const?: boolean;
+ declare?: boolean;
+ modifiers?: Modifier[];
+}
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts
new file mode 100644
index 000000000000..4c434dded782
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/spec.ts
@@ -0,0 +1,13 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { TSExternalModuleReference } from '../../special/TSExternalModuleReference/spec';
+import type { EntityName } from '../../unions/EntityName';
+
+export interface TSImportEqualsDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.TSImportEqualsDeclaration;
+ id: Identifier;
+ moduleReference: EntityName | TSExternalModuleReference;
+ importKind: 'type' | 'value';
+ isExport: boolean;
+}
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/spec.ts
new file mode 100644
index 000000000000..1e95380c3cbb
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/spec.ts
@@ -0,0 +1,17 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { TSInterfaceBody } from '../../special/TSInterfaceBody/spec';
+import type { TSInterfaceHeritage } from '../../special/TSInterfaceHeritage/spec';
+import type { TSTypeParameterDeclaration } from '../../special/TSTypeParameterDeclaration/spec';
+
+export interface TSInterfaceDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.TSInterfaceDeclaration;
+ body: TSInterfaceBody;
+ id: Identifier;
+ typeParameters?: TSTypeParameterDeclaration;
+ extends?: TSInterfaceHeritage[];
+ implements?: TSInterfaceHeritage[];
+ abstract?: boolean;
+ declare?: boolean;
+}
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts
new file mode 100644
index 000000000000..ac63e52a5938
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/spec.ts
@@ -0,0 +1,26 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { TSModuleBlock } from '../../special/TSModuleBlock/spec';
+import type { Literal } from '../../unions/Literal';
+import type { Modifier } from '../../unions/Modifier';
+
+export interface TSModuleDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.TSModuleDeclaration;
+ id: Identifier | Literal;
+ body?:
+ | TSModuleBlock
+ /*
+ TODO - we currently emit this due to bad parser handling of nested modules
+ namespace Foo.Bar {}
+ ^^^^^^^^^^^^^^^^^^^^ TSModuleDeclaration
+ ^^^^^^ TSModuleDeclaration
+ ^^ TSModuleBlock
+
+ This should instead emit a TSQualifiedName for the `id` and not emit an inner TSModuleDeclaration
+ */
+ | TSModuleDeclaration;
+ global?: boolean;
+ declare?: boolean;
+ modifiers?: Modifier[];
+}
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/spec.ts
new file mode 100644
index 000000000000..6853d4a28544
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+
+export interface TSNamespaceExportDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.TSNamespaceExportDeclaration;
+ id: Identifier;
+}
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/spec.ts b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/spec.ts
new file mode 100644
index 000000000000..61ce986c2a23
--- /dev/null
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/spec.ts
@@ -0,0 +1,13 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { TSTypeParameterDeclaration } from '../../special/TSTypeParameterDeclaration/spec';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSTypeAliasDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.TSTypeAliasDeclaration;
+ id: Identifier;
+ typeAnnotation: TypeNode;
+ declare?: boolean;
+ typeParameters?: TSTypeParameterDeclaration;
+}
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts b/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts
new file mode 100644
index 000000000000..418a51eb735b
--- /dev/null
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { VariableDeclarator } from '../../special/VariableDeclarator/spec';
+
+export interface VariableDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.VariableDeclaration;
+ // NOTE - this is not guaranteed to have any elements in it. i.e. `const;`
+ declarations: VariableDeclarator[];
+ kind: 'const' | 'let' | 'var';
+ declare?: boolean;
+}
diff --git a/packages/ast-spec/src/declaration/spec.ts b/packages/ast-spec/src/declaration/spec.ts
new file mode 100644
index 000000000000..8d29c3cd70a1
--- /dev/null
+++ b/packages/ast-spec/src/declaration/spec.ts
@@ -0,0 +1,13 @@
+export * from './ClassDeclaration/spec';
+export * from './ExportAllDeclaration/spec';
+export * from './ExportDefaultDeclaration/spec';
+export * from './ExportNamedDeclaration/spec';
+export * from './FunctionDeclaration/spec';
+export * from './TSDeclareFunction/spec';
+export * from './TSEnumDeclaration/spec';
+export * from './TSImportEqualsDeclaration/spec';
+export * from './TSInterfaceDeclaration/spec';
+export * from './TSModuleDeclaration/spec';
+export * from './TSNamespaceExportDeclaration/spec';
+export * from './TSTypeAliasDeclaration/spec';
+export * from './VariableDeclaration/spec';
diff --git a/packages/ast-spec/src/element/ClassProperty/spec.ts b/packages/ast-spec/src/element/ClassProperty/spec.ts
new file mode 100644
index 000000000000..29fe75aa84e6
--- /dev/null
+++ b/packages/ast-spec/src/element/ClassProperty/spec.ts
@@ -0,0 +1,19 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type {
+ ClassPropertyComputedNameBase,
+ ClassPropertyNonComputedNameBase,
+} from '../../base/ClassPropertyBase';
+
+export interface ClassPropertyComputedName
+ extends ClassPropertyComputedNameBase {
+ type: AST_NODE_TYPES.ClassProperty;
+}
+
+export interface ClassPropertyNonComputedName
+ extends ClassPropertyNonComputedNameBase {
+ type: AST_NODE_TYPES.ClassProperty;
+}
+
+export type ClassProperty =
+ | ClassPropertyComputedName
+ | ClassPropertyNonComputedName;
diff --git a/packages/ast-spec/src/element/MethodDefinition/spec.ts b/packages/ast-spec/src/element/MethodDefinition/spec.ts
new file mode 100644
index 000000000000..f097f9f8e854
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/spec.ts
@@ -0,0 +1,19 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type {
+ MethodDefinitionComputedNameBase,
+ MethodDefinitionNonComputedNameBase,
+} from '../../base/MethodDefinitionBase';
+
+export interface MethodDefinitionComputedName
+ extends MethodDefinitionComputedNameBase {
+ type: AST_NODE_TYPES.MethodDefinition;
+}
+
+export interface MethodDefinitionNonComputedName
+ extends MethodDefinitionNonComputedNameBase {
+ type: AST_NODE_TYPES.MethodDefinition;
+}
+
+export type MethodDefinition =
+ | MethodDefinitionComputedName
+ | MethodDefinitionNonComputedName;
diff --git a/packages/ast-spec/src/element/Property/spec.ts b/packages/ast-spec/src/element/Property/spec.ts
new file mode 100644
index 000000000000..c96a7a26e371
--- /dev/null
+++ b/packages/ast-spec/src/element/Property/spec.ts
@@ -0,0 +1,37 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSEmptyBodyFunctionExpression } from '../../expression/TSEmptyBodyFunctionExpression/spec';
+import type { AssignmentPattern } from '../../parameter/AssignmentPattern/spec';
+import type { BindingName } from '../../unions/BindingName';
+import type { Expression } from '../../unions/Expression';
+import type {
+ PropertyName,
+ PropertyNameComputed,
+ PropertyNameNonComputed,
+} from '../../unions/PropertyName';
+
+interface PropertyBase extends BaseNode {
+ type: AST_NODE_TYPES.Property;
+ key: PropertyName;
+ value:
+ | AssignmentPattern
+ | BindingName
+ | Expression
+ | TSEmptyBodyFunctionExpression;
+ computed: boolean;
+ method: boolean;
+ shorthand: boolean;
+ optional?: boolean;
+ kind: 'get' | 'init' | 'set';
+}
+
+export interface PropertyComputedName extends PropertyBase {
+ key: PropertyNameComputed;
+ computed: true;
+}
+export interface PropertyNonComputedName extends PropertyBase {
+ key: PropertyNameNonComputed;
+ computed: false;
+}
+
+export type Property = PropertyComputedName | PropertyNonComputedName;
diff --git a/packages/ast-spec/src/element/SpreadElement/spec.ts b/packages/ast-spec/src/element/SpreadElement/spec.ts
new file mode 100644
index 000000000000..13a691901710
--- /dev/null
+++ b/packages/ast-spec/src/element/SpreadElement/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface SpreadElement extends BaseNode {
+ type: AST_NODE_TYPES.SpreadElement;
+ argument: Expression;
+}
diff --git a/packages/ast-spec/src/element/TSAbstractClassProperty/spec.ts b/packages/ast-spec/src/element/TSAbstractClassProperty/spec.ts
new file mode 100644
index 000000000000..0d845a893290
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractClassProperty/spec.ts
@@ -0,0 +1,19 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type {
+ ClassPropertyComputedNameBase,
+ ClassPropertyNonComputedNameBase,
+} from '../../base/ClassPropertyBase';
+
+export interface TSAbstractClassPropertyComputedName
+ extends ClassPropertyComputedNameBase {
+ type: AST_NODE_TYPES.TSAbstractClassProperty;
+}
+
+export interface TSAbstractClassPropertyNonComputedName
+ extends ClassPropertyNonComputedNameBase {
+ type: AST_NODE_TYPES.TSAbstractClassProperty;
+}
+
+export type TSAbstractClassProperty =
+ | TSAbstractClassPropertyComputedName
+ | TSAbstractClassPropertyNonComputedName;
diff --git a/packages/ast-spec/src/element/TSAbstractMethodDefinition/spec.ts b/packages/ast-spec/src/element/TSAbstractMethodDefinition/spec.ts
new file mode 100644
index 000000000000..a8f5a05c50ab
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractMethodDefinition/spec.ts
@@ -0,0 +1,19 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type {
+ MethodDefinitionComputedNameBase,
+ MethodDefinitionNonComputedNameBase,
+} from '../../base/MethodDefinitionBase';
+
+export interface TSAbstractMethodDefinitionComputedName
+ extends MethodDefinitionComputedNameBase {
+ type: AST_NODE_TYPES.TSAbstractMethodDefinition;
+}
+
+export interface TSAbstractMethodDefinitionNonComputedName
+ extends MethodDefinitionNonComputedNameBase {
+ type: AST_NODE_TYPES.TSAbstractMethodDefinition;
+}
+
+export type TSAbstractMethodDefinition =
+ | TSAbstractMethodDefinitionComputedName
+ | TSAbstractMethodDefinitionNonComputedName;
diff --git a/packages/ast-spec/src/element/TSCallSignatureDeclaration/spec.ts b/packages/ast-spec/src/element/TSCallSignatureDeclaration/spec.ts
new file mode 100644
index 000000000000..8ba015661ccb
--- /dev/null
+++ b/packages/ast-spec/src/element/TSCallSignatureDeclaration/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { TSFunctionSignatureBase } from '../../base/TSFunctionSignatureBase';
+
+export interface TSCallSignatureDeclaration extends TSFunctionSignatureBase {
+ type: AST_NODE_TYPES.TSCallSignatureDeclaration;
+}
diff --git a/packages/ast-spec/src/element/TSConstructSignatureDeclaration/spec.ts b/packages/ast-spec/src/element/TSConstructSignatureDeclaration/spec.ts
new file mode 100644
index 000000000000..21feddb824d1
--- /dev/null
+++ b/packages/ast-spec/src/element/TSConstructSignatureDeclaration/spec.ts
@@ -0,0 +1,7 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { TSFunctionSignatureBase } from '../../base/TSFunctionSignatureBase';
+
+export interface TSConstructSignatureDeclaration
+ extends TSFunctionSignatureBase {
+ type: AST_NODE_TYPES.TSConstructSignatureDeclaration;
+}
diff --git a/packages/ast-spec/src/element/TSEnumMember/spec.ts b/packages/ast-spec/src/element/TSEnumMember/spec.ts
new file mode 100644
index 000000000000..97d8e49fcd94
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/spec.ts
@@ -0,0 +1,41 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type {
+ PropertyNameComputed,
+ PropertyNameNonComputed,
+} from '../../unions/PropertyName';
+
+interface TSEnumMemberBase extends BaseNode {
+ type: AST_NODE_TYPES.TSEnumMember;
+ id:
+ | PropertyNameComputed // this should only happen in semantically invalid code (ts error 1164)
+ | PropertyNameNonComputed;
+ initializer?: Expression;
+ computed?: boolean;
+}
+
+/**
+ * this should only really happen in semantically invalid code (errors 1164 and 2452)
+ *
+ * VALID:
+ * enum Foo { ['a'] }
+ *
+ * INVALID:
+ * const x = 'a';
+ * enum Foo { [x] }
+ * enum Bar { ['a' + 'b'] }
+ */
+export interface TSEnumMemberComputedName extends TSEnumMemberBase {
+ id: PropertyNameComputed;
+ computed: true;
+}
+
+export interface TSEnumMemberNonComputedName extends TSEnumMemberBase {
+ id: PropertyNameNonComputed;
+ computed?: false;
+}
+
+export type TSEnumMember =
+ | TSEnumMemberComputedName
+ | TSEnumMemberNonComputedName;
diff --git a/packages/ast-spec/src/element/TSIndexSignature/spec.ts b/packages/ast-spec/src/element/TSIndexSignature/spec.ts
new file mode 100644
index 000000000000..38002bec2951
--- /dev/null
+++ b/packages/ast-spec/src/element/TSIndexSignature/spec.ts
@@ -0,0 +1,15 @@
+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 { 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;
+}
diff --git a/packages/ast-spec/src/element/TSMethodSignature/spec.ts b/packages/ast-spec/src/element/TSMethodSignature/spec.ts
new file mode 100644
index 000000000000..76b2e71ab3ad
--- /dev/null
+++ b/packages/ast-spec/src/element/TSMethodSignature/spec.ts
@@ -0,0 +1,39 @@
+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 { TSTypeParameterDeclaration } from '../../special/TSTypeParameterDeclaration/spec';
+import type { Parameter } from '../../unions/Parameter';
+import type {
+ PropertyName,
+ PropertyNameComputed,
+ PropertyNameNonComputed,
+} from '../../unions/PropertyName';
+
+interface TSMethodSignatureBase extends BaseNode {
+ type: AST_NODE_TYPES.TSMethodSignature;
+ key: PropertyName;
+ computed: boolean;
+ params: Parameter[];
+ optional?: boolean;
+ returnType?: TSTypeAnnotation;
+ readonly?: boolean;
+ typeParameters?: TSTypeParameterDeclaration;
+ accessibility?: Accessibility;
+ export?: boolean;
+ static?: boolean;
+}
+
+export interface TSMethodSignatureComputedName extends TSMethodSignatureBase {
+ key: PropertyNameComputed;
+ computed: true;
+}
+export interface TSMethodSignatureNonComputedName
+ extends TSMethodSignatureBase {
+ key: PropertyNameNonComputed;
+ computed: false;
+}
+
+export type TSMethodSignature =
+ | TSMethodSignatureComputedName
+ | TSMethodSignatureNonComputedName;
diff --git a/packages/ast-spec/src/element/TSPropertySignature/spec.ts b/packages/ast-spec/src/element/TSPropertySignature/spec.ts
new file mode 100644
index 000000000000..a3f91ac26807
--- /dev/null
+++ b/packages/ast-spec/src/element/TSPropertySignature/spec.ts
@@ -0,0 +1,39 @@
+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,
+ PropertyNameNonComputed,
+} from '../../unions/PropertyName';
+
+interface TSPropertySignatureBase extends BaseNode {
+ type: AST_NODE_TYPES.TSPropertySignature;
+ key: PropertyName;
+ optional?: boolean;
+ computed: boolean;
+ typeAnnotation?: TSTypeAnnotation;
+ initializer?: Expression;
+ readonly?: boolean;
+ static?: boolean;
+ export?: boolean;
+ accessibility?: Accessibility;
+}
+
+export interface TSPropertySignatureComputedName
+ extends TSPropertySignatureBase {
+ key: PropertyNameComputed;
+ computed: true;
+}
+
+export interface TSPropertySignatureNonComputedName
+ extends TSPropertySignatureBase {
+ key: PropertyNameNonComputed;
+ computed: false;
+}
+
+export type TSPropertySignature =
+ | TSPropertySignatureComputedName
+ | TSPropertySignatureNonComputedName;
diff --git a/packages/ast-spec/src/element/spec.ts b/packages/ast-spec/src/element/spec.ts
new file mode 100644
index 000000000000..5ee18d914024
--- /dev/null
+++ b/packages/ast-spec/src/element/spec.ts
@@ -0,0 +1,12 @@
+export * from './ClassProperty/spec';
+export * from './MethodDefinition/spec';
+export * from './Property/spec';
+export * from './SpreadElement/spec';
+export * from './TSAbstractClassProperty/spec';
+export * from './TSAbstractMethodDefinition/spec';
+export * from './TSCallSignatureDeclaration/spec';
+export * from './TSConstructSignatureDeclaration/spec';
+export * from './TSEnumMember/spec';
+export * from './TSIndexSignature/spec';
+export * from './TSMethodSignature/spec';
+export * from './TSPropertySignature/spec';
diff --git a/packages/ast-spec/src/expression/ArrayExpression/spec.ts b/packages/ast-spec/src/expression/ArrayExpression/spec.ts
new file mode 100644
index 000000000000..7da330e231a4
--- /dev/null
+++ b/packages/ast-spec/src/expression/ArrayExpression/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface ArrayExpression extends BaseNode {
+ type: AST_NODE_TYPES.ArrayExpression;
+ elements: Expression[];
+}
diff --git a/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts b/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts
new file mode 100644
index 000000000000..347ee8541371
--- /dev/null
+++ b/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts
@@ -0,0 +1,19 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSTypeAnnotation } from '../../special/TSTypeAnnotation/spec';
+import type { TSTypeParameterDeclaration } from '../../special/TSTypeParameterDeclaration/spec';
+import type { BlockStatement } from '../../statement/BlockStatement/spec';
+import type { Expression } from '../../unions/Expression';
+import type { Parameter } from '../../unions/Parameter';
+
+export interface ArrowFunctionExpression extends BaseNode {
+ type: AST_NODE_TYPES.ArrowFunctionExpression;
+ generator: boolean;
+ id: null;
+ params: Parameter[];
+ body: BlockStatement | Expression;
+ async: boolean;
+ expression: boolean;
+ returnType?: TSTypeAnnotation;
+ typeParameters?: TSTypeParameterDeclaration;
+}
diff --git a/packages/ast-spec/src/expression/AssignmentExpression/spec.ts b/packages/ast-spec/src/expression/AssignmentExpression/spec.ts
new file mode 100644
index 000000000000..8d76be21bdcc
--- /dev/null
+++ b/packages/ast-spec/src/expression/AssignmentExpression/spec.ts
@@ -0,0 +1,23 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BinaryExpressionBase } from '../../base/BinaryExpressionBase';
+
+export interface AssignmentExpression extends BinaryExpressionBase {
+ type: AST_NODE_TYPES.AssignmentExpression;
+ operator:
+ | '-='
+ | '??='
+ | '**='
+ | '*='
+ | '/='
+ | '&&='
+ | '&='
+ | '%='
+ | '^='
+ | '+='
+ | '<<='
+ | '='
+ | '>>='
+ | '>>>='
+ | '|='
+ | '||=';
+}
diff --git a/packages/ast-spec/src/expression/AwaitExpression/spec.ts b/packages/ast-spec/src/expression/AwaitExpression/spec.ts
new file mode 100644
index 000000000000..248e371e871b
--- /dev/null
+++ b/packages/ast-spec/src/expression/AwaitExpression/spec.ts
@@ -0,0 +1,16 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression';
+import type { TSTypeAssertion } from '../TSTypeAssertion/spec';
+import type { UnaryExpression } from '../UnaryExpression/spec';
+import type { UpdateExpression } from '../UpdateExpression/spec';
+
+export interface AwaitExpression extends BaseNode {
+ type: AST_NODE_TYPES.AwaitExpression;
+ argument:
+ | AwaitExpression
+ | LeftHandSideExpression
+ | TSTypeAssertion
+ | UnaryExpression
+ | UpdateExpression;
+}
diff --git a/packages/ast-spec/src/expression/BinaryExpression/spec.ts b/packages/ast-spec/src/expression/BinaryExpression/spec.ts
new file mode 100644
index 000000000000..5df33cc3e16a
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BinaryExpressionBase } from '../../base/BinaryExpressionBase';
+
+export interface BinaryExpression extends BinaryExpressionBase {
+ type: AST_NODE_TYPES.BinaryExpression;
+}
diff --git a/packages/ast-spec/src/expression/CallExpression/spec.ts b/packages/ast-spec/src/expression/CallExpression/spec.ts
new file mode 100644
index 000000000000..bd71773a1be8
--- /dev/null
+++ b/packages/ast-spec/src/expression/CallExpression/spec.ts
@@ -0,0 +1,13 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSTypeParameterInstantiation } from '../../special/TSTypeParameterInstantiation/spec';
+import type { CallExpressionArgument } from '../../unions/CallExpressionArgument';
+import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression';
+
+export interface CallExpression extends BaseNode {
+ type: AST_NODE_TYPES.CallExpression;
+ callee: LeftHandSideExpression;
+ arguments: CallExpressionArgument[];
+ typeParameters?: TSTypeParameterInstantiation;
+ optional: boolean;
+}
diff --git a/packages/ast-spec/src/expression/ChainExpression/spec.ts b/packages/ast-spec/src/expression/ChainExpression/spec.ts
new file mode 100644
index 000000000000..dfad50f3580f
--- /dev/null
+++ b/packages/ast-spec/src/expression/ChainExpression/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { ChainElement } from '../../unions/ChainElement';
+
+export interface ChainExpression extends BaseNode {
+ type: AST_NODE_TYPES.ChainExpression;
+ expression: ChainElement;
+}
diff --git a/packages/ast-spec/src/expression/ClassExpression/spec.ts b/packages/ast-spec/src/expression/ClassExpression/spec.ts
new file mode 100644
index 000000000000..15215c31f1b6
--- /dev/null
+++ b/packages/ast-spec/src/expression/ClassExpression/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { ClassDeclarationBase } from '../../base/ClassDeclarationBase';
+
+export interface ClassExpression extends ClassDeclarationBase {
+ type: AST_NODE_TYPES.ClassExpression;
+}
diff --git a/packages/ast-spec/src/expression/ConditionalExpression/spec.ts b/packages/ast-spec/src/expression/ConditionalExpression/spec.ts
new file mode 100644
index 000000000000..545fc9497b77
--- /dev/null
+++ b/packages/ast-spec/src/expression/ConditionalExpression/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface ConditionalExpression extends BaseNode {
+ type: AST_NODE_TYPES.ConditionalExpression;
+ test: Expression;
+ consequent: Expression;
+ alternate: Expression;
+}
diff --git a/packages/ast-spec/src/expression/FunctionExpression/spec.ts b/packages/ast-spec/src/expression/FunctionExpression/spec.ts
new file mode 100644
index 000000000000..111be168b024
--- /dev/null
+++ b/packages/ast-spec/src/expression/FunctionExpression/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { FunctionDeclarationBase } from '../../base/FunctionDeclarationBase';
+import type { BlockStatement } from '../../statement/BlockStatement/spec';
+
+export interface FunctionExpression extends FunctionDeclarationBase {
+ type: AST_NODE_TYPES.FunctionExpression;
+ body: BlockStatement;
+}
diff --git a/packages/ast-spec/src/expression/Identifier/spec.ts b/packages/ast-spec/src/expression/Identifier/spec.ts
new file mode 100644
index 000000000000..384922a061a1
--- /dev/null
+++ b/packages/ast-spec/src/expression/Identifier/spec.ts
@@ -0,0 +1,12 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Decorator } from '../../special/Decorator/spec';
+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[];
+}
diff --git a/packages/ast-spec/src/expression/ImportExpression/spec.ts b/packages/ast-spec/src/expression/ImportExpression/spec.ts
new file mode 100644
index 000000000000..c381802571a6
--- /dev/null
+++ b/packages/ast-spec/src/expression/ImportExpression/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface ImportExpression extends BaseNode {
+ type: AST_NODE_TYPES.ImportExpression;
+ source: Expression;
+}
diff --git a/packages/ast-spec/src/expression/JSXElement/spec.ts b/packages/ast-spec/src/expression/JSXElement/spec.ts
new file mode 100644
index 000000000000..32a514f677a3
--- /dev/null
+++ b/packages/ast-spec/src/expression/JSXElement/spec.ts
@@ -0,0 +1,12 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { JSXClosingElement } from '../../jsx/JSXClosingElement/spec';
+import type { JSXOpeningElement } from '../../jsx/JSXOpeningElement/spec';
+import type { JSXChild } from '../../unions/JSXChild';
+
+export interface JSXElement extends BaseNode {
+ type: AST_NODE_TYPES.JSXElement;
+ openingElement: JSXOpeningElement;
+ closingElement: JSXClosingElement | null;
+ children: JSXChild[];
+}
diff --git a/packages/ast-spec/src/expression/JSXFragment/spec.ts b/packages/ast-spec/src/expression/JSXFragment/spec.ts
new file mode 100644
index 000000000000..9adce12ada58
--- /dev/null
+++ b/packages/ast-spec/src/expression/JSXFragment/spec.ts
@@ -0,0 +1,12 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { JSXClosingFragment } from '../../jsx/JSXClosingFragment/spec';
+import type { JSXOpeningFragment } from '../../jsx/JSXOpeningFragment/spec';
+import type { JSXChild } from '../../unions/JSXChild';
+
+export interface JSXFragment extends BaseNode {
+ type: AST_NODE_TYPES.JSXFragment;
+ openingFragment: JSXOpeningFragment;
+ closingFragment: JSXClosingFragment;
+ children: JSXChild[];
+}
diff --git a/packages/ast-spec/src/expression/LogicalExpression/spec.ts b/packages/ast-spec/src/expression/LogicalExpression/spec.ts
new file mode 100644
index 000000000000..a9bd50e1dfe1
--- /dev/null
+++ b/packages/ast-spec/src/expression/LogicalExpression/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BinaryExpressionBase } from '../../base/BinaryExpressionBase';
+
+export interface LogicalExpression extends BinaryExpressionBase {
+ type: AST_NODE_TYPES.LogicalExpression;
+}
diff --git a/packages/ast-spec/src/expression/MemberExpression/spec.ts b/packages/ast-spec/src/expression/MemberExpression/spec.ts
new file mode 100644
index 000000000000..92bad8cf3dc3
--- /dev/null
+++ b/packages/ast-spec/src/expression/MemberExpression/spec.ts
@@ -0,0 +1,28 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression';
+import type { Identifier } from '../Identifier/spec';
+
+interface MemberExpressionBase extends BaseNode {
+ object: LeftHandSideExpression;
+ property: Expression | Identifier;
+ computed: boolean;
+ optional: boolean;
+}
+
+export interface MemberExpressionComputedName extends MemberExpressionBase {
+ type: AST_NODE_TYPES.MemberExpression;
+ property: Expression;
+ computed: true;
+}
+
+export interface MemberExpressionNonComputedName extends MemberExpressionBase {
+ type: AST_NODE_TYPES.MemberExpression;
+ property: Identifier;
+ computed: false;
+}
+
+export type MemberExpression =
+ | MemberExpressionComputedName
+ | MemberExpressionNonComputedName;
diff --git a/packages/ast-spec/src/expression/MetaProperty/spec.ts b/packages/ast-spec/src/expression/MetaProperty/spec.ts
new file mode 100644
index 000000000000..5bc9afb81113
--- /dev/null
+++ b/packages/ast-spec/src/expression/MetaProperty/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../Identifier/spec';
+
+export interface MetaProperty extends BaseNode {
+ type: AST_NODE_TYPES.MetaProperty;
+ meta: Identifier;
+ property: Identifier;
+}
diff --git a/packages/ast-spec/src/expression/NewExpression/spec.ts b/packages/ast-spec/src/expression/NewExpression/spec.ts
new file mode 100644
index 000000000000..bb75ae3f4b8f
--- /dev/null
+++ b/packages/ast-spec/src/expression/NewExpression/spec.ts
@@ -0,0 +1,12 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSTypeParameterInstantiation } from '../../special/TSTypeParameterInstantiation/spec';
+import type { Expression } from '../../unions/Expression';
+import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression';
+
+export interface NewExpression extends BaseNode {
+ type: AST_NODE_TYPES.NewExpression;
+ callee: LeftHandSideExpression;
+ arguments: Expression[];
+ typeParameters?: TSTypeParameterInstantiation;
+}
diff --git a/packages/ast-spec/src/expression/ObjectExpression/spec.ts b/packages/ast-spec/src/expression/ObjectExpression/spec.ts
new file mode 100644
index 000000000000..0573a2a76faf
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { ObjectLiteralElement } from '../../unions/ObjectLiteralElement';
+
+export interface ObjectExpression extends BaseNode {
+ type: AST_NODE_TYPES.ObjectExpression;
+ properties: ObjectLiteralElement[];
+}
diff --git a/packages/ast-spec/src/expression/SequenceExpression/spec.ts b/packages/ast-spec/src/expression/SequenceExpression/spec.ts
new file mode 100644
index 000000000000..fa571adb4f08
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface SequenceExpression extends BaseNode {
+ type: AST_NODE_TYPES.SequenceExpression;
+ expressions: Expression[];
+}
diff --git a/packages/ast-spec/src/expression/Super/spec.ts b/packages/ast-spec/src/expression/Super/spec.ts
new file mode 100644
index 000000000000..eb310620d8ed
--- /dev/null
+++ b/packages/ast-spec/src/expression/Super/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface Super extends BaseNode {
+ type: AST_NODE_TYPES.Super;
+}
diff --git a/packages/ast-spec/src/expression/TSAsExpression/spec.ts b/packages/ast-spec/src/expression/TSAsExpression/spec.ts
new file mode 100644
index 000000000000..b90925a53ca7
--- /dev/null
+++ b/packages/ast-spec/src/expression/TSAsExpression/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSAsExpression extends BaseNode {
+ type: AST_NODE_TYPES.TSAsExpression;
+ expression: Expression;
+ typeAnnotation: TypeNode;
+}
diff --git a/packages/ast-spec/src/expression/TSEmptyBodyFunctionExpression/spec.ts b/packages/ast-spec/src/expression/TSEmptyBodyFunctionExpression/spec.ts
new file mode 100644
index 000000000000..2cc413c01095
--- /dev/null
+++ b/packages/ast-spec/src/expression/TSEmptyBodyFunctionExpression/spec.ts
@@ -0,0 +1,7 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { FunctionDeclarationBase } from '../../base/FunctionDeclarationBase';
+
+export interface TSEmptyBodyFunctionExpression extends FunctionDeclarationBase {
+ type: AST_NODE_TYPES.TSEmptyBodyFunctionExpression;
+ body: null;
+}
diff --git a/packages/ast-spec/src/expression/TSNonNullExpression/spec.ts b/packages/ast-spec/src/expression/TSNonNullExpression/spec.ts
new file mode 100644
index 000000000000..fd25d33d372f
--- /dev/null
+++ b/packages/ast-spec/src/expression/TSNonNullExpression/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface TSNonNullExpression extends BaseNode {
+ type: AST_NODE_TYPES.TSNonNullExpression;
+ expression: Expression;
+}
diff --git a/packages/ast-spec/src/expression/TSTypeAssertion/spec.ts b/packages/ast-spec/src/expression/TSTypeAssertion/spec.ts
new file mode 100644
index 000000000000..d820f8fcc378
--- /dev/null
+++ b/packages/ast-spec/src/expression/TSTypeAssertion/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSTypeAssertion extends BaseNode {
+ type: AST_NODE_TYPES.TSTypeAssertion;
+ typeAnnotation: TypeNode;
+ expression: Expression;
+}
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/spec.ts b/packages/ast-spec/src/expression/TaggedTemplateExpression/spec.ts
new file mode 100644
index 000000000000..e3438484d9dd
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/spec.ts
@@ -0,0 +1,12 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSTypeParameterInstantiation } from '../../special/TSTypeParameterInstantiation/spec';
+import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression';
+import type { TemplateLiteral } from '../TemplateLiteral/spec';
+
+export interface TaggedTemplateExpression extends BaseNode {
+ type: AST_NODE_TYPES.TaggedTemplateExpression;
+ typeParameters?: TSTypeParameterInstantiation;
+ tag: LeftHandSideExpression;
+ quasi: TemplateLiteral;
+}
diff --git a/packages/ast-spec/src/expression/TemplateLiteral/spec.ts b/packages/ast-spec/src/expression/TemplateLiteral/spec.ts
new file mode 100644
index 000000000000..4d92ef79176d
--- /dev/null
+++ b/packages/ast-spec/src/expression/TemplateLiteral/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TemplateElement } from '../../special/TemplateElement/spec';
+import type { Expression } from '../../unions/Expression';
+
+export interface TemplateLiteral extends BaseNode {
+ type: AST_NODE_TYPES.TemplateLiteral;
+ quasis: TemplateElement[];
+ expressions: Expression[];
+}
diff --git a/packages/ast-spec/src/expression/ThisExpression/spec.ts b/packages/ast-spec/src/expression/ThisExpression/spec.ts
new file mode 100644
index 000000000000..63b5a213a883
--- /dev/null
+++ b/packages/ast-spec/src/expression/ThisExpression/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface ThisExpression extends BaseNode {
+ type: AST_NODE_TYPES.ThisExpression;
+}
diff --git a/packages/ast-spec/src/expression/UnaryExpression/spec.ts b/packages/ast-spec/src/expression/UnaryExpression/spec.ts
new file mode 100644
index 000000000000..26ec8a0e9cdf
--- /dev/null
+++ b/packages/ast-spec/src/expression/UnaryExpression/spec.ts
@@ -0,0 +1,7 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { UnaryExpressionBase } from '../../base/UnaryExpressionBase';
+
+export interface UnaryExpression extends UnaryExpressionBase {
+ type: AST_NODE_TYPES.UnaryExpression;
+ operator: '-' | '!' | '+' | '~' | 'delete' | 'typeof' | 'void';
+}
diff --git a/packages/ast-spec/src/expression/UpdateExpression/spec.ts b/packages/ast-spec/src/expression/UpdateExpression/spec.ts
new file mode 100644
index 000000000000..909815fdabf3
--- /dev/null
+++ b/packages/ast-spec/src/expression/UpdateExpression/spec.ts
@@ -0,0 +1,7 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { UnaryExpressionBase } from '../../base/UnaryExpressionBase';
+
+export interface UpdateExpression extends UnaryExpressionBase {
+ type: AST_NODE_TYPES.UpdateExpression;
+ operator: '--' | '++';
+}
diff --git a/packages/ast-spec/src/expression/YieldExpression/spec.ts b/packages/ast-spec/src/expression/YieldExpression/spec.ts
new file mode 100644
index 000000000000..1f07e4f78e32
--- /dev/null
+++ b/packages/ast-spec/src/expression/YieldExpression/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface YieldExpression extends BaseNode {
+ type: AST_NODE_TYPES.YieldExpression;
+ delegate: boolean;
+ argument?: Expression;
+}
diff --git a/packages/ast-spec/src/expression/literal/BigIntLiteral/spec.ts b/packages/ast-spec/src/expression/literal/BigIntLiteral/spec.ts
new file mode 100644
index 000000000000..c27a85543ff8
--- /dev/null
+++ b/packages/ast-spec/src/expression/literal/BigIntLiteral/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../../ast-node-types';
+import type { LiteralBase } from '../../../base/LiteralBase';
+
+export interface BigIntLiteral extends LiteralBase {
+ type: AST_NODE_TYPES.Literal;
+ value: bigint | null;
+ bigint: string;
+}
diff --git a/packages/ast-spec/src/expression/literal/BooleanLiteral/spec.ts b/packages/ast-spec/src/expression/literal/BooleanLiteral/spec.ts
new file mode 100644
index 000000000000..a2310a698d02
--- /dev/null
+++ b/packages/ast-spec/src/expression/literal/BooleanLiteral/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../../ast-node-types';
+import type { LiteralBase } from '../../../base/LiteralBase';
+
+export interface BooleanLiteral extends LiteralBase {
+ type: AST_NODE_TYPES.Literal;
+ value: boolean;
+ raw: 'false' | 'true';
+}
diff --git a/packages/ast-spec/src/expression/literal/NullLiteral/spec.ts b/packages/ast-spec/src/expression/literal/NullLiteral/spec.ts
new file mode 100644
index 000000000000..f520b7b3d454
--- /dev/null
+++ b/packages/ast-spec/src/expression/literal/NullLiteral/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../../ast-node-types';
+import type { LiteralBase } from '../../../base/LiteralBase';
+
+export interface NullLiteral extends LiteralBase {
+ type: AST_NODE_TYPES.Literal;
+ value: null;
+ raw: 'null';
+}
diff --git a/packages/ast-spec/src/expression/literal/NumberLiteral/spec.ts b/packages/ast-spec/src/expression/literal/NumberLiteral/spec.ts
new file mode 100644
index 000000000000..8155bb45cafc
--- /dev/null
+++ b/packages/ast-spec/src/expression/literal/NumberLiteral/spec.ts
@@ -0,0 +1,7 @@
+import type { AST_NODE_TYPES } from '../../../ast-node-types';
+import type { LiteralBase } from '../../../base/LiteralBase';
+
+export interface NumberLiteral extends LiteralBase {
+ type: AST_NODE_TYPES.Literal;
+ value: number;
+}
diff --git a/packages/ast-spec/src/expression/literal/RegExpLiteral/spec.ts b/packages/ast-spec/src/expression/literal/RegExpLiteral/spec.ts
new file mode 100644
index 000000000000..ab45f651b768
--- /dev/null
+++ b/packages/ast-spec/src/expression/literal/RegExpLiteral/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../../ast-node-types';
+import type { LiteralBase } from '../../../base/LiteralBase';
+
+export interface RegExpLiteral extends LiteralBase {
+ type: AST_NODE_TYPES.Literal;
+ value: RegExp | null;
+ regex: {
+ pattern: string;
+ flags: string;
+ };
+}
diff --git a/packages/ast-spec/src/expression/literal/StringLiteral/spec.ts b/packages/ast-spec/src/expression/literal/StringLiteral/spec.ts
new file mode 100644
index 000000000000..de83d9d20e1d
--- /dev/null
+++ b/packages/ast-spec/src/expression/literal/StringLiteral/spec.ts
@@ -0,0 +1,7 @@
+import type { AST_NODE_TYPES } from '../../../ast-node-types';
+import type { LiteralBase } from '../../../base/LiteralBase';
+
+export interface StringLiteral extends LiteralBase {
+ type: AST_NODE_TYPES.Literal;
+ value: string;
+}
diff --git a/packages/ast-spec/src/expression/literal/spec.ts b/packages/ast-spec/src/expression/literal/spec.ts
new file mode 100644
index 000000000000..d40804b424e1
--- /dev/null
+++ b/packages/ast-spec/src/expression/literal/spec.ts
@@ -0,0 +1,6 @@
+export * from './BigIntLiteral/spec';
+export * from './BooleanLiteral/spec';
+export * from './NullLiteral/spec';
+export * from './NumberLiteral/spec';
+export * from './RegExpLiteral/spec';
+export * from './StringLiteral/spec';
diff --git a/packages/ast-spec/src/expression/spec.ts b/packages/ast-spec/src/expression/spec.ts
new file mode 100644
index 000000000000..9ea054546202
--- /dev/null
+++ b/packages/ast-spec/src/expression/spec.ts
@@ -0,0 +1,33 @@
+export * from './ArrayExpression/spec';
+export * from './ArrowFunctionExpression/spec';
+export * from './AssignmentExpression/spec';
+export * from './AwaitExpression/spec';
+export * from './BinaryExpression/spec';
+export * from './CallExpression/spec';
+export * from './ChainExpression/spec';
+export * from './ClassExpression/spec';
+export * from './ConditionalExpression/spec';
+export * from './FunctionExpression/spec';
+export * from './Identifier/spec';
+export * from './ImportExpression/spec';
+export * from './JSXElement/spec';
+export * from './JSXFragment/spec';
+export * from './LogicalExpression/spec';
+export * from './MemberExpression/spec';
+export * from './MetaProperty/spec';
+export * from './NewExpression/spec';
+export * from './ObjectExpression/spec';
+export * from './SequenceExpression/spec';
+export * from './Super/spec';
+export * from './TSAsExpression/spec';
+export * from './TSEmptyBodyFunctionExpression/spec';
+export * from './TSNonNullExpression/spec';
+export * from './TSTypeAssertion/spec';
+export * from './TaggedTemplateExpression/spec';
+export * from './TemplateLiteral/spec';
+export * from './ThisExpression/spec';
+export * from './UnaryExpression/spec';
+export * from './UpdateExpression/spec';
+export * from './YieldExpression/spec';
+
+export * from './literal/spec';
diff --git a/packages/ast-spec/src/index.ts b/packages/ast-spec/src/index.ts
new file mode 100644
index 000000000000..bd4b6584482d
--- /dev/null
+++ b/packages/ast-spec/src/index.ts
@@ -0,0 +1,52 @@
+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/OptionalRangeAndLoc';
+export * from './base/LineAndColumnData';
+export * from './base/Range';
+export * from './base/SourceLocation';
+
+export * from './unions/BindingName';
+export * from './unions/BindingPattern';
+export * from './unions/CallExpressionArgument';
+export * from './unions/ChainElement';
+export * from './unions/ClassElement';
+export * from './unions/Comment';
+export * from './unions/DeclarationStatement';
+export * from './unions/DestructuringPattern';
+export * from './unions/EntityName';
+export * from './unions/ExportDeclaration';
+export * from './unions/Expression';
+export * from './unions/ForInitialiser';
+export * from './unions/FunctionLike';
+export * from './unions/ImportClause';
+export * from './unions/IterationStatement';
+export * from './unions/JSXChild';
+export * from './unions/JSXExpression';
+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';
+export * from './unions/PrimaryExpression';
+export * from './unions/PropertyName';
+export * from './unions/Statement';
+export * from './unions/TSUnaryExpression';
+export * from './unions/Token';
+export * from './unions/TypeElement';
+export * from './unions/TypeNode';
+
+export * from './declaration/spec';
+export * from './element/spec';
+export * from './expression/spec';
+export * from './jsx/spec';
+export * from './parameter/spec';
+export * from './special/spec';
+export * from './statement/spec';
+export * from './token/spec';
+export * from './type/spec';
+
+export * from './ast-node-types';
+export * from './ast-token-types';
diff --git a/packages/ast-spec/src/jsx/JSXAttribute/spec.ts b/packages/ast-spec/src/jsx/JSXAttribute/spec.ts
new file mode 100644
index 000000000000..8fc8364c05fd
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXAttribute/spec.ts
@@ -0,0 +1,12 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { JSXExpression } from '../../unions/JSXExpression';
+import type { Literal } from '../../unions/Literal';
+import type { JSXIdentifier } from '../JSXIdentifier/spec';
+import type { JSXNamespacedName } from '../JSXNamespacedName/spec';
+
+export interface JSXAttribute extends BaseNode {
+ type: AST_NODE_TYPES.JSXAttribute;
+ name: JSXIdentifier | JSXNamespacedName;
+ value: JSXExpression | Literal | null;
+}
diff --git a/packages/ast-spec/src/jsx/JSXClosingElement/spec.ts b/packages/ast-spec/src/jsx/JSXClosingElement/spec.ts
new file mode 100644
index 000000000000..ea698d6059ed
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXClosingElement/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { JSXTagNameExpression } from '../../unions/JSXTagNameExpression';
+
+export interface JSXClosingElement extends BaseNode {
+ type: AST_NODE_TYPES.JSXClosingElement;
+ name: JSXTagNameExpression;
+}
diff --git a/packages/ast-spec/src/jsx/JSXClosingFragment/spec.ts b/packages/ast-spec/src/jsx/JSXClosingFragment/spec.ts
new file mode 100644
index 000000000000..8edd7c4e958f
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXClosingFragment/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface JSXClosingFragment extends BaseNode {
+ type: AST_NODE_TYPES.JSXClosingFragment;
+}
diff --git a/packages/ast-spec/src/jsx/JSXEmptyExpression/spec.ts b/packages/ast-spec/src/jsx/JSXEmptyExpression/spec.ts
new file mode 100644
index 000000000000..36e3c16069c4
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXEmptyExpression/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface JSXEmptyExpression extends BaseNode {
+ type: AST_NODE_TYPES.JSXEmptyExpression;
+}
diff --git a/packages/ast-spec/src/jsx/JSXExpressionContainer/spec.ts b/packages/ast-spec/src/jsx/JSXExpressionContainer/spec.ts
new file mode 100644
index 000000000000..1a0673e6fd15
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXExpressionContainer/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { JSXEmptyExpression } from '../JSXEmptyExpression/spec';
+
+export interface JSXExpressionContainer extends BaseNode {
+ type: AST_NODE_TYPES.JSXExpressionContainer;
+ expression: Expression | JSXEmptyExpression;
+}
diff --git a/packages/ast-spec/src/jsx/JSXIdentifier/spec.ts b/packages/ast-spec/src/jsx/JSXIdentifier/spec.ts
new file mode 100644
index 000000000000..1d7b71d67ab0
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXIdentifier/spec.ts
@@ -0,0 +1,7 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface JSXIdentifier extends BaseNode {
+ type: AST_NODE_TYPES.JSXIdentifier;
+ name: string;
+}
diff --git a/packages/ast-spec/src/jsx/JSXMemberExpression/spec.ts b/packages/ast-spec/src/jsx/JSXMemberExpression/spec.ts
new file mode 100644
index 000000000000..e0cda9c16ee4
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXMemberExpression/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { JSXTagNameExpression } from '../../unions/JSXTagNameExpression';
+import type { JSXIdentifier } from '../JSXIdentifier/spec';
+
+export interface JSXMemberExpression extends BaseNode {
+ type: AST_NODE_TYPES.JSXMemberExpression;
+ object: JSXTagNameExpression;
+ property: JSXIdentifier;
+}
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/spec.ts b/packages/ast-spec/src/jsx/JSXNamespacedName/spec.ts
new file mode 100644
index 000000000000..22443d938eca
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { JSXIdentifier } from '../JSXIdentifier/spec';
+
+export interface JSXNamespacedName extends BaseNode {
+ type: AST_NODE_TYPES.JSXNamespacedName;
+ namespace: JSXIdentifier;
+ name: JSXIdentifier;
+}
diff --git a/packages/ast-spec/src/jsx/JSXOpeningElement/spec.ts b/packages/ast-spec/src/jsx/JSXOpeningElement/spec.ts
new file mode 100644
index 000000000000..710fade02fa5
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXOpeningElement/spec.ts
@@ -0,0 +1,14 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSTypeParameterInstantiation } from '../../special/TSTypeParameterInstantiation/spec';
+import type { JSXTagNameExpression } from '../../unions/JSXTagNameExpression';
+import type { JSXAttribute } from '../JSXAttribute/spec';
+import type { JSXSpreadAttribute } from '../JSXSpreadAttribute/spec';
+
+export interface JSXOpeningElement extends BaseNode {
+ type: AST_NODE_TYPES.JSXOpeningElement;
+ typeParameters?: TSTypeParameterInstantiation;
+ selfClosing: boolean;
+ name: JSXTagNameExpression;
+ attributes: (JSXAttribute | JSXSpreadAttribute)[];
+}
diff --git a/packages/ast-spec/src/jsx/JSXOpeningFragment/spec.ts b/packages/ast-spec/src/jsx/JSXOpeningFragment/spec.ts
new file mode 100644
index 000000000000..9b972a237f22
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXOpeningFragment/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface JSXOpeningFragment extends BaseNode {
+ type: AST_NODE_TYPES.JSXOpeningFragment;
+}
diff --git a/packages/ast-spec/src/jsx/JSXSpreadAttribute/spec.ts b/packages/ast-spec/src/jsx/JSXSpreadAttribute/spec.ts
new file mode 100644
index 000000000000..db6e6fc1d1bc
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXSpreadAttribute/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface JSXSpreadAttribute extends BaseNode {
+ type: AST_NODE_TYPES.JSXSpreadAttribute;
+ argument: Expression;
+}
diff --git a/packages/ast-spec/src/jsx/JSXSpreadChild/spec.ts b/packages/ast-spec/src/jsx/JSXSpreadChild/spec.ts
new file mode 100644
index 000000000000..53fe53555c30
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXSpreadChild/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { JSXEmptyExpression } from '../JSXEmptyExpression/spec';
+
+export interface JSXSpreadChild extends BaseNode {
+ type: AST_NODE_TYPES.JSXSpreadChild;
+ expression: Expression | JSXEmptyExpression;
+}
diff --git a/packages/ast-spec/src/jsx/JSXText/spec.ts b/packages/ast-spec/src/jsx/JSXText/spec.ts
new file mode 100644
index 000000000000..a323493fba90
--- /dev/null
+++ b/packages/ast-spec/src/jsx/JSXText/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface JSXText extends BaseNode {
+ type: AST_NODE_TYPES.JSXText;
+ value: string;
+ raw: string;
+}
diff --git a/packages/ast-spec/src/jsx/spec.ts b/packages/ast-spec/src/jsx/spec.ts
new file mode 100644
index 000000000000..1efb134bed7f
--- /dev/null
+++ b/packages/ast-spec/src/jsx/spec.ts
@@ -0,0 +1,13 @@
+export * from './JSXAttribute/spec';
+export * from './JSXClosingElement/spec';
+export * from './JSXClosingFragment/spec';
+export * from './JSXEmptyExpression/spec';
+export * from './JSXExpressionContainer/spec';
+export * from './JSXIdentifier/spec';
+export * from './JSXMemberExpression/spec';
+export * from './JSXNamespacedName/spec';
+export * from './JSXOpeningElement/spec';
+export * from './JSXOpeningFragment/spec';
+export * from './JSXSpreadAttribute/spec';
+export * from './JSXSpreadChild/spec';
+export * from './JSXText/spec';
diff --git a/packages/ast-spec/src/parameter/ArrayPattern/spec.ts b/packages/ast-spec/src/parameter/ArrayPattern/spec.ts
new file mode 100644
index 000000000000..420a93278731
--- /dev/null
+++ b/packages/ast-spec/src/parameter/ArrayPattern/spec.ts
@@ -0,0 +1,13 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Decorator } from '../../special/Decorator/spec';
+import type { TSTypeAnnotation } from '../../special/TSTypeAnnotation/spec';
+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[];
+}
diff --git a/packages/ast-spec/src/parameter/AssignmentPattern/spec.ts b/packages/ast-spec/src/parameter/AssignmentPattern/spec.ts
new file mode 100644
index 000000000000..ee558c2167c2
--- /dev/null
+++ b/packages/ast-spec/src/parameter/AssignmentPattern/spec.ts
@@ -0,0 +1,15 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Decorator } from '../../special/Decorator/spec';
+import type { TSTypeAnnotation } from '../../special/TSTypeAnnotation/spec';
+import type { BindingName } from '../../unions/BindingName';
+import type { Expression } from '../../unions/Expression';
+
+export interface AssignmentPattern extends BaseNode {
+ type: AST_NODE_TYPES.AssignmentPattern;
+ left: BindingName;
+ right: Expression;
+ typeAnnotation?: TSTypeAnnotation;
+ optional?: boolean;
+ decorators?: Decorator[];
+}
diff --git a/packages/ast-spec/src/parameter/ObjectPattern/spec.ts b/packages/ast-spec/src/parameter/ObjectPattern/spec.ts
new file mode 100644
index 000000000000..12c89878794e
--- /dev/null
+++ b/packages/ast-spec/src/parameter/ObjectPattern/spec.ts
@@ -0,0 +1,14 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Property } from '../../element/Property/spec';
+import type { Decorator } from '../../special/Decorator/spec';
+import type { TSTypeAnnotation } from '../../special/TSTypeAnnotation/spec';
+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[];
+}
diff --git a/packages/ast-spec/src/parameter/RestElement/spec.ts b/packages/ast-spec/src/parameter/RestElement/spec.ts
new file mode 100644
index 000000000000..006f5e48ba3b
--- /dev/null
+++ b/packages/ast-spec/src/parameter/RestElement/spec.ts
@@ -0,0 +1,15 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Decorator } from '../../special/Decorator/spec';
+import type { TSTypeAnnotation } from '../../special/TSTypeAnnotation/spec';
+import type { DestructuringPattern } from '../../unions/DestructuringPattern';
+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[];
+}
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/spec.ts b/packages/ast-spec/src/parameter/TSParameterProperty/spec.ts
new file mode 100644
index 000000000000..d04e49fd98b8
--- /dev/null
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/spec.ts
@@ -0,0 +1,17 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { Accessibility } from '../../base/Accessibility';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Decorator } from '../../special/Decorator/spec';
+import type { BindingName } from '../../unions/BindingName';
+import type { AssignmentPattern } from '../AssignmentPattern/spec';
+import type { RestElement } from '../RestElement/spec';
+
+export interface TSParameterProperty extends BaseNode {
+ type: AST_NODE_TYPES.TSParameterProperty;
+ accessibility?: Accessibility;
+ readonly?: boolean;
+ static?: boolean;
+ export?: boolean;
+ parameter: AssignmentPattern | BindingName | RestElement;
+ decorators?: Decorator[];
+}
diff --git a/packages/ast-spec/src/parameter/spec.ts b/packages/ast-spec/src/parameter/spec.ts
new file mode 100644
index 000000000000..b006664a36ae
--- /dev/null
+++ b/packages/ast-spec/src/parameter/spec.ts
@@ -0,0 +1,5 @@
+export * from './ArrayPattern/spec';
+export * from './AssignmentPattern/spec';
+export * from './ObjectPattern/spec';
+export * from './RestElement/spec';
+export * from './TSParameterProperty/spec';
diff --git a/packages/ast-spec/src/special/CatchClause/spec.ts b/packages/ast-spec/src/special/CatchClause/spec.ts
new file mode 100644
index 000000000000..dea8168acda0
--- /dev/null
+++ b/packages/ast-spec/src/special/CatchClause/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { BlockStatement } from '../../statement/BlockStatement/spec';
+import type { BindingName } from '../../unions/BindingName';
+
+export interface CatchClause extends BaseNode {
+ type: AST_NODE_TYPES.CatchClause;
+ param: BindingName | null;
+ body: BlockStatement;
+}
diff --git a/packages/ast-spec/src/special/ClassBody/spec.ts b/packages/ast-spec/src/special/ClassBody/spec.ts
new file mode 100644
index 000000000000..11c93d540fb3
--- /dev/null
+++ b/packages/ast-spec/src/special/ClassBody/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { ClassElement } from '../../unions/ClassElement';
+
+export interface ClassBody extends BaseNode {
+ type: AST_NODE_TYPES.ClassBody;
+ body: ClassElement[];
+}
diff --git a/packages/ast-spec/src/special/Decorator/spec.ts b/packages/ast-spec/src/special/Decorator/spec.ts
new file mode 100644
index 000000000000..3c8d1e819042
--- /dev/null
+++ b/packages/ast-spec/src/special/Decorator/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression';
+
+export interface Decorator extends BaseNode {
+ type: AST_NODE_TYPES.Decorator;
+ expression: LeftHandSideExpression;
+}
diff --git a/packages/ast-spec/src/special/EmptyStatement/spec.ts b/packages/ast-spec/src/special/EmptyStatement/spec.ts
new file mode 100644
index 000000000000..530283d3bdc1
--- /dev/null
+++ b/packages/ast-spec/src/special/EmptyStatement/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface EmptyStatement extends BaseNode {
+ type: AST_NODE_TYPES.EmptyStatement;
+}
diff --git a/packages/ast-spec/src/special/ExportSpecifier/spec.ts b/packages/ast-spec/src/special/ExportSpecifier/spec.ts
new file mode 100644
index 000000000000..8fd038e92be6
--- /dev/null
+++ b/packages/ast-spec/src/special/ExportSpecifier/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+
+export interface ExportSpecifier extends BaseNode {
+ type: AST_NODE_TYPES.ExportSpecifier;
+ local: Identifier;
+ exported: Identifier;
+}
diff --git a/packages/ast-spec/src/special/ImportDefaultSpecifier/spec.ts b/packages/ast-spec/src/special/ImportDefaultSpecifier/spec.ts
new file mode 100644
index 000000000000..c4ad22f20340
--- /dev/null
+++ b/packages/ast-spec/src/special/ImportDefaultSpecifier/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+
+export interface ImportDefaultSpecifier extends BaseNode {
+ type: AST_NODE_TYPES.ImportDefaultSpecifier;
+ local: Identifier;
+}
diff --git a/packages/ast-spec/src/special/ImportNamespaceSpecifier/spec.ts b/packages/ast-spec/src/special/ImportNamespaceSpecifier/spec.ts
new file mode 100644
index 000000000000..eec79636f1fc
--- /dev/null
+++ b/packages/ast-spec/src/special/ImportNamespaceSpecifier/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+
+export interface ImportNamespaceSpecifier extends BaseNode {
+ type: AST_NODE_TYPES.ImportNamespaceSpecifier;
+ local: Identifier;
+}
diff --git a/packages/ast-spec/src/special/ImportSpecifier/spec.ts b/packages/ast-spec/src/special/ImportSpecifier/spec.ts
new file mode 100644
index 000000000000..326df7db6b65
--- /dev/null
+++ b/packages/ast-spec/src/special/ImportSpecifier/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+
+export interface ImportSpecifier extends BaseNode {
+ type: AST_NODE_TYPES.ImportSpecifier;
+ local: Identifier;
+ imported: Identifier;
+}
diff --git a/packages/ast-spec/src/special/Program/spec.ts b/packages/ast-spec/src/special/Program/spec.ts
new file mode 100644
index 000000000000..81d69e1e604d
--- /dev/null
+++ b/packages/ast-spec/src/special/Program/spec.ts
@@ -0,0 +1,13 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Comment } from '../../unions/Comment';
+import type { ProgramStatement } from '../../unions/Statement';
+import type { Token } from '../../unions/Token';
+
+export interface Program extends BaseNode {
+ type: AST_NODE_TYPES.Program;
+ body: ProgramStatement[];
+ sourceType: 'module' | 'script';
+ comments?: Comment[];
+ tokens?: Token[];
+}
diff --git a/packages/ast-spec/src/special/SwitchCase/spec.ts b/packages/ast-spec/src/special/SwitchCase/spec.ts
new file mode 100644
index 000000000000..f48f323536a4
--- /dev/null
+++ b/packages/ast-spec/src/special/SwitchCase/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { Statement } from '../../unions/Statement';
+
+export interface SwitchCase extends BaseNode {
+ type: AST_NODE_TYPES.SwitchCase;
+ test: Expression | null;
+ consequent: Statement[];
+}
diff --git a/packages/ast-spec/src/special/TSClassImplements/spec.ts b/packages/ast-spec/src/special/TSClassImplements/spec.ts
new file mode 100644
index 000000000000..98213713edc4
--- /dev/null
+++ b/packages/ast-spec/src/special/TSClassImplements/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { TSHeritageBase } from '../../base/TSHeritageBase';
+
+export interface TSClassImplements extends TSHeritageBase {
+ type: AST_NODE_TYPES.TSClassImplements;
+}
diff --git a/packages/ast-spec/src/special/TSExternalModuleReference/spec.ts b/packages/ast-spec/src/special/TSExternalModuleReference/spec.ts
new file mode 100644
index 000000000000..e634d4d0d6e9
--- /dev/null
+++ b/packages/ast-spec/src/special/TSExternalModuleReference/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface TSExternalModuleReference extends BaseNode {
+ type: AST_NODE_TYPES.TSExternalModuleReference;
+ expression: Expression;
+}
diff --git a/packages/ast-spec/src/special/TSInterfaceBody/spec.ts b/packages/ast-spec/src/special/TSInterfaceBody/spec.ts
new file mode 100644
index 000000000000..1ee1c901c14d
--- /dev/null
+++ b/packages/ast-spec/src/special/TSInterfaceBody/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeElement } from '../../unions/TypeElement';
+
+export interface TSInterfaceBody extends BaseNode {
+ type: AST_NODE_TYPES.TSInterfaceBody;
+ body: TypeElement[];
+}
diff --git a/packages/ast-spec/src/special/TSInterfaceHeritage/spec.ts b/packages/ast-spec/src/special/TSInterfaceHeritage/spec.ts
new file mode 100644
index 000000000000..29382acd5460
--- /dev/null
+++ b/packages/ast-spec/src/special/TSInterfaceHeritage/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { TSHeritageBase } from '../../base/TSHeritageBase';
+
+export interface TSInterfaceHeritage extends TSHeritageBase {
+ type: AST_NODE_TYPES.TSInterfaceHeritage;
+}
diff --git a/packages/ast-spec/src/special/TSModuleBlock/spec.ts b/packages/ast-spec/src/special/TSModuleBlock/spec.ts
new file mode 100644
index 000000000000..9fed19af3b80
--- /dev/null
+++ b/packages/ast-spec/src/special/TSModuleBlock/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { ProgramStatement } from '../../unions/Statement';
+
+export interface TSModuleBlock extends BaseNode {
+ type: AST_NODE_TYPES.TSModuleBlock;
+ body: ProgramStatement[];
+}
diff --git a/packages/ast-spec/src/special/TSTypeAnnotation/spec.ts b/packages/ast-spec/src/special/TSTypeAnnotation/spec.ts
new file mode 100644
index 000000000000..bb9272353cbc
--- /dev/null
+++ b/packages/ast-spec/src/special/TSTypeAnnotation/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSTypeAnnotation extends BaseNode {
+ type: AST_NODE_TYPES.TSTypeAnnotation;
+ typeAnnotation: TypeNode;
+}
diff --git a/packages/ast-spec/src/special/TSTypeParameter/spec.ts b/packages/ast-spec/src/special/TSTypeParameter/spec.ts
new file mode 100644
index 000000000000..61d75a6a29ed
--- /dev/null
+++ b/packages/ast-spec/src/special/TSTypeParameter/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSTypeParameter extends BaseNode {
+ type: AST_NODE_TYPES.TSTypeParameter;
+ name: Identifier;
+ constraint?: TypeNode;
+ default?: TypeNode;
+}
diff --git a/packages/ast-spec/src/special/TSTypeParameterDeclaration/spec.ts b/packages/ast-spec/src/special/TSTypeParameterDeclaration/spec.ts
new file mode 100644
index 000000000000..ac8971e38a0c
--- /dev/null
+++ b/packages/ast-spec/src/special/TSTypeParameterDeclaration/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSTypeParameter } from '../TSTypeParameter/spec';
+
+export interface TSTypeParameterDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.TSTypeParameterDeclaration;
+ params: TSTypeParameter[];
+}
diff --git a/packages/ast-spec/src/special/TSTypeParameterInstantiation/spec.ts b/packages/ast-spec/src/special/TSTypeParameterInstantiation/spec.ts
new file mode 100644
index 000000000000..e5122c2f6a5c
--- /dev/null
+++ b/packages/ast-spec/src/special/TSTypeParameterInstantiation/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSTypeParameterInstantiation extends BaseNode {
+ type: AST_NODE_TYPES.TSTypeParameterInstantiation;
+ params: TypeNode[];
+}
diff --git a/packages/ast-spec/src/special/TemplateElement/spec.ts b/packages/ast-spec/src/special/TemplateElement/spec.ts
new file mode 100644
index 000000000000..abf4dc910457
--- /dev/null
+++ b/packages/ast-spec/src/special/TemplateElement/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TemplateElement extends BaseNode {
+ type: AST_NODE_TYPES.TemplateElement;
+ value: {
+ raw: string;
+ cooked: string;
+ };
+ tail: boolean;
+}
diff --git a/packages/ast-spec/src/special/VariableDeclarator/spec.ts b/packages/ast-spec/src/special/VariableDeclarator/spec.ts
new file mode 100644
index 000000000000..619c6a57d5dc
--- /dev/null
+++ b/packages/ast-spec/src/special/VariableDeclarator/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { BindingName } from '../../unions/BindingName';
+import type { Expression } from '../../unions/Expression';
+
+export interface VariableDeclarator extends BaseNode {
+ type: AST_NODE_TYPES.VariableDeclarator;
+ id: BindingName;
+ init: Expression | null;
+ definite?: boolean;
+}
diff --git a/packages/ast-spec/src/special/spec.ts b/packages/ast-spec/src/special/spec.ts
new file mode 100644
index 000000000000..07142e15c8f9
--- /dev/null
+++ b/packages/ast-spec/src/special/spec.ts
@@ -0,0 +1,21 @@
+export * from './CatchClause/spec';
+export * from './ClassBody/spec';
+export * from './Decorator/spec';
+export * from './EmptyStatement/spec';
+export * from './ExportSpecifier/spec';
+export * from './ImportDefaultSpecifier/spec';
+export * from './ImportNamespaceSpecifier/spec';
+export * from './ImportSpecifier/spec';
+export * from './Program/spec';
+export * from './SwitchCase/spec';
+export * from './TSClassImplements/spec';
+export * from './TSExternalModuleReference/spec';
+export * from './TSInterfaceBody/spec';
+export * from './TSInterfaceHeritage/spec';
+export * from './TSModuleBlock/spec';
+export * from './TSTypeAnnotation/spec';
+export * from './TSTypeParameter/spec';
+export * from './TSTypeParameterDeclaration/spec';
+export * from './TSTypeParameterInstantiation/spec';
+export * from './TemplateElement/spec';
+export * from './VariableDeclarator/spec';
diff --git a/packages/ast-spec/src/statement/BlockStatement/spec.ts b/packages/ast-spec/src/statement/BlockStatement/spec.ts
new file mode 100644
index 000000000000..298a962e5161
--- /dev/null
+++ b/packages/ast-spec/src/statement/BlockStatement/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Statement } from '../../unions/Statement';
+
+export interface BlockStatement extends BaseNode {
+ type: AST_NODE_TYPES.BlockStatement;
+ body: Statement[];
+}
diff --git a/packages/ast-spec/src/statement/BreakStatement/spec.ts b/packages/ast-spec/src/statement/BreakStatement/spec.ts
new file mode 100644
index 000000000000..0441c298d365
--- /dev/null
+++ b/packages/ast-spec/src/statement/BreakStatement/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+
+export interface BreakStatement extends BaseNode {
+ type: AST_NODE_TYPES.BreakStatement;
+ label: Identifier | null;
+}
diff --git a/packages/ast-spec/src/statement/ContinueStatement/spec.ts b/packages/ast-spec/src/statement/ContinueStatement/spec.ts
new file mode 100644
index 000000000000..70f2373dc217
--- /dev/null
+++ b/packages/ast-spec/src/statement/ContinueStatement/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+
+export interface ContinueStatement extends BaseNode {
+ type: AST_NODE_TYPES.ContinueStatement;
+ label: Identifier | null;
+}
diff --git a/packages/ast-spec/src/statement/DebuggerStatement/spec.ts b/packages/ast-spec/src/statement/DebuggerStatement/spec.ts
new file mode 100644
index 000000000000..f28b7fc41b72
--- /dev/null
+++ b/packages/ast-spec/src/statement/DebuggerStatement/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface DebuggerStatement extends BaseNode {
+ type: AST_NODE_TYPES.DebuggerStatement;
+}
diff --git a/packages/ast-spec/src/statement/DoWhileStatement/spec.ts b/packages/ast-spec/src/statement/DoWhileStatement/spec.ts
new file mode 100644
index 000000000000..933ce61b2c4c
--- /dev/null
+++ b/packages/ast-spec/src/statement/DoWhileStatement/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { Statement } from '../../unions/Statement';
+
+export interface DoWhileStatement extends BaseNode {
+ type: AST_NODE_TYPES.DoWhileStatement;
+ test: Expression;
+ body: Statement;
+}
diff --git a/packages/ast-spec/src/statement/ExpressionStatement/spec.ts b/packages/ast-spec/src/statement/ExpressionStatement/spec.ts
new file mode 100644
index 000000000000..f5fd336a9604
--- /dev/null
+++ b/packages/ast-spec/src/statement/ExpressionStatement/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface ExpressionStatement extends BaseNode {
+ type: AST_NODE_TYPES.ExpressionStatement;
+ expression: Expression;
+ directive?: string;
+}
diff --git a/packages/ast-spec/src/statement/ForInStatement/spec.ts b/packages/ast-spec/src/statement/ForInStatement/spec.ts
new file mode 100644
index 000000000000..7abe3b2f5fad
--- /dev/null
+++ b/packages/ast-spec/src/statement/ForInStatement/spec.ts
@@ -0,0 +1,12 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { ForInitialiser } from '../../unions/ForInitialiser';
+import type { Statement } from '../../unions/Statement';
+
+export interface ForInStatement extends BaseNode {
+ type: AST_NODE_TYPES.ForInStatement;
+ left: ForInitialiser;
+ right: Expression;
+ body: Statement;
+}
diff --git a/packages/ast-spec/src/statement/ForOfStatement/spec.ts b/packages/ast-spec/src/statement/ForOfStatement/spec.ts
new file mode 100644
index 000000000000..963261eaaac8
--- /dev/null
+++ b/packages/ast-spec/src/statement/ForOfStatement/spec.ts
@@ -0,0 +1,13 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { ForInitialiser } from '../../unions/ForInitialiser';
+import type { Statement } from '../../unions/Statement';
+
+export interface ForOfStatement extends BaseNode {
+ type: AST_NODE_TYPES.ForOfStatement;
+ left: ForInitialiser;
+ right: Expression;
+ body: Statement;
+ await: boolean;
+}
diff --git a/packages/ast-spec/src/statement/ForStatement/spec.ts b/packages/ast-spec/src/statement/ForStatement/spec.ts
new file mode 100644
index 000000000000..1b56756b3a50
--- /dev/null
+++ b/packages/ast-spec/src/statement/ForStatement/spec.ts
@@ -0,0 +1,13 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { ForInitialiser } from '../../unions/ForInitialiser';
+import type { Statement } from '../../unions/Statement';
+
+export interface ForStatement extends BaseNode {
+ type: AST_NODE_TYPES.ForStatement;
+ init: Expression | ForInitialiser | null;
+ test: Expression | null;
+ update: Expression | null;
+ body: Statement;
+}
diff --git a/packages/ast-spec/src/statement/IfStatement/spec.ts b/packages/ast-spec/src/statement/IfStatement/spec.ts
new file mode 100644
index 000000000000..f9081923e64a
--- /dev/null
+++ b/packages/ast-spec/src/statement/IfStatement/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { Statement } from '../../unions/Statement';
+
+export interface IfStatement extends BaseNode {
+ type: AST_NODE_TYPES.IfStatement;
+ test: Expression;
+ consequent: Statement;
+ alternate: Statement | null;
+}
diff --git a/packages/ast-spec/src/statement/ImportDeclaration/spec.ts b/packages/ast-spec/src/statement/ImportDeclaration/spec.ts
new file mode 100644
index 000000000000..eaaad5f53e32
--- /dev/null
+++ b/packages/ast-spec/src/statement/ImportDeclaration/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { ImportClause } from '../../unions/ImportClause';
+import type { Literal } from '../../unions/Literal';
+
+export interface ImportDeclaration extends BaseNode {
+ type: AST_NODE_TYPES.ImportDeclaration;
+ source: Literal;
+ specifiers: ImportClause[];
+ importKind: 'type' | 'value';
+}
diff --git a/packages/ast-spec/src/statement/LabeledStatement/spec.ts b/packages/ast-spec/src/statement/LabeledStatement/spec.ts
new file mode 100644
index 000000000000..d007008d3a4b
--- /dev/null
+++ b/packages/ast-spec/src/statement/LabeledStatement/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { Statement } from '../../unions/Statement';
+
+export interface LabeledStatement extends BaseNode {
+ type: AST_NODE_TYPES.LabeledStatement;
+ label: Identifier;
+ body: Statement;
+}
diff --git a/packages/ast-spec/src/statement/ReturnStatement/spec.ts b/packages/ast-spec/src/statement/ReturnStatement/spec.ts
new file mode 100644
index 000000000000..d7758715c8dd
--- /dev/null
+++ b/packages/ast-spec/src/statement/ReturnStatement/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface ReturnStatement extends BaseNode {
+ type: AST_NODE_TYPES.ReturnStatement;
+ argument: Expression | null;
+}
diff --git a/packages/ast-spec/src/statement/SwitchStatement/spec.ts b/packages/ast-spec/src/statement/SwitchStatement/spec.ts
new file mode 100644
index 000000000000..9c76f81455c8
--- /dev/null
+++ b/packages/ast-spec/src/statement/SwitchStatement/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { SwitchCase } from '../../special/SwitchCase/spec';
+import type { Expression } from '../../unions/Expression';
+
+export interface SwitchStatement extends BaseNode {
+ type: AST_NODE_TYPES.SwitchStatement;
+ discriminant: Expression;
+ cases: SwitchCase[];
+}
diff --git a/packages/ast-spec/src/statement/TSExportAssignment/spec.ts b/packages/ast-spec/src/statement/TSExportAssignment/spec.ts
new file mode 100644
index 000000000000..3792bc5012b1
--- /dev/null
+++ b/packages/ast-spec/src/statement/TSExportAssignment/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+
+export interface TSExportAssignment extends BaseNode {
+ type: AST_NODE_TYPES.TSExportAssignment;
+ expression: Expression;
+}
diff --git a/packages/ast-spec/src/statement/ThrowStatement/spec.ts b/packages/ast-spec/src/statement/ThrowStatement/spec.ts
new file mode 100644
index 000000000000..ac47bd98778c
--- /dev/null
+++ b/packages/ast-spec/src/statement/ThrowStatement/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSAsExpression } from '../../expression/TSAsExpression/spec';
+import type { Statement } from '../../unions/Statement';
+
+export interface ThrowStatement extends BaseNode {
+ type: AST_NODE_TYPES.ThrowStatement;
+ argument: Statement | TSAsExpression | null;
+}
diff --git a/packages/ast-spec/src/statement/TryStatement/spec.ts b/packages/ast-spec/src/statement/TryStatement/spec.ts
new file mode 100644
index 000000000000..0435fbeb2100
--- /dev/null
+++ b/packages/ast-spec/src/statement/TryStatement/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { CatchClause } from '../../special/CatchClause/spec';
+import type { BlockStatement } from '../BlockStatement/spec';
+
+export interface TryStatement extends BaseNode {
+ type: AST_NODE_TYPES.TryStatement;
+ block: BlockStatement;
+ handler: CatchClause | null;
+ finalizer: BlockStatement | null;
+}
diff --git a/packages/ast-spec/src/statement/WhileStatement/spec.ts b/packages/ast-spec/src/statement/WhileStatement/spec.ts
new file mode 100644
index 000000000000..1c9492c77140
--- /dev/null
+++ b/packages/ast-spec/src/statement/WhileStatement/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { Statement } from '../../unions/Statement';
+
+export interface WhileStatement extends BaseNode {
+ type: AST_NODE_TYPES.WhileStatement;
+ test: Expression;
+ body: Statement;
+}
diff --git a/packages/ast-spec/src/statement/WithStatement/spec.ts b/packages/ast-spec/src/statement/WithStatement/spec.ts
new file mode 100644
index 000000000000..c661a5175b9a
--- /dev/null
+++ b/packages/ast-spec/src/statement/WithStatement/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Expression } from '../../unions/Expression';
+import type { Statement } from '../../unions/Statement';
+
+export interface WithStatement extends BaseNode {
+ type: AST_NODE_TYPES.WithStatement;
+ object: Expression;
+ body: Statement;
+}
diff --git a/packages/ast-spec/src/statement/spec.ts b/packages/ast-spec/src/statement/spec.ts
new file mode 100644
index 000000000000..d1ce293283e4
--- /dev/null
+++ b/packages/ast-spec/src/statement/spec.ts
@@ -0,0 +1,19 @@
+export * from './BlockStatement/spec';
+export * from './BreakStatement/spec';
+export * from './ContinueStatement/spec';
+export * from './DebuggerStatement/spec';
+export * from './DoWhileStatement/spec';
+export * from './ExpressionStatement/spec';
+export * from './ForInStatement/spec';
+export * from './ForOfStatement/spec';
+export * from './ForStatement/spec';
+export * from './IfStatement/spec';
+export * from './ImportDeclaration/spec';
+export * from './LabeledStatement/spec';
+export * from './ReturnStatement/spec';
+export * from './SwitchStatement/spec';
+export * from './TSExportAssignment/spec';
+export * from './ThrowStatement/spec';
+export * from './TryStatement/spec';
+export * from './WhileStatement/spec';
+export * from './WithStatement/spec';
diff --git a/packages/ast-spec/src/token/BlockComment/spec.ts b/packages/ast-spec/src/token/BlockComment/spec.ts
new file mode 100644
index 000000000000..c2c7db298a4f
--- /dev/null
+++ b/packages/ast-spec/src/token/BlockComment/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface BlockComment extends BaseToken {
+ type: AST_TOKEN_TYPES.Block;
+}
diff --git a/packages/ast-spec/src/token/BooleanToken/spec.ts b/packages/ast-spec/src/token/BooleanToken/spec.ts
new file mode 100644
index 000000000000..eeace18c8cd9
--- /dev/null
+++ b/packages/ast-spec/src/token/BooleanToken/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface BooleanToken extends BaseToken {
+ type: AST_TOKEN_TYPES.Boolean;
+}
diff --git a/packages/ast-spec/src/token/IdentifierToken/spec.ts b/packages/ast-spec/src/token/IdentifierToken/spec.ts
new file mode 100644
index 000000000000..9df6e14c3c99
--- /dev/null
+++ b/packages/ast-spec/src/token/IdentifierToken/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface IdentifierToken extends BaseToken {
+ type: AST_TOKEN_TYPES.Identifier;
+}
diff --git a/packages/ast-spec/src/token/JSXIdentifierToken/spec.ts b/packages/ast-spec/src/token/JSXIdentifierToken/spec.ts
new file mode 100644
index 000000000000..858775073735
--- /dev/null
+++ b/packages/ast-spec/src/token/JSXIdentifierToken/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface JSXIdentifierToken extends BaseToken {
+ type: AST_TOKEN_TYPES.JSXIdentifier;
+}
diff --git a/packages/ast-spec/src/token/JSXTextToken/spec.ts b/packages/ast-spec/src/token/JSXTextToken/spec.ts
new file mode 100644
index 000000000000..6a8d3aa5d50d
--- /dev/null
+++ b/packages/ast-spec/src/token/JSXTextToken/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface JSXTextToken extends BaseToken {
+ type: AST_TOKEN_TYPES.JSXText;
+}
diff --git a/packages/ast-spec/src/token/KeywordToken/spec.ts b/packages/ast-spec/src/token/KeywordToken/spec.ts
new file mode 100644
index 000000000000..b7e9c058f692
--- /dev/null
+++ b/packages/ast-spec/src/token/KeywordToken/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface KeywordToken extends BaseToken {
+ type: AST_TOKEN_TYPES.Keyword;
+}
diff --git a/packages/ast-spec/src/token/LineComment/spec.ts b/packages/ast-spec/src/token/LineComment/spec.ts
new file mode 100644
index 000000000000..82db26f07442
--- /dev/null
+++ b/packages/ast-spec/src/token/LineComment/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface LineComment extends BaseToken {
+ type: AST_TOKEN_TYPES.Line;
+}
diff --git a/packages/ast-spec/src/token/NullToken/spec.ts b/packages/ast-spec/src/token/NullToken/spec.ts
new file mode 100644
index 000000000000..d5ae492de83a
--- /dev/null
+++ b/packages/ast-spec/src/token/NullToken/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface NullToken extends BaseToken {
+ type: AST_TOKEN_TYPES.Null;
+}
diff --git a/packages/ast-spec/src/token/NumericToken/spec.ts b/packages/ast-spec/src/token/NumericToken/spec.ts
new file mode 100644
index 000000000000..a00fd383df75
--- /dev/null
+++ b/packages/ast-spec/src/token/NumericToken/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface NumericToken extends BaseToken {
+ type: AST_TOKEN_TYPES.Numeric;
+}
diff --git a/packages/ast-spec/src/token/PunctuatorToken/spec.ts b/packages/ast-spec/src/token/PunctuatorToken/spec.ts
new file mode 100644
index 000000000000..39b9507348c2
--- /dev/null
+++ b/packages/ast-spec/src/token/PunctuatorToken/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface PunctuatorToken extends BaseToken {
+ type: AST_TOKEN_TYPES.Punctuator;
+}
diff --git a/packages/ast-spec/src/token/RegularExpressionToken/spec.ts b/packages/ast-spec/src/token/RegularExpressionToken/spec.ts
new file mode 100644
index 000000000000..7b0bb09d5262
--- /dev/null
+++ b/packages/ast-spec/src/token/RegularExpressionToken/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface RegularExpressionToken extends BaseToken {
+ type: AST_TOKEN_TYPES.RegularExpression;
+ regex: {
+ pattern: string;
+ flags: string;
+ };
+}
diff --git a/packages/ast-spec/src/token/StringToken/spec.ts b/packages/ast-spec/src/token/StringToken/spec.ts
new file mode 100644
index 000000000000..6b6535c6208d
--- /dev/null
+++ b/packages/ast-spec/src/token/StringToken/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface StringToken extends BaseToken {
+ type: AST_TOKEN_TYPES.String;
+}
diff --git a/packages/ast-spec/src/token/TSAbstractKeyword/spec.ts b/packages/ast-spec/src/token/TSAbstractKeyword/spec.ts
new file mode 100644
index 000000000000..d15a55443c57
--- /dev/null
+++ b/packages/ast-spec/src/token/TSAbstractKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSAbstractKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSAbstractKeyword;
+}
diff --git a/packages/ast-spec/src/token/TSAsyncKeyword/spec.ts b/packages/ast-spec/src/token/TSAsyncKeyword/spec.ts
new file mode 100644
index 000000000000..26baddf7ad64
--- /dev/null
+++ b/packages/ast-spec/src/token/TSAsyncKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSAsyncKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSAsyncKeyword;
+}
diff --git a/packages/ast-spec/src/token/TSDeclareKeyword/spec.ts b/packages/ast-spec/src/token/TSDeclareKeyword/spec.ts
new file mode 100644
index 000000000000..8b6e6606b3e8
--- /dev/null
+++ b/packages/ast-spec/src/token/TSDeclareKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSDeclareKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSDeclareKeyword;
+}
diff --git a/packages/ast-spec/src/token/TSExportKeyword/spec.ts b/packages/ast-spec/src/token/TSExportKeyword/spec.ts
new file mode 100644
index 000000000000..016664d11b03
--- /dev/null
+++ b/packages/ast-spec/src/token/TSExportKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSExportKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSExportKeyword;
+}
diff --git a/packages/ast-spec/src/token/TSPrivateKeyword/spec.ts b/packages/ast-spec/src/token/TSPrivateKeyword/spec.ts
new file mode 100644
index 000000000000..ae57db0a066c
--- /dev/null
+++ b/packages/ast-spec/src/token/TSPrivateKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSPrivateKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSPrivateKeyword;
+}
diff --git a/packages/ast-spec/src/token/TSProtectedKeyword/spec.ts b/packages/ast-spec/src/token/TSProtectedKeyword/spec.ts
new file mode 100644
index 000000000000..815b28a1c2c1
--- /dev/null
+++ b/packages/ast-spec/src/token/TSProtectedKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSProtectedKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSProtectedKeyword;
+}
diff --git a/packages/ast-spec/src/token/TSPublicKeyword/spec.ts b/packages/ast-spec/src/token/TSPublicKeyword/spec.ts
new file mode 100644
index 000000000000..3409fc6d689a
--- /dev/null
+++ b/packages/ast-spec/src/token/TSPublicKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSPublicKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSPublicKeyword;
+}
diff --git a/packages/ast-spec/src/token/TSReadonlyKeyword/spec.ts b/packages/ast-spec/src/token/TSReadonlyKeyword/spec.ts
new file mode 100644
index 000000000000..462849972785
--- /dev/null
+++ b/packages/ast-spec/src/token/TSReadonlyKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSReadonlyKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSReadonlyKeyword;
+}
diff --git a/packages/ast-spec/src/token/TSStaticKeyword/spec.ts b/packages/ast-spec/src/token/TSStaticKeyword/spec.ts
new file mode 100644
index 000000000000..1c2417eeb589
--- /dev/null
+++ b/packages/ast-spec/src/token/TSStaticKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSStaticKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSStaticKeyword;
+}
diff --git a/packages/ast-spec/src/token/TemplateToken/spec.ts b/packages/ast-spec/src/token/TemplateToken/spec.ts
new file mode 100644
index 000000000000..da64ef0b6e98
--- /dev/null
+++ b/packages/ast-spec/src/token/TemplateToken/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_TOKEN_TYPES } from '../../ast-token-types';
+import type { BaseToken } from '../../base/BaseToken';
+
+export interface TemplateToken extends BaseToken {
+ type: AST_TOKEN_TYPES.Template;
+}
diff --git a/packages/ast-spec/src/token/spec.ts b/packages/ast-spec/src/token/spec.ts
new file mode 100644
index 000000000000..45df05189eb2
--- /dev/null
+++ b/packages/ast-spec/src/token/spec.ts
@@ -0,0 +1,22 @@
+export * from './BlockComment/spec';
+export * from './BooleanToken/spec';
+export * from './IdentifierToken/spec';
+export * from './JSXIdentifierToken/spec';
+export * from './JSXTextToken/spec';
+export * from './KeywordToken/spec';
+export * from './LineComment/spec';
+export * from './NullToken/spec';
+export * from './NumericToken/spec';
+export * from './PunctuatorToken/spec';
+export * from './RegularExpressionToken/spec';
+export * from './StringToken/spec';
+export * from './TSAbstractKeyword/spec';
+export * from './TSAsyncKeyword/spec';
+export * from './TSDeclareKeyword/spec';
+export * from './TSExportKeyword/spec';
+export * from './TSPrivateKeyword/spec';
+export * from './TSProtectedKeyword/spec';
+export * from './TSPublicKeyword/spec';
+export * from './TSReadonlyKeyword/spec';
+export * from './TSStaticKeyword/spec';
+export * from './TemplateToken/spec';
diff --git a/packages/ast-spec/src/type/TSAnyKeyword/spec.ts b/packages/ast-spec/src/type/TSAnyKeyword/spec.ts
new file mode 100644
index 000000000000..a9e2ba977f1d
--- /dev/null
+++ b/packages/ast-spec/src/type/TSAnyKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSAnyKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSAnyKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSArrayType/spec.ts b/packages/ast-spec/src/type/TSArrayType/spec.ts
new file mode 100644
index 000000000000..f7aa4f16a596
--- /dev/null
+++ b/packages/ast-spec/src/type/TSArrayType/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSArrayType extends BaseNode {
+ type: AST_NODE_TYPES.TSArrayType;
+ elementType: TypeNode;
+}
diff --git a/packages/ast-spec/src/type/TSBigIntKeyword/spec.ts b/packages/ast-spec/src/type/TSBigIntKeyword/spec.ts
new file mode 100644
index 000000000000..fc18a9519dee
--- /dev/null
+++ b/packages/ast-spec/src/type/TSBigIntKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSBigIntKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSBigIntKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSBooleanKeyword/spec.ts b/packages/ast-spec/src/type/TSBooleanKeyword/spec.ts
new file mode 100644
index 000000000000..89438151de1f
--- /dev/null
+++ b/packages/ast-spec/src/type/TSBooleanKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSBooleanKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSBooleanKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSConditionalType/spec.ts b/packages/ast-spec/src/type/TSConditionalType/spec.ts
new file mode 100644
index 000000000000..979fcb3e6026
--- /dev/null
+++ b/packages/ast-spec/src/type/TSConditionalType/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSConditionalType extends BaseNode {
+ type: AST_NODE_TYPES.TSConditionalType;
+ checkType: TypeNode;
+ extendsType: TypeNode;
+ trueType: TypeNode;
+ falseType: TypeNode;
+}
diff --git a/packages/ast-spec/src/type/TSConstructorType/spec.ts b/packages/ast-spec/src/type/TSConstructorType/spec.ts
new file mode 100644
index 000000000000..08e19757d14a
--- /dev/null
+++ b/packages/ast-spec/src/type/TSConstructorType/spec.ts
@@ -0,0 +1,7 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { TSFunctionSignatureBase } from '../../base/TSFunctionSignatureBase';
+
+export interface TSConstructorType extends TSFunctionSignatureBase {
+ type: AST_NODE_TYPES.TSConstructorType;
+ abstract: boolean;
+}
diff --git a/packages/ast-spec/src/type/TSFunctionType/spec.ts b/packages/ast-spec/src/type/TSFunctionType/spec.ts
new file mode 100644
index 000000000000..4388b097efd5
--- /dev/null
+++ b/packages/ast-spec/src/type/TSFunctionType/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { TSFunctionSignatureBase } from '../../base/TSFunctionSignatureBase';
+
+export interface TSFunctionType extends TSFunctionSignatureBase {
+ type: AST_NODE_TYPES.TSFunctionType;
+}
diff --git a/packages/ast-spec/src/type/TSImportType/spec.ts b/packages/ast-spec/src/type/TSImportType/spec.ts
new file mode 100644
index 000000000000..b2eea1a78e01
--- /dev/null
+++ b/packages/ast-spec/src/type/TSImportType/spec.ts
@@ -0,0 +1,13 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSTypeParameterInstantiation } from '../../special/TSTypeParameterInstantiation/spec';
+import type { EntityName } from '../../unions/EntityName';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSImportType extends BaseNode {
+ type: AST_NODE_TYPES.TSImportType;
+ isTypeOf: boolean;
+ parameter: TypeNode;
+ qualifier: EntityName | null;
+ typeParameters: TSTypeParameterInstantiation | null;
+}
diff --git a/packages/ast-spec/src/type/TSIndexedAccessType/spec.ts b/packages/ast-spec/src/type/TSIndexedAccessType/spec.ts
new file mode 100644
index 000000000000..86a22e22a16e
--- /dev/null
+++ b/packages/ast-spec/src/type/TSIndexedAccessType/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSIndexedAccessType extends BaseNode {
+ type: AST_NODE_TYPES.TSIndexedAccessType;
+ objectType: TypeNode;
+ indexType: TypeNode;
+}
diff --git a/packages/ast-spec/src/type/TSInferType/spec.ts b/packages/ast-spec/src/type/TSInferType/spec.ts
new file mode 100644
index 000000000000..11cdacb25d20
--- /dev/null
+++ b/packages/ast-spec/src/type/TSInferType/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSTypeParameter } from '../../special/TSTypeParameter/spec';
+
+export interface TSInferType extends BaseNode {
+ type: AST_NODE_TYPES.TSInferType;
+ typeParameter: TSTypeParameter;
+}
diff --git a/packages/ast-spec/src/type/TSIntersectionType/spec.ts b/packages/ast-spec/src/type/TSIntersectionType/spec.ts
new file mode 100644
index 000000000000..b84834143a0e
--- /dev/null
+++ b/packages/ast-spec/src/type/TSIntersectionType/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSIntersectionType extends BaseNode {
+ type: AST_NODE_TYPES.TSIntersectionType;
+ types: TypeNode[];
+}
diff --git a/packages/ast-spec/src/type/TSIntrinsicType/spec.ts b/packages/ast-spec/src/type/TSIntrinsicType/spec.ts
new file mode 100644
index 000000000000..b7158c2803c0
--- /dev/null
+++ b/packages/ast-spec/src/type/TSIntrinsicType/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSIntrinsicKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSIntrinsicKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSLiteralType/spec.ts b/packages/ast-spec/src/type/TSLiteralType/spec.ts
new file mode 100644
index 000000000000..39f6ae0d2961
--- /dev/null
+++ b/packages/ast-spec/src/type/TSLiteralType/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { UnaryExpression } from '../../expression/UnaryExpression/spec';
+import type { UpdateExpression } from '../../expression/UpdateExpression/spec';
+import type { LiteralExpression } from '../../unions/LiteralExpression';
+
+export interface TSLiteralType extends BaseNode {
+ type: AST_NODE_TYPES.TSLiteralType;
+ literal: LiteralExpression | UnaryExpression | UpdateExpression;
+}
diff --git a/packages/ast-spec/src/type/TSMappedType/spec.ts b/packages/ast-spec/src/type/TSMappedType/spec.ts
new file mode 100644
index 000000000000..db5abd4063a1
--- /dev/null
+++ b/packages/ast-spec/src/type/TSMappedType/spec.ts
@@ -0,0 +1,13 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSTypeParameter } from '../../special/TSTypeParameter/spec';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSMappedType extends BaseNode {
+ type: AST_NODE_TYPES.TSMappedType;
+ typeParameter: TSTypeParameter;
+ readonly?: boolean | '-' | '+';
+ optional?: boolean | '-' | '+';
+ typeAnnotation?: TypeNode;
+ nameType: TypeNode | null;
+}
diff --git a/packages/ast-spec/src/type/TSNamedTupleMember/spec.ts b/packages/ast-spec/src/type/TSNamedTupleMember/spec.ts
new file mode 100644
index 000000000000..540d8bf19db5
--- /dev/null
+++ b/packages/ast-spec/src/type/TSNamedTupleMember/spec.ts
@@ -0,0 +1,11 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSNamedTupleMember extends BaseNode {
+ type: AST_NODE_TYPES.TSNamedTupleMember;
+ elementType: TypeNode;
+ label: Identifier;
+ optional: boolean;
+}
diff --git a/packages/ast-spec/src/type/TSNeverKeyword/spec.ts b/packages/ast-spec/src/type/TSNeverKeyword/spec.ts
new file mode 100644
index 000000000000..59fe839e3473
--- /dev/null
+++ b/packages/ast-spec/src/type/TSNeverKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSNeverKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSNeverKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSNullKeyword/spec.ts b/packages/ast-spec/src/type/TSNullKeyword/spec.ts
new file mode 100644
index 000000000000..254d5cc592d5
--- /dev/null
+++ b/packages/ast-spec/src/type/TSNullKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSNullKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSNullKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSNumberKeyword/spec.ts b/packages/ast-spec/src/type/TSNumberKeyword/spec.ts
new file mode 100644
index 000000000000..768742a425dc
--- /dev/null
+++ b/packages/ast-spec/src/type/TSNumberKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSNumberKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSNumberKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSObjectKeyword/spec.ts b/packages/ast-spec/src/type/TSObjectKeyword/spec.ts
new file mode 100644
index 000000000000..3472bc9191ff
--- /dev/null
+++ b/packages/ast-spec/src/type/TSObjectKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSObjectKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSObjectKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSOptionalType/spec.ts b/packages/ast-spec/src/type/TSOptionalType/spec.ts
new file mode 100644
index 000000000000..9cdb0f636d32
--- /dev/null
+++ b/packages/ast-spec/src/type/TSOptionalType/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSOptionalType extends BaseNode {
+ type: AST_NODE_TYPES.TSOptionalType;
+ typeAnnotation: TypeNode;
+}
diff --git a/packages/ast-spec/src/type/TSParenthesizedType/spec.ts b/packages/ast-spec/src/type/TSParenthesizedType/spec.ts
new file mode 100644
index 000000000000..2d20d5d2f2bc
--- /dev/null
+++ b/packages/ast-spec/src/type/TSParenthesizedType/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSParenthesizedType extends BaseNode {
+ type: AST_NODE_TYPES.TSParenthesizedType;
+ typeAnnotation: TypeNode;
+}
diff --git a/packages/ast-spec/src/type/TSQualifiedName/spec.ts b/packages/ast-spec/src/type/TSQualifiedName/spec.ts
new file mode 100644
index 000000000000..cdd6feeee0ef
--- /dev/null
+++ b/packages/ast-spec/src/type/TSQualifiedName/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { EntityName } from '../../unions/EntityName';
+
+export interface TSQualifiedName extends BaseNode {
+ type: AST_NODE_TYPES.TSQualifiedName;
+ left: EntityName;
+ right: Identifier;
+}
diff --git a/packages/ast-spec/src/type/TSRestType/spec.ts b/packages/ast-spec/src/type/TSRestType/spec.ts
new file mode 100644
index 000000000000..f1b4f2ecfa85
--- /dev/null
+++ b/packages/ast-spec/src/type/TSRestType/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSRestType extends BaseNode {
+ type: AST_NODE_TYPES.TSRestType;
+ typeAnnotation: TypeNode;
+}
diff --git a/packages/ast-spec/src/type/TSStringKeyword/spec.ts b/packages/ast-spec/src/type/TSStringKeyword/spec.ts
new file mode 100644
index 000000000000..35721dd44137
--- /dev/null
+++ b/packages/ast-spec/src/type/TSStringKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSStringKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSStringKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSSymbolKeyword/spec.ts b/packages/ast-spec/src/type/TSSymbolKeyword/spec.ts
new file mode 100644
index 000000000000..6b8b949dd0b8
--- /dev/null
+++ b/packages/ast-spec/src/type/TSSymbolKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSSymbolKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSSymbolKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSTemplateLiteralType/spec.ts b/packages/ast-spec/src/type/TSTemplateLiteralType/spec.ts
new file mode 100644
index 000000000000..c2e8783da873
--- /dev/null
+++ b/packages/ast-spec/src/type/TSTemplateLiteralType/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TemplateElement } from '../../special/TemplateElement/spec';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSTemplateLiteralType extends BaseNode {
+ type: AST_NODE_TYPES.TSTemplateLiteralType;
+ quasis: TemplateElement[];
+ types: TypeNode[];
+}
diff --git a/packages/ast-spec/src/type/TSThisType/spec.ts b/packages/ast-spec/src/type/TSThisType/spec.ts
new file mode 100644
index 000000000000..319e82460f67
--- /dev/null
+++ b/packages/ast-spec/src/type/TSThisType/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSThisType extends BaseNode {
+ type: AST_NODE_TYPES.TSThisType;
+}
diff --git a/packages/ast-spec/src/type/TSTupleType/spec.ts b/packages/ast-spec/src/type/TSTupleType/spec.ts
new file mode 100644
index 000000000000..641a0c15b4c6
--- /dev/null
+++ b/packages/ast-spec/src/type/TSTupleType/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSTupleType extends BaseNode {
+ type: AST_NODE_TYPES.TSTupleType;
+ elementTypes: TypeNode[];
+}
diff --git a/packages/ast-spec/src/type/TSTypeLiteral/spec.ts b/packages/ast-spec/src/type/TSTypeLiteral/spec.ts
new file mode 100644
index 000000000000..243179d23d9f
--- /dev/null
+++ b/packages/ast-spec/src/type/TSTypeLiteral/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeElement } from '../../unions/TypeElement';
+
+export interface TSTypeLiteral extends BaseNode {
+ type: AST_NODE_TYPES.TSTypeLiteral;
+ members: TypeElement[];
+}
diff --git a/packages/ast-spec/src/type/TSTypeOperator/spec.ts b/packages/ast-spec/src/type/TSTypeOperator/spec.ts
new file mode 100644
index 000000000000..c83b8721eed9
--- /dev/null
+++ b/packages/ast-spec/src/type/TSTypeOperator/spec.ts
@@ -0,0 +1,9 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSTypeOperator extends BaseNode {
+ type: AST_NODE_TYPES.TSTypeOperator;
+ operator: 'keyof' | 'readonly' | 'unique';
+ typeAnnotation?: TypeNode;
+}
diff --git a/packages/ast-spec/src/type/TSTypePredicate/spec.ts b/packages/ast-spec/src/type/TSTypePredicate/spec.ts
new file mode 100644
index 000000000000..cd34a31bcaf0
--- /dev/null
+++ b/packages/ast-spec/src/type/TSTypePredicate/spec.ts
@@ -0,0 +1,12 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { TSTypeAnnotation } from '../../special/TSTypeAnnotation/spec';
+import type { TSThisType } from '../TSThisType/spec';
+
+export interface TSTypePredicate extends BaseNode {
+ type: AST_NODE_TYPES.TSTypePredicate;
+ asserts: boolean;
+ parameterName: Identifier | TSThisType;
+ typeAnnotation: TSTypeAnnotation | null;
+}
diff --git a/packages/ast-spec/src/type/TSTypeQuery/spec.ts b/packages/ast-spec/src/type/TSTypeQuery/spec.ts
new file mode 100644
index 000000000000..bf1cd3e192df
--- /dev/null
+++ b/packages/ast-spec/src/type/TSTypeQuery/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { EntityName } from '../../unions/EntityName';
+
+export interface TSTypeQuery extends BaseNode {
+ type: AST_NODE_TYPES.TSTypeQuery;
+ exprName: EntityName;
+}
diff --git a/packages/ast-spec/src/type/TSTypeReference/spec.ts b/packages/ast-spec/src/type/TSTypeReference/spec.ts
new file mode 100644
index 000000000000..9d88fe7f6b4f
--- /dev/null
+++ b/packages/ast-spec/src/type/TSTypeReference/spec.ts
@@ -0,0 +1,10 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TSTypeParameterInstantiation } from '../../special/TSTypeParameterInstantiation/spec';
+import type { EntityName } from '../../unions/EntityName';
+
+export interface TSTypeReference extends BaseNode {
+ type: AST_NODE_TYPES.TSTypeReference;
+ typeName: EntityName;
+ typeParameters?: TSTypeParameterInstantiation;
+}
diff --git a/packages/ast-spec/src/type/TSUndefinedKeyword/spec.ts b/packages/ast-spec/src/type/TSUndefinedKeyword/spec.ts
new file mode 100644
index 000000000000..0aa062c84212
--- /dev/null
+++ b/packages/ast-spec/src/type/TSUndefinedKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSUndefinedKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSUndefinedKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSUnionType/spec.ts b/packages/ast-spec/src/type/TSUnionType/spec.ts
new file mode 100644
index 000000000000..a286f796a23d
--- /dev/null
+++ b/packages/ast-spec/src/type/TSUnionType/spec.ts
@@ -0,0 +1,8 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+import type { TypeNode } from '../../unions/TypeNode';
+
+export interface TSUnionType extends BaseNode {
+ type: AST_NODE_TYPES.TSUnionType;
+ types: TypeNode[];
+}
diff --git a/packages/ast-spec/src/type/TSUnknownKeyword/spec.ts b/packages/ast-spec/src/type/TSUnknownKeyword/spec.ts
new file mode 100644
index 000000000000..c8c1f9340c6e
--- /dev/null
+++ b/packages/ast-spec/src/type/TSUnknownKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSUnknownKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSUnknownKeyword;
+}
diff --git a/packages/ast-spec/src/type/TSVoidKeyword/spec.ts b/packages/ast-spec/src/type/TSVoidKeyword/spec.ts
new file mode 100644
index 000000000000..abf0c14c5ab3
--- /dev/null
+++ b/packages/ast-spec/src/type/TSVoidKeyword/spec.ts
@@ -0,0 +1,6 @@
+import type { AST_NODE_TYPES } from '../../ast-node-types';
+import type { BaseNode } from '../../base/BaseNode';
+
+export interface TSVoidKeyword extends BaseNode {
+ type: AST_NODE_TYPES.TSVoidKeyword;
+}
diff --git a/packages/ast-spec/src/type/spec.ts b/packages/ast-spec/src/type/spec.ts
new file mode 100644
index 000000000000..bbbea76cbd8e
--- /dev/null
+++ b/packages/ast-spec/src/type/spec.ts
@@ -0,0 +1,36 @@
+export * from './TSAnyKeyword/spec';
+export * from './TSArrayType/spec';
+export * from './TSBigIntKeyword/spec';
+export * from './TSBooleanKeyword/spec';
+export * from './TSConditionalType/spec';
+export * from './TSConstructorType/spec';
+export * from './TSFunctionType/spec';
+export * from './TSImportType/spec';
+export * from './TSIndexedAccessType/spec';
+export * from './TSInferType/spec';
+export * from './TSIntersectionType/spec';
+export * from './TSLiteralType/spec';
+export * from './TSMappedType/spec';
+export * from './TSNamedTupleMember/spec';
+export * from './TSNeverKeyword/spec';
+export * from './TSNullKeyword/spec';
+export * from './TSNumberKeyword/spec';
+export * from './TSObjectKeyword/spec';
+export * from './TSOptionalType/spec';
+export * from './TSParenthesizedType/spec';
+export * from './TSQualifiedName/spec';
+export * from './TSRestType/spec';
+export * from './TSStringKeyword/spec';
+export * from './TSSymbolKeyword/spec';
+export * from './TSTemplateLiteralType/spec';
+export * from './TSThisType/spec';
+export * from './TSTupleType/spec';
+export * from './TSTypeLiteral/spec';
+export * from './TSTypeOperator/spec';
+export * from './TSTypePredicate/spec';
+export * from './TSTypeQuery/spec';
+export * from './TSTypeReference/spec';
+export * from './TSUndefinedKeyword/spec';
+export * from './TSUnionType/spec';
+export * from './TSUnknownKeyword/spec';
+export * from './TSVoidKeyword/spec';
diff --git a/packages/ast-spec/src/unions/BindingName.ts b/packages/ast-spec/src/unions/BindingName.ts
new file mode 100644
index 000000000000..2da273d80476
--- /dev/null
+++ b/packages/ast-spec/src/unions/BindingName.ts
@@ -0,0 +1,4 @@
+import type { Identifier } from '../expression/Identifier/spec';
+import type { BindingPattern } from './BindingPattern';
+
+export type BindingName = BindingPattern | Identifier;
diff --git a/packages/ast-spec/src/unions/BindingPattern.ts b/packages/ast-spec/src/unions/BindingPattern.ts
new file mode 100644
index 000000000000..ef39d0af1126
--- /dev/null
+++ b/packages/ast-spec/src/unions/BindingPattern.ts
@@ -0,0 +1,4 @@
+import type { ArrayPattern } from '../parameter/ArrayPattern/spec';
+import type { ObjectPattern } from '../parameter/ObjectPattern/spec';
+
+export type BindingPattern = ArrayPattern | ObjectPattern;
diff --git a/packages/ast-spec/src/unions/CallExpressionArgument.ts b/packages/ast-spec/src/unions/CallExpressionArgument.ts
new file mode 100644
index 000000000000..42a419b4b25b
--- /dev/null
+++ b/packages/ast-spec/src/unions/CallExpressionArgument.ts
@@ -0,0 +1,4 @@
+import type { SpreadElement } from '../element/SpreadElement/spec';
+import type { Expression } from './Expression';
+
+export type CallExpressionArgument = Expression | SpreadElement;
diff --git a/packages/ast-spec/src/unions/ChainElement.ts b/packages/ast-spec/src/unions/ChainElement.ts
new file mode 100644
index 000000000000..fccde99ed8c6
--- /dev/null
+++ b/packages/ast-spec/src/unions/ChainElement.ts
@@ -0,0 +1,8 @@
+import type { CallExpression } from '../expression/CallExpression/spec';
+import type { MemberExpression } from '../expression/MemberExpression/spec';
+import type { TSNonNullExpression } from '../expression/TSNonNullExpression/spec';
+
+export type ChainElement =
+ | CallExpression
+ | MemberExpression
+ | TSNonNullExpression;
diff --git a/packages/ast-spec/src/unions/ClassElement.ts b/packages/ast-spec/src/unions/ClassElement.ts
new file mode 100644
index 000000000000..a4d986d09c73
--- /dev/null
+++ b/packages/ast-spec/src/unions/ClassElement.ts
@@ -0,0 +1,12 @@
+import type { ClassProperty } from '../element/ClassProperty/spec';
+import type { MethodDefinition } from '../element/MethodDefinition/spec';
+import type { TSAbstractClassProperty } from '../element/TSAbstractClassProperty/spec';
+import type { TSAbstractMethodDefinition } from '../element/TSAbstractMethodDefinition/spec';
+import type { TSIndexSignature } from '../element/TSIndexSignature/spec';
+
+export type ClassElement =
+ | ClassProperty
+ | MethodDefinition
+ | TSAbstractClassProperty
+ | TSAbstractMethodDefinition
+ | TSIndexSignature;
diff --git a/packages/ast-spec/src/unions/Comment.ts b/packages/ast-spec/src/unions/Comment.ts
new file mode 100644
index 000000000000..d5cdca042476
--- /dev/null
+++ b/packages/ast-spec/src/unions/Comment.ts
@@ -0,0 +1,4 @@
+import type { BlockComment } from '../token/BlockComment/spec';
+import type { LineComment } from '../token/LineComment/spec';
+
+export type Comment = BlockComment | LineComment;
diff --git a/packages/ast-spec/src/unions/DeclarationStatement.ts b/packages/ast-spec/src/unions/DeclarationStatement.ts
new file mode 100644
index 000000000000..be0637254ae7
--- /dev/null
+++ b/packages/ast-spec/src/unions/DeclarationStatement.ts
@@ -0,0 +1,29 @@
+import type { ClassDeclaration } from '../declaration/ClassDeclaration/spec';
+import type { ExportAllDeclaration } from '../declaration/ExportAllDeclaration/spec';
+import type { ExportDefaultDeclaration } from '../declaration/ExportDefaultDeclaration/spec';
+import type { ExportNamedDeclaration } from '../declaration/ExportNamedDeclaration/spec';
+import type { FunctionDeclaration } 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 { TSNamespaceExportDeclaration } from '../declaration/TSNamespaceExportDeclaration/spec';
+import type { TSTypeAliasDeclaration } from '../declaration/TSTypeAliasDeclaration/spec';
+import type { ClassExpression } from '../expression/ClassExpression/spec';
+
+// TODO - breaking change remove this
+export type DeclarationStatement =
+ | ClassDeclaration
+ | ClassExpression
+ | ExportAllDeclaration
+ | ExportDefaultDeclaration
+ | ExportNamedDeclaration
+ | FunctionDeclaration
+ | TSDeclareFunction
+ | TSEnumDeclaration
+ | TSImportEqualsDeclaration
+ | TSInterfaceDeclaration
+ | TSModuleDeclaration
+ | TSNamespaceExportDeclaration
+ | TSTypeAliasDeclaration;
diff --git a/packages/ast-spec/src/unions/DestructuringPattern.ts b/packages/ast-spec/src/unions/DestructuringPattern.ts
new file mode 100644
index 000000000000..40d07009651c
--- /dev/null
+++ b/packages/ast-spec/src/unions/DestructuringPattern.ts
@@ -0,0 +1,14 @@
+import type { Identifier } from '../expression/Identifier/spec';
+import type { MemberExpression } from '../expression/MemberExpression/spec';
+import type { ArrayPattern } from '../parameter/ArrayPattern/spec';
+import type { AssignmentPattern } from '../parameter/AssignmentPattern/spec';
+import type { ObjectPattern } from '../parameter/ObjectPattern/spec';
+import type { RestElement } from '../parameter/RestElement/spec';
+
+export type DestructuringPattern =
+ | ArrayPattern
+ | AssignmentPattern
+ | Identifier
+ | MemberExpression
+ | ObjectPattern
+ | RestElement;
diff --git a/packages/ast-spec/src/unions/EntityName.ts b/packages/ast-spec/src/unions/EntityName.ts
new file mode 100644
index 000000000000..82f7b1c9b0ca
--- /dev/null
+++ b/packages/ast-spec/src/unions/EntityName.ts
@@ -0,0 +1,4 @@
+import type { Identifier } from '../expression/Identifier/spec';
+import type { TSQualifiedName } from '../type/TSQualifiedName/spec';
+
+export type EntityName = Identifier | TSQualifiedName;
diff --git a/packages/ast-spec/src/unions/ExportDeclaration.ts b/packages/ast-spec/src/unions/ExportDeclaration.ts
new file mode 100644
index 000000000000..1ae9d9ddb9f8
--- /dev/null
+++ b/packages/ast-spec/src/unions/ExportDeclaration.ts
@@ -0,0 +1,20 @@
+import type { ClassDeclaration } from '../declaration/ClassDeclaration/spec';
+import type { FunctionDeclaration } from '../declaration/FunctionDeclaration/spec';
+import type { TSDeclareFunction } from '../declaration/TSDeclareFunction/spec';
+import type { TSEnumDeclaration } from '../declaration/TSEnumDeclaration/spec';
+import type { TSInterfaceDeclaration } from '../declaration/TSInterfaceDeclaration/spec';
+import type { TSModuleDeclaration } from '../declaration/TSModuleDeclaration/spec';
+import type { TSTypeAliasDeclaration } from '../declaration/TSTypeAliasDeclaration/spec';
+import type { VariableDeclaration } from '../declaration/VariableDeclaration/spec';
+import type { ClassExpression } from '../expression/ClassExpression/spec';
+
+export type ExportDeclaration =
+ | ClassDeclaration
+ | ClassExpression
+ | FunctionDeclaration
+ | TSDeclareFunction
+ | TSEnumDeclaration
+ | TSInterfaceDeclaration
+ | TSModuleDeclaration
+ | TSTypeAliasDeclaration
+ | VariableDeclaration;
diff --git a/packages/ast-spec/src/unions/Expression.ts b/packages/ast-spec/src/unions/Expression.ts
new file mode 100644
index 000000000000..fd1a14b114e2
--- /dev/null
+++ b/packages/ast-spec/src/unions/Expression.ts
@@ -0,0 +1,78 @@
+import type { ArrayExpression } from '../expression/ArrayExpression/spec';
+import type { ArrowFunctionExpression } from '../expression/ArrowFunctionExpression/spec';
+import type { AssignmentExpression } from '../expression/AssignmentExpression/spec';
+import type { AwaitExpression } from '../expression/AwaitExpression/spec';
+import type { BinaryExpression } from '../expression/BinaryExpression/spec';
+import type { CallExpression } from '../expression/CallExpression/spec';
+import type { ChainExpression } from '../expression/ChainExpression/spec';
+import type { ClassExpression } from '../expression/ClassExpression/spec';
+import type { ConditionalExpression } from '../expression/ConditionalExpression/spec';
+import type { FunctionExpression } from '../expression/FunctionExpression/spec';
+import type { Identifier } from '../expression/Identifier/spec';
+import type { ImportExpression } from '../expression/ImportExpression/spec';
+import type { JSXElement } from '../expression/JSXElement/spec';
+import type { JSXFragment } from '../expression/JSXFragment/spec';
+import type { LogicalExpression } from '../expression/LogicalExpression/spec';
+import type { MemberExpression } from '../expression/MemberExpression/spec';
+import type { MetaProperty } from '../expression/MetaProperty/spec';
+import type { NewExpression } from '../expression/NewExpression/spec';
+import type { ObjectExpression } from '../expression/ObjectExpression/spec';
+import type { SequenceExpression } from '../expression/SequenceExpression/spec';
+import type { Super } from '../expression/Super/spec';
+import type { TaggedTemplateExpression } from '../expression/TaggedTemplateExpression/spec';
+import type { TemplateLiteral } from '../expression/TemplateLiteral/spec';
+import type { ThisExpression } from '../expression/ThisExpression/spec';
+import type { TSAsExpression } from '../expression/TSAsExpression/spec';
+import type { TSNonNullExpression } from '../expression/TSNonNullExpression/spec';
+import type { TSTypeAssertion } from '../expression/TSTypeAssertion/spec';
+import type { UnaryExpression } from '../expression/UnaryExpression/spec';
+import type { UpdateExpression } from '../expression/UpdateExpression/spec';
+import type { YieldExpression } from '../expression/YieldExpression/spec';
+import type { ArrayPattern } from '../parameter/ArrayPattern/spec';
+import type { ObjectPattern } from '../parameter/ObjectPattern/spec';
+import type { LiteralExpression } from './LiteralExpression';
+
+/*
+This isn't technically correct, as it includes ArrayPattern and ObjectPattern - which are only valid
+in a LeftHandSideExpression, and not in a general expression location.
+
+However most of the time that this type is used, the intention will be to assign a LeftHandSideExpression to this type.
+So excluding the Pattern types just makes it a pain, as people have to write Expression | LeftHandSideExpression everywhere.
+*/
+
+export type Expression =
+ | ArrayExpression
+ | ArrayPattern
+ | ArrowFunctionExpression
+ | AssignmentExpression
+ | AwaitExpression
+ | BinaryExpression
+ | CallExpression
+ | ChainExpression
+ | ClassExpression
+ | ClassExpression
+ | ConditionalExpression
+ | FunctionExpression
+ | FunctionExpression
+ | Identifier
+ | ImportExpression
+ | JSXElement
+ | JSXFragment
+ | LiteralExpression
+ | LogicalExpression
+ | MemberExpression
+ | MetaProperty
+ | NewExpression
+ | ObjectExpression
+ | ObjectPattern
+ | SequenceExpression
+ | Super
+ | TaggedTemplateExpression
+ | TemplateLiteral
+ | ThisExpression
+ | TSAsExpression
+ | TSNonNullExpression
+ | TSTypeAssertion
+ | UnaryExpression
+ | UpdateExpression
+ | YieldExpression;
diff --git a/packages/ast-spec/src/unions/ForInitialiser.ts b/packages/ast-spec/src/unions/ForInitialiser.ts
new file mode 100644
index 000000000000..05138cb52fbc
--- /dev/null
+++ b/packages/ast-spec/src/unions/ForInitialiser.ts
@@ -0,0 +1,4 @@
+import type { VariableDeclaration } from '../declaration/VariableDeclaration/spec';
+import type { Expression } from './Expression';
+
+export type ForInitialiser = Expression | VariableDeclaration;
diff --git a/packages/ast-spec/src/unions/FunctionLike.ts b/packages/ast-spec/src/unions/FunctionLike.ts
new file mode 100644
index 000000000000..6ab06d834960
--- /dev/null
+++ b/packages/ast-spec/src/unions/FunctionLike.ts
@@ -0,0 +1,12 @@
+import type { FunctionDeclaration } from '../declaration/FunctionDeclaration/spec';
+import type { TSDeclareFunction } from '../declaration/TSDeclareFunction/spec';
+import type { ArrowFunctionExpression } from '../expression/ArrowFunctionExpression/spec';
+import type { FunctionExpression } from '../expression/FunctionExpression/spec';
+import type { TSEmptyBodyFunctionExpression } from '../expression/TSEmptyBodyFunctionExpression/spec';
+
+export type FunctionLike =
+ | ArrowFunctionExpression
+ | FunctionDeclaration
+ | FunctionExpression
+ | TSDeclareFunction
+ | TSEmptyBodyFunctionExpression;
diff --git a/packages/ast-spec/src/unions/ImportClause.ts b/packages/ast-spec/src/unions/ImportClause.ts
new file mode 100644
index 000000000000..80b40826ff6d
--- /dev/null
+++ b/packages/ast-spec/src/unions/ImportClause.ts
@@ -0,0 +1,8 @@
+import type { ImportDefaultSpecifier } from '../special/ImportDefaultSpecifier/spec';
+import type { ImportNamespaceSpecifier } from '../special/ImportNamespaceSpecifier/spec';
+import type { ImportSpecifier } from '../special/ImportSpecifier/spec';
+
+export type ImportClause =
+ | ImportDefaultSpecifier
+ | ImportNamespaceSpecifier
+ | ImportSpecifier;
diff --git a/packages/ast-spec/src/unions/IterationStatement.ts b/packages/ast-spec/src/unions/IterationStatement.ts
new file mode 100644
index 000000000000..6a611431ca05
--- /dev/null
+++ b/packages/ast-spec/src/unions/IterationStatement.ts
@@ -0,0 +1,12 @@
+import type { DoWhileStatement } from '../statement/DoWhileStatement/spec';
+import type { ForInStatement } from '../statement/ForInStatement/spec';
+import type { ForOfStatement } from '../statement/ForOfStatement/spec';
+import type { ForStatement } from '../statement/ForStatement/spec';
+import type { WhileStatement } from '../statement/WhileStatement/spec';
+
+export type IterationStatement =
+ | DoWhileStatement
+ | ForInStatement
+ | ForOfStatement
+ | ForStatement
+ | WhileStatement;
diff --git a/packages/ast-spec/src/unions/JSXChild.ts b/packages/ast-spec/src/unions/JSXChild.ts
new file mode 100644
index 000000000000..2b38836c82ef
--- /dev/null
+++ b/packages/ast-spec/src/unions/JSXChild.ts
@@ -0,0 +1,6 @@
+import type { JSXElement } from '../expression/JSXElement/spec';
+import type { JSXFragment } from '../expression/JSXFragment/spec';
+import type { JSXText } from '../jsx/JSXText/spec';
+import type { JSXExpression } from './JSXExpression';
+
+export type JSXChild = JSXElement | JSXExpression | JSXFragment | JSXText;
diff --git a/packages/ast-spec/src/unions/JSXExpression.ts b/packages/ast-spec/src/unions/JSXExpression.ts
new file mode 100644
index 000000000000..78dfad53525b
--- /dev/null
+++ b/packages/ast-spec/src/unions/JSXExpression.ts
@@ -0,0 +1,8 @@
+import type { JSXEmptyExpression } from '../jsx/JSXEmptyExpression/spec';
+import type { JSXExpressionContainer } from '../jsx/JSXExpressionContainer/spec';
+import type { JSXSpreadChild } from '../jsx/JSXSpreadChild/spec';
+
+export type JSXExpression =
+ | JSXEmptyExpression
+ | JSXExpressionContainer
+ | JSXSpreadChild;
diff --git a/packages/ast-spec/src/unions/JSXTagNameExpression.ts b/packages/ast-spec/src/unions/JSXTagNameExpression.ts
new file mode 100644
index 000000000000..05a831f68b45
--- /dev/null
+++ b/packages/ast-spec/src/unions/JSXTagNameExpression.ts
@@ -0,0 +1,8 @@
+import type { JSXIdentifier } from '../jsx/JSXIdentifier/spec';
+import type { JSXMemberExpression } from '../jsx/JSXMemberExpression/spec';
+import type { JSXNamespacedName } from '../jsx/JSXNamespacedName/spec';
+
+export type JSXTagNameExpression =
+ | JSXIdentifier
+ | JSXMemberExpression
+ | JSXNamespacedName;
diff --git a/packages/ast-spec/src/unions/LeftHandSideExpression.ts b/packages/ast-spec/src/unions/LeftHandSideExpression.ts
new file mode 100644
index 000000000000..a8a24bb08d2d
--- /dev/null
+++ b/packages/ast-spec/src/unions/LeftHandSideExpression.ts
@@ -0,0 +1,44 @@
+import type { ArrayExpression } from '../expression/ArrayExpression/spec';
+import type { ArrowFunctionExpression } from '../expression/ArrowFunctionExpression/spec';
+import type { CallExpression } from '../expression/CallExpression/spec';
+import type { ClassExpression } from '../expression/ClassExpression/spec';
+import type { FunctionExpression } from '../expression/FunctionExpression/spec';
+import type { Identifier } from '../expression/Identifier/spec';
+import type { JSXElement } from '../expression/JSXElement/spec';
+import type { JSXFragment } from '../expression/JSXFragment/spec';
+import type { MemberExpression } from '../expression/MemberExpression/spec';
+import type { MetaProperty } from '../expression/MetaProperty/spec';
+import type { ObjectExpression } from '../expression/ObjectExpression/spec';
+import type { Super } from '../expression/Super/spec';
+import type { TaggedTemplateExpression } from '../expression/TaggedTemplateExpression/spec';
+import type { TemplateLiteral } from '../expression/TemplateLiteral/spec';
+import type { ThisExpression } from '../expression/ThisExpression/spec';
+import type { TSAsExpression } from '../expression/TSAsExpression/spec';
+import type { TSNonNullExpression } from '../expression/TSNonNullExpression/spec';
+import type { TSTypeAssertion } from '../expression/TSTypeAssertion/spec';
+import type { ArrayPattern } from '../parameter/ArrayPattern/spec';
+import type { ObjectPattern } from '../parameter/ObjectPattern/spec';
+import type { LiteralExpression } from './LiteralExpression';
+
+export type LeftHandSideExpression =
+ | ArrayExpression
+ | ArrayPattern
+ | ArrowFunctionExpression
+ | CallExpression
+ | ClassExpression
+ | FunctionExpression
+ | Identifier
+ | JSXElement
+ | JSXFragment
+ | LiteralExpression
+ | MemberExpression
+ | MetaProperty
+ | ObjectExpression
+ | ObjectPattern
+ | Super
+ | TaggedTemplateExpression
+ | TemplateLiteral
+ | ThisExpression
+ | TSAsExpression
+ | TSNonNullExpression
+ | TSTypeAssertion;
diff --git a/packages/ast-spec/src/unions/Literal.ts b/packages/ast-spec/src/unions/Literal.ts
new file mode 100644
index 000000000000..4da361d88423
--- /dev/null
+++ b/packages/ast-spec/src/unions/Literal.ts
@@ -0,0 +1,14 @@
+import type { BigIntLiteral } from '../expression/literal/BigIntLiteral/spec';
+import type { BooleanLiteral } from '../expression/literal/BooleanLiteral/spec';
+import type { NullLiteral } from '../expression/literal/NullLiteral/spec';
+import type { NumberLiteral } from '../expression/literal/NumberLiteral/spec';
+import type { RegExpLiteral } from '../expression/literal/RegExpLiteral/spec';
+import type { StringLiteral } from '../expression/literal/StringLiteral/spec';
+
+export type Literal =
+ | BigIntLiteral
+ | BooleanLiteral
+ | NullLiteral
+ | NumberLiteral
+ | RegExpLiteral
+ | StringLiteral;
diff --git a/packages/ast-spec/src/unions/LiteralExpression.ts b/packages/ast-spec/src/unions/LiteralExpression.ts
new file mode 100644
index 000000000000..e29ddeec7ee5
--- /dev/null
+++ b/packages/ast-spec/src/unions/LiteralExpression.ts
@@ -0,0 +1,4 @@
+import type { TemplateLiteral } from '../expression/TemplateLiteral/spec';
+import type { Literal } from './Literal';
+
+export type LiteralExpression = Literal | TemplateLiteral;
diff --git a/packages/ast-spec/src/unions/Modifier.ts b/packages/ast-spec/src/unions/Modifier.ts
new file mode 100644
index 000000000000..0922a52eca2e
--- /dev/null
+++ b/packages/ast-spec/src/unions/Modifier.ts
@@ -0,0 +1,16 @@
+import type { TSAbstractKeyword } from '../token/TSAbstractKeyword/spec';
+import type { TSAsyncKeyword } from '../token/TSAsyncKeyword/spec';
+import type { TSPrivateKeyword } from '../token/TSPrivateKeyword/spec';
+import type { TSProtectedKeyword } from '../token/TSProtectedKeyword/spec';
+import type { TSPublicKeyword } from '../token/TSPublicKeyword/spec';
+import type { TSReadonlyKeyword } from '../token/TSReadonlyKeyword/spec';
+import type { TSStaticKeyword } from '../token/TSStaticKeyword/spec';
+
+export type Modifier =
+ | TSAbstractKeyword
+ | TSAsyncKeyword
+ | TSPrivateKeyword
+ | TSProtectedKeyword
+ | TSPublicKeyword
+ | TSReadonlyKeyword
+ | TSStaticKeyword;
diff --git a/packages/ast-spec/src/unions/Node.ts b/packages/ast-spec/src/unions/Node.ts
new file mode 100644
index 000000000000..fe3435596a98
--- /dev/null
+++ b/packages/ast-spec/src/unions/Node.ts
@@ -0,0 +1,329 @@
+import type { ClassDeclaration } from '../declaration/ClassDeclaration/spec';
+import type { ExportAllDeclaration } from '../declaration/ExportAllDeclaration/spec';
+import type { ExportDefaultDeclaration } from '../declaration/ExportDefaultDeclaration/spec';
+import type { ExportNamedDeclaration } from '../declaration/ExportNamedDeclaration/spec';
+import type { FunctionDeclaration } 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 { TSNamespaceExportDeclaration } from '../declaration/TSNamespaceExportDeclaration/spec';
+import type { TSTypeAliasDeclaration } from '../declaration/TSTypeAliasDeclaration/spec';
+import type { VariableDeclaration } from '../declaration/VariableDeclaration/spec';
+import type { ClassProperty } from '../element/ClassProperty/spec';
+import type { MethodDefinition } from '../element/MethodDefinition/spec';
+import type { Property } from '../element/Property/spec';
+import type { SpreadElement } from '../element/SpreadElement/spec';
+import type { TSAbstractClassProperty } from '../element/TSAbstractClassProperty/spec';
+import type { TSAbstractMethodDefinition } from '../element/TSAbstractMethodDefinition/spec';
+import type { TSCallSignatureDeclaration } from '../element/TSCallSignatureDeclaration/spec';
+import type { TSConstructSignatureDeclaration } from '../element/TSConstructSignatureDeclaration/spec';
+import type { TSEnumMember } from '../element/TSEnumMember/spec';
+import type { TSIndexSignature } from '../element/TSIndexSignature/spec';
+import type { TSMethodSignature } from '../element/TSMethodSignature/spec';
+import type { TSPropertySignature } from '../element/TSPropertySignature/spec';
+import type { ArrayExpression } from '../expression/ArrayExpression/spec';
+import type { ArrowFunctionExpression } from '../expression/ArrowFunctionExpression/spec';
+import type { AssignmentExpression } from '../expression/AssignmentExpression/spec';
+import type { AwaitExpression } from '../expression/AwaitExpression/spec';
+import type { BinaryExpression } from '../expression/BinaryExpression/spec';
+import type { CallExpression } from '../expression/CallExpression/spec';
+import type { ChainExpression } from '../expression/ChainExpression/spec';
+import type { ClassExpression } from '../expression/ClassExpression/spec';
+import type { ConditionalExpression } from '../expression/ConditionalExpression/spec';
+import type { FunctionExpression } from '../expression/FunctionExpression/spec';
+import type { Identifier } from '../expression/Identifier/spec';
+import type { ImportExpression } from '../expression/ImportExpression/spec';
+import type { JSXElement } from '../expression/JSXElement/spec';
+import type { JSXFragment } from '../expression/JSXFragment/spec';
+import type { LogicalExpression } from '../expression/LogicalExpression/spec';
+import type { MemberExpression } from '../expression/MemberExpression/spec';
+import type { MetaProperty } from '../expression/MetaProperty/spec';
+import type { NewExpression } from '../expression/NewExpression/spec';
+import type { ObjectExpression } from '../expression/ObjectExpression/spec';
+import type { SequenceExpression } from '../expression/SequenceExpression/spec';
+import type { Super } from '../expression/Super/spec';
+import type { TaggedTemplateExpression } from '../expression/TaggedTemplateExpression/spec';
+import type { TemplateLiteral } from '../expression/TemplateLiteral/spec';
+import type { ThisExpression } from '../expression/ThisExpression/spec';
+import type { TSAsExpression } from '../expression/TSAsExpression/spec';
+import type { TSEmptyBodyFunctionExpression } from '../expression/TSEmptyBodyFunctionExpression/spec';
+import type { TSNonNullExpression } from '../expression/TSNonNullExpression/spec';
+import type { TSTypeAssertion } from '../expression/TSTypeAssertion/spec';
+import type { UnaryExpression } from '../expression/UnaryExpression/spec';
+import type { UpdateExpression } from '../expression/UpdateExpression/spec';
+import type { YieldExpression } from '../expression/YieldExpression/spec';
+import type { JSXAttribute } from '../jsx/JSXAttribute/spec';
+import type { JSXClosingElement } from '../jsx/JSXClosingElement/spec';
+import type { JSXClosingFragment } from '../jsx/JSXClosingFragment/spec';
+import type { JSXEmptyExpression } from '../jsx/JSXEmptyExpression/spec';
+import type { JSXExpressionContainer } from '../jsx/JSXExpressionContainer/spec';
+import type { JSXIdentifier } from '../jsx/JSXIdentifier/spec';
+import type { JSXMemberExpression } from '../jsx/JSXMemberExpression/spec';
+import type { JSXNamespacedName } from '../jsx/JSXNamespacedName/spec';
+import type { JSXOpeningElement } from '../jsx/JSXOpeningElement/spec';
+import type { JSXOpeningFragment } from '../jsx/JSXOpeningFragment/spec';
+import type { JSXSpreadAttribute } from '../jsx/JSXSpreadAttribute/spec';
+import type { JSXSpreadChild } from '../jsx/JSXSpreadChild/spec';
+import type { JSXText } from '../jsx/JSXText/spec';
+import type { ArrayPattern } from '../parameter/ArrayPattern/spec';
+import type { AssignmentPattern } from '../parameter/AssignmentPattern/spec';
+import type { ObjectPattern } from '../parameter/ObjectPattern/spec';
+import type { RestElement } from '../parameter/RestElement/spec';
+import type { TSParameterProperty } from '../parameter/TSParameterProperty/spec';
+import type { CatchClause } from '../special/CatchClause/spec';
+import type { ClassBody } from '../special/ClassBody/spec';
+import type { Decorator } from '../special/Decorator/spec';
+import type { EmptyStatement } from '../special/EmptyStatement/spec';
+import type { ExportSpecifier } from '../special/ExportSpecifier/spec';
+import type { ImportDefaultSpecifier } from '../special/ImportDefaultSpecifier/spec';
+import type { ImportNamespaceSpecifier } from '../special/ImportNamespaceSpecifier/spec';
+import type { ImportSpecifier } from '../special/ImportSpecifier/spec';
+import type { Program } from '../special/Program/spec';
+import type { SwitchCase } from '../special/SwitchCase/spec';
+import type { TemplateElement } from '../special/TemplateElement/spec';
+import type { TSClassImplements } from '../special/TSClassImplements/spec';
+import type { TSExternalModuleReference } from '../special/TSExternalModuleReference/spec';
+import type { TSInterfaceBody } from '../special/TSInterfaceBody/spec';
+import type { TSInterfaceHeritage } from '../special/TSInterfaceHeritage/spec';
+import type { TSModuleBlock } from '../special/TSModuleBlock/spec';
+import type { TSTypeAnnotation } from '../special/TSTypeAnnotation/spec';
+import type { TSTypeParameter } from '../special/TSTypeParameter/spec';
+import type { TSTypeParameterDeclaration } from '../special/TSTypeParameterDeclaration/spec';
+import type { TSTypeParameterInstantiation } from '../special/TSTypeParameterInstantiation/spec';
+import type { VariableDeclarator } from '../special/VariableDeclarator/spec';
+import type { BlockStatement } from '../statement/BlockStatement/spec';
+import type { BreakStatement } from '../statement/BreakStatement/spec';
+import type { ContinueStatement } from '../statement/ContinueStatement/spec';
+import type { DebuggerStatement } from '../statement/DebuggerStatement/spec';
+import type { DoWhileStatement } from '../statement/DoWhileStatement/spec';
+import type { ExpressionStatement } from '../statement/ExpressionStatement/spec';
+import type { ForInStatement } from '../statement/ForInStatement/spec';
+import type { ForOfStatement } from '../statement/ForOfStatement/spec';
+import type { ForStatement } from '../statement/ForStatement/spec';
+import type { IfStatement } from '../statement/IfStatement/spec';
+import type { ImportDeclaration } from '../statement/ImportDeclaration/spec';
+import type { LabeledStatement } from '../statement/LabeledStatement/spec';
+import type { ReturnStatement } from '../statement/ReturnStatement/spec';
+import type { SwitchStatement } from '../statement/SwitchStatement/spec';
+import type { ThrowStatement } from '../statement/ThrowStatement/spec';
+import type { TryStatement } from '../statement/TryStatement/spec';
+import type { TSExportAssignment } from '../statement/TSExportAssignment/spec';
+import type { WhileStatement } from '../statement/WhileStatement/spec';
+import type { WithStatement } from '../statement/WithStatement/spec';
+import type { TSAbstractKeyword } from '../token/TSAbstractKeyword/spec';
+import type { TSAsyncKeyword } from '../token/TSAsyncKeyword/spec';
+import type { TSDeclareKeyword } from '../token/TSDeclareKeyword/spec';
+import type { TSExportKeyword } from '../token/TSExportKeyword/spec';
+import type { TSPrivateKeyword } from '../token/TSPrivateKeyword/spec';
+import type { TSProtectedKeyword } from '../token/TSProtectedKeyword/spec';
+import type { TSPublicKeyword } from '../token/TSPublicKeyword/spec';
+import type { TSReadonlyKeyword } from '../token/TSReadonlyKeyword/spec';
+import type { TSStaticKeyword } from '../token/TSStaticKeyword/spec';
+import type { TSAnyKeyword } from '../type/TSAnyKeyword/spec';
+import type { TSArrayType } from '../type/TSArrayType/spec';
+import type { TSBigIntKeyword } from '../type/TSBigIntKeyword/spec';
+import type { TSBooleanKeyword } from '../type/TSBooleanKeyword/spec';
+import type { TSConditionalType } from '../type/TSConditionalType/spec';
+import type { TSConstructorType } from '../type/TSConstructorType/spec';
+import type { TSFunctionType } from '../type/TSFunctionType/spec';
+import type { TSImportType } from '../type/TSImportType/spec';
+import type { TSIndexedAccessType } from '../type/TSIndexedAccessType/spec';
+import type { TSInferType } from '../type/TSInferType/spec';
+import type { TSIntersectionType } from '../type/TSIntersectionType/spec';
+import type { TSIntrinsicKeyword } from '../type/TSIntrinsicType/spec';
+import type { TSLiteralType } from '../type/TSLiteralType/spec';
+import type { TSMappedType } from '../type/TSMappedType/spec';
+import type { TSNamedTupleMember } from '../type/TSNamedTupleMember/spec';
+import type { TSNeverKeyword } from '../type/TSNeverKeyword/spec';
+import type { TSNullKeyword } from '../type/TSNullKeyword/spec';
+import type { TSNumberKeyword } from '../type/TSNumberKeyword/spec';
+import type { TSObjectKeyword } from '../type/TSObjectKeyword/spec';
+import type { TSOptionalType } from '../type/TSOptionalType/spec';
+import type { TSParenthesizedType } from '../type/TSParenthesizedType/spec';
+import type { TSQualifiedName } from '../type/TSQualifiedName/spec';
+import type { TSRestType } from '../type/TSRestType/spec';
+import type { TSStringKeyword } from '../type/TSStringKeyword/spec';
+import type { TSSymbolKeyword } from '../type/TSSymbolKeyword/spec';
+import type { TSTemplateLiteralType } from '../type/TSTemplateLiteralType/spec';
+import type { TSThisType } from '../type/TSThisType/spec';
+import type { TSTupleType } from '../type/TSTupleType/spec';
+import type { TSTypeLiteral } from '../type/TSTypeLiteral/spec';
+import type { TSTypeOperator } from '../type/TSTypeOperator/spec';
+import type { TSTypePredicate } from '../type/TSTypePredicate/spec';
+import type { TSTypeQuery } from '../type/TSTypeQuery/spec';
+import type { TSTypeReference } from '../type/TSTypeReference/spec';
+import type { TSUndefinedKeyword } from '../type/TSUndefinedKeyword/spec';
+import type { TSUnionType } from '../type/TSUnionType/spec';
+import type { TSUnknownKeyword } from '../type/TSUnknownKeyword/spec';
+import type { TSVoidKeyword } from '../type/TSVoidKeyword/spec';
+import type { Literal } from './Literal';
+
+/*
+ * NOTE:
+ * Tokens are not included in the `Node` union below on purpose because they are not ever included as part of the standard AST tree.
+ */
+
+export type Node =
+ | ArrayExpression
+ | ArrayPattern
+ | ArrowFunctionExpression
+ | AssignmentExpression
+ | AssignmentPattern
+ | AwaitExpression
+ | BinaryExpression
+ | BlockStatement
+ | BreakStatement
+ | CallExpression
+ | CatchClause
+ | ChainExpression
+ | ClassBody
+ | ClassDeclaration
+ | ClassExpression
+ | ClassProperty
+ | ConditionalExpression
+ | ContinueStatement
+ | DebuggerStatement
+ | Decorator
+ | DoWhileStatement
+ | EmptyStatement
+ | ExportAllDeclaration
+ | ExportDefaultDeclaration
+ | ExportNamedDeclaration
+ | ExportSpecifier
+ | ExpressionStatement
+ | ForInStatement
+ | ForOfStatement
+ | ForStatement
+ | FunctionDeclaration
+ | FunctionExpression
+ | Identifier
+ | IfStatement
+ | ImportDeclaration
+ | ImportDefaultSpecifier
+ | ImportExpression
+ | ImportNamespaceSpecifier
+ | ImportSpecifier
+ | JSXAttribute
+ | JSXClosingElement
+ | JSXClosingFragment
+ | JSXElement
+ | JSXEmptyExpression
+ | JSXExpressionContainer
+ | JSXFragment
+ | JSXIdentifier
+ | JSXMemberExpression
+ | JSXNamespacedName
+ | JSXOpeningElement
+ | JSXOpeningFragment
+ | JSXSpreadAttribute
+ | JSXSpreadChild
+ | JSXText
+ | LabeledStatement
+ | Literal
+ | LogicalExpression
+ | MemberExpression
+ | MetaProperty
+ | MethodDefinition
+ | NewExpression
+ | ObjectExpression
+ | ObjectPattern
+ | Program
+ | Property
+ | RestElement
+ | ReturnStatement
+ | SequenceExpression
+ | SpreadElement
+ | Super
+ | SwitchCase
+ | SwitchStatement
+ | TaggedTemplateExpression
+ | TemplateElement
+ | TemplateLiteral
+ | ThisExpression
+ | ThrowStatement
+ | TryStatement
+ | TSAbstractClassProperty
+ | TSAbstractKeyword
+ | TSAbstractMethodDefinition
+ | TSAnyKeyword
+ | TSArrayType
+ | TSAsExpression
+ | TSAsyncKeyword
+ | TSBigIntKeyword
+ | TSBooleanKeyword
+ | TSCallSignatureDeclaration
+ | TSClassImplements
+ | TSConditionalType
+ | TSConstructorType
+ | TSConstructSignatureDeclaration
+ | TSDeclareFunction
+ | TSDeclareKeyword
+ | TSEmptyBodyFunctionExpression
+ | TSEnumDeclaration
+ | TSEnumMember
+ | TSExportAssignment
+ | TSExportKeyword
+ | TSExternalModuleReference
+ | TSFunctionType
+ | TSImportEqualsDeclaration
+ | TSImportType
+ | TSIndexedAccessType
+ | TSIndexSignature
+ | TSInferType
+ | TSInterfaceBody
+ | TSInterfaceDeclaration
+ | TSInterfaceHeritage
+ | TSIntersectionType
+ | TSIntrinsicKeyword
+ | TSLiteralType
+ | TSMappedType
+ | TSMethodSignature
+ | TSModuleBlock
+ | TSModuleDeclaration
+ | TSNamedTupleMember
+ | TSNamespaceExportDeclaration
+ | TSNeverKeyword
+ | TSNonNullExpression
+ | TSNullKeyword
+ | TSNumberKeyword
+ | TSObjectKeyword
+ | TSOptionalType
+ | TSParameterProperty
+ | TSParenthesizedType
+ | TSPrivateKeyword
+ | TSPropertySignature
+ | TSProtectedKeyword
+ | TSPublicKeyword
+ | TSQualifiedName
+ | TSReadonlyKeyword
+ | TSRestType
+ | TSStaticKeyword
+ | TSStringKeyword
+ | TSSymbolKeyword
+ | TSTemplateLiteralType
+ | TSThisType
+ | TSTupleType
+ | TSTypeAliasDeclaration
+ | TSTypeAnnotation
+ | TSTypeAssertion
+ | TSTypeLiteral
+ | TSTypeOperator
+ | TSTypeParameter
+ | TSTypeParameterDeclaration
+ | TSTypeParameterInstantiation
+ | TSTypePredicate
+ | TSTypeQuery
+ | TSTypeReference
+ | TSUndefinedKeyword
+ | TSUnionType
+ | TSUnknownKeyword
+ | TSVoidKeyword
+ | UnaryExpression
+ | UpdateExpression
+ | VariableDeclaration
+ | VariableDeclarator
+ | WhileStatement
+ | WithStatement
+ | YieldExpression;
diff --git a/packages/ast-spec/src/unions/ObjectLiteralElement.ts b/packages/ast-spec/src/unions/ObjectLiteralElement.ts
new file mode 100644
index 000000000000..d7575c80c1b9
--- /dev/null
+++ b/packages/ast-spec/src/unions/ObjectLiteralElement.ts
@@ -0,0 +1,8 @@
+import type { MethodDefinition } from '../element/MethodDefinition/spec';
+import type { Property } from '../element/Property/spec';
+import type { SpreadElement } from '../element/SpreadElement/spec';
+
+export type ObjectLiteralElement = MethodDefinition | Property | SpreadElement;
+
+// TODO - breaking change remove this
+export type ObjectLiteralElementLike = ObjectLiteralElement;
diff --git a/packages/ast-spec/src/unions/Parameter.ts b/packages/ast-spec/src/unions/Parameter.ts
new file mode 100644
index 000000000000..766a8dedbe7e
--- /dev/null
+++ b/packages/ast-spec/src/unions/Parameter.ts
@@ -0,0 +1,14 @@
+import type { Identifier } from '../expression/Identifier/spec';
+import type { ArrayPattern } from '../parameter/ArrayPattern/spec';
+import type { AssignmentPattern } from '../parameter/AssignmentPattern/spec';
+import type { ObjectPattern } from '../parameter/ObjectPattern/spec';
+import type { RestElement } from '../parameter/RestElement/spec';
+import type { TSParameterProperty } from '../parameter/TSParameterProperty/spec';
+
+export type Parameter =
+ | ArrayPattern
+ | AssignmentPattern
+ | Identifier
+ | ObjectPattern
+ | RestElement
+ | TSParameterProperty;
diff --git a/packages/ast-spec/src/unions/PrimaryExpression.ts b/packages/ast-spec/src/unions/PrimaryExpression.ts
new file mode 100644
index 000000000000..3c1dbf07fb85
--- /dev/null
+++ b/packages/ast-spec/src/unions/PrimaryExpression.ts
@@ -0,0 +1,35 @@
+import type { ArrayExpression } from '../expression/ArrayExpression/spec';
+import type { ClassExpression } from '../expression/ClassExpression/spec';
+import type { FunctionExpression } from '../expression/FunctionExpression/spec';
+import type { Identifier } from '../expression/Identifier/spec';
+import type { JSXElement } from '../expression/JSXElement/spec';
+import type { JSXFragment } from '../expression/JSXFragment/spec';
+import type { MetaProperty } from '../expression/MetaProperty/spec';
+import type { ObjectExpression } from '../expression/ObjectExpression/spec';
+import type { Super } from '../expression/Super/spec';
+import type { TemplateLiteral } from '../expression/TemplateLiteral/spec';
+import type { ThisExpression } from '../expression/ThisExpression/spec';
+import type { JSXOpeningElement } from '../jsx/JSXOpeningElement/spec';
+import type { ArrayPattern } from '../parameter/ArrayPattern/spec';
+import type { ObjectPattern } from '../parameter/ObjectPattern/spec';
+import type { TSNullKeyword } from '../type/TSNullKeyword/spec';
+import type { LiteralExpression } from './LiteralExpression';
+
+// TODO - breaking change remove this
+export type PrimaryExpression =
+ | ArrayExpression
+ | ArrayPattern
+ | ClassExpression
+ | FunctionExpression
+ | Identifier
+ | JSXElement
+ | JSXFragment
+ | JSXOpeningElement
+ | LiteralExpression
+ | MetaProperty
+ | ObjectExpression
+ | ObjectPattern
+ | Super
+ | TemplateLiteral
+ | ThisExpression
+ | TSNullKeyword;
diff --git a/packages/ast-spec/src/unions/PropertyName.ts b/packages/ast-spec/src/unions/PropertyName.ts
new file mode 100644
index 000000000000..56ba04cabbea
--- /dev/null
+++ b/packages/ast-spec/src/unions/PropertyName.ts
@@ -0,0 +1,11 @@
+import type { Identifier } from '../expression/Identifier/spec';
+import type { NumberLiteral } from '../expression/literal/NumberLiteral/spec';
+import type { StringLiteral } from '../expression/literal/StringLiteral/spec';
+import type { Expression } from '../unions/Expression';
+
+export type PropertyName = PropertyNameComputed | PropertyNameNonComputed;
+export type PropertyNameComputed = Expression;
+export type PropertyNameNonComputed =
+ | Identifier
+ | NumberLiteral
+ | StringLiteral;
diff --git a/packages/ast-spec/src/unions/Statement.ts b/packages/ast-spec/src/unions/Statement.ts
new file mode 100644
index 000000000000..7345a159982e
--- /dev/null
+++ b/packages/ast-spec/src/unions/Statement.ts
@@ -0,0 +1,78 @@
+import type { ClassDeclaration } from '../declaration/ClassDeclaration/spec';
+import type { ExportAllDeclaration } from '../declaration/ExportAllDeclaration/spec';
+import type { ExportDefaultDeclaration } from '../declaration/ExportDefaultDeclaration/spec';
+import type { ExportNamedDeclaration } from '../declaration/ExportNamedDeclaration/spec';
+import type { FunctionDeclaration } 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 { TSNamespaceExportDeclaration } from '../declaration/TSNamespaceExportDeclaration/spec';
+import type { TSTypeAliasDeclaration } from '../declaration/TSTypeAliasDeclaration/spec';
+import type { VariableDeclaration } from '../declaration/VariableDeclaration/spec';
+import type { BlockStatement } from '../statement/BlockStatement/spec';
+import type { BreakStatement } from '../statement/BreakStatement/spec';
+import type { ContinueStatement } from '../statement/ContinueStatement/spec';
+import type { DebuggerStatement } from '../statement/DebuggerStatement/spec';
+import type { DoWhileStatement } from '../statement/DoWhileStatement/spec';
+import type { ExpressionStatement } from '../statement/ExpressionStatement/spec';
+import type { ForInStatement } from '../statement/ForInStatement/spec';
+import type { ForOfStatement } from '../statement/ForOfStatement/spec';
+import type { ForStatement } from '../statement/ForStatement/spec';
+import type { IfStatement } from '../statement/IfStatement/spec';
+import type { ImportDeclaration } from '../statement/ImportDeclaration/spec';
+import type { LabeledStatement } from '../statement/LabeledStatement/spec';
+import type { ReturnStatement } from '../statement/ReturnStatement/spec';
+import type { SwitchStatement } from '../statement/SwitchStatement/spec';
+import type { ThrowStatement } from '../statement/ThrowStatement/spec';
+import type { TryStatement } from '../statement/TryStatement/spec';
+import type { TSExportAssignment } from '../statement/TSExportAssignment/spec';
+import type { WhileStatement } from '../statement/WhileStatement/spec';
+import type { WithStatement } from '../statement/WithStatement/spec';
+
+export type Statement =
+ | BlockStatement
+ | BreakStatement
+ | ClassDeclaration
+ | ContinueStatement
+ | DebuggerStatement
+ | DoWhileStatement
+ | ExportAllDeclaration
+ | ExportDefaultDeclaration
+ | ExportNamedDeclaration
+ | ExpressionStatement
+ | ForInStatement
+ | ForOfStatement
+ | ForStatement
+ | FunctionDeclaration
+ | IfStatement
+ | ImportDeclaration
+ | LabeledStatement
+ | ReturnStatement
+ | SwitchStatement
+ | ThrowStatement
+ | TryStatement
+ | TSDeclareFunction
+ | TSEnumDeclaration
+ | TSExportAssignment
+ | TSImportEqualsDeclaration
+ | TSInterfaceDeclaration
+ | TSModuleDeclaration
+ | TSNamespaceExportDeclaration
+ | TSTypeAliasDeclaration
+ | VariableDeclaration
+ | WhileStatement
+ | WithStatement;
+
+// These nodes are ***only*** allowed at the top-level
+export type ProgramStatement =
+ | ExportAllDeclaration
+ | ExportDefaultDeclaration
+ | ExportNamedDeclaration
+ | ImportDeclaration
+ | Statement
+ | TSImportEqualsDeclaration
+ | TSNamespaceExportDeclaration;
+
+// TODO - once we have syntax errors, the types in ProgramStatement should not be in Statement
diff --git a/packages/ast-spec/src/unions/TSUnaryExpression.ts b/packages/ast-spec/src/unions/TSUnaryExpression.ts
new file mode 100644
index 000000000000..b4dd05627bf6
--- /dev/null
+++ b/packages/ast-spec/src/unions/TSUnaryExpression.ts
@@ -0,0 +1,13 @@
+import type { AwaitExpression } from '../expression/AwaitExpression/spec';
+import type { TSTypeAssertion } from '../expression/TSTypeAssertion/spec';
+import type { UnaryExpression } from '../expression/UnaryExpression/spec';
+import type { UpdateExpression } from '../expression/UpdateExpression/spec';
+import type { LeftHandSideExpression } from './LeftHandSideExpression';
+
+// TODO - breaking change remove this
+export type TSUnaryExpression =
+ | AwaitExpression
+ | LeftHandSideExpression
+ | TSTypeAssertion
+ | UnaryExpression
+ | UpdateExpression;
diff --git a/packages/ast-spec/src/unions/Token.ts b/packages/ast-spec/src/unions/Token.ts
new file mode 100644
index 000000000000..3d71cb019a7f
--- /dev/null
+++ b/packages/ast-spec/src/unions/Token.ts
@@ -0,0 +1,26 @@
+import type { BooleanToken } from '../token/BooleanToken/spec';
+import type { IdentifierToken } from '../token/IdentifierToken/spec';
+import type { JSXIdentifierToken } from '../token/JSXIdentifierToken/spec';
+import type { JSXTextToken } from '../token/JSXTextToken/spec';
+import type { KeywordToken } from '../token/KeywordToken/spec';
+import type { NullToken } from '../token/NullToken/spec';
+import type { NumericToken } from '../token/NumericToken/spec';
+import type { PunctuatorToken } from '../token/PunctuatorToken/spec';
+import type { RegularExpressionToken } from '../token/RegularExpressionToken/spec';
+import type { StringToken } from '../token/StringToken/spec';
+import type { TemplateToken } from '../token/TemplateToken/spec';
+import type { Comment } from './Comment';
+
+export type Token =
+ | BooleanToken
+ | Comment
+ | IdentifierToken
+ | JSXIdentifierToken
+ | JSXTextToken
+ | KeywordToken
+ | NullToken
+ | NumericToken
+ | PunctuatorToken
+ | RegularExpressionToken
+ | StringToken
+ | TemplateToken;
diff --git a/packages/ast-spec/src/unions/TypeElement.ts b/packages/ast-spec/src/unions/TypeElement.ts
new file mode 100644
index 000000000000..9a4bbc99c223
--- /dev/null
+++ b/packages/ast-spec/src/unions/TypeElement.ts
@@ -0,0 +1,12 @@
+import type { TSCallSignatureDeclaration } from '../element/TSCallSignatureDeclaration/spec';
+import type { TSConstructSignatureDeclaration } from '../element/TSConstructSignatureDeclaration/spec';
+import type { TSIndexSignature } from '../element/TSIndexSignature/spec';
+import type { TSMethodSignature } from '../element/TSMethodSignature/spec';
+import type { TSPropertySignature } from '../element/TSPropertySignature/spec';
+
+export type TypeElement =
+ | TSCallSignatureDeclaration
+ | TSConstructSignatureDeclaration
+ | TSIndexSignature
+ | TSMethodSignature
+ | TSPropertySignature;
diff --git a/packages/ast-spec/src/unions/TypeNode.ts b/packages/ast-spec/src/unions/TypeNode.ts
new file mode 100644
index 000000000000..c50630e6cd6a
--- /dev/null
+++ b/packages/ast-spec/src/unions/TypeNode.ts
@@ -0,0 +1,74 @@
+import type { TSAnyKeyword } from '../type/TSAnyKeyword/spec';
+import type { TSArrayType } from '../type/TSArrayType/spec';
+import type { TSBigIntKeyword } from '../type/TSBigIntKeyword/spec';
+import type { TSBooleanKeyword } from '../type/TSBooleanKeyword/spec';
+import type { TSConditionalType } from '../type/TSConditionalType/spec';
+import type { TSConstructorType } from '../type/TSConstructorType/spec';
+import type { TSFunctionType } from '../type/TSFunctionType/spec';
+import type { TSImportType } from '../type/TSImportType/spec';
+import type { TSIndexedAccessType } from '../type/TSIndexedAccessType/spec';
+import type { TSInferType } from '../type/TSInferType/spec';
+import type { TSIntersectionType } from '../type/TSIntersectionType/spec';
+import type { TSIntrinsicKeyword } from '../type/TSIntrinsicType/spec';
+import type { TSLiteralType } from '../type/TSLiteralType/spec';
+import type { TSMappedType } from '../type/TSMappedType/spec';
+import type { TSNamedTupleMember } from '../type/TSNamedTupleMember/spec';
+import type { TSNeverKeyword } from '../type/TSNeverKeyword/spec';
+import type { TSNullKeyword } from '../type/TSNullKeyword/spec';
+import type { TSNumberKeyword } from '../type/TSNumberKeyword/spec';
+import type { TSObjectKeyword } from '../type/TSObjectKeyword/spec';
+import type { TSOptionalType } from '../type/TSOptionalType/spec';
+import type { TSParenthesizedType } from '../type/TSParenthesizedType/spec';
+import type { TSRestType } from '../type/TSRestType/spec';
+import type { TSStringKeyword } from '../type/TSStringKeyword/spec';
+import type { TSSymbolKeyword } from '../type/TSSymbolKeyword/spec';
+import type { TSTemplateLiteralType } from '../type/TSTemplateLiteralType/spec';
+import type { TSThisType } from '../type/TSThisType/spec';
+import type { TSTupleType } from '../type/TSTupleType/spec';
+import type { TSTypeLiteral } from '../type/TSTypeLiteral/spec';
+import type { TSTypeOperator } from '../type/TSTypeOperator/spec';
+import type { TSTypePredicate } from '../type/TSTypePredicate/spec';
+import type { TSTypeQuery } from '../type/TSTypeQuery/spec';
+import type { TSTypeReference } from '../type/TSTypeReference/spec';
+import type { TSUndefinedKeyword } from '../type/TSUndefinedKeyword/spec';
+import type { TSUnionType } from '../type/TSUnionType/spec';
+import type { TSUnknownKeyword } from '../type/TSUnknownKeyword/spec';
+import type { TSVoidKeyword } from '../type/TSVoidKeyword/spec';
+
+export type TypeNode =
+ | TSAnyKeyword
+ | TSArrayType
+ | TSBigIntKeyword
+ | TSBooleanKeyword
+ | TSConditionalType
+ | TSConstructorType
+ | TSFunctionType
+ | TSImportType
+ | TSIndexedAccessType
+ | TSInferType
+ | TSIntersectionType
+ | TSIntrinsicKeyword
+ | TSLiteralType
+ | TSMappedType
+ | TSNamedTupleMember
+ | TSNeverKeyword
+ | TSNullKeyword
+ | TSNumberKeyword
+ | TSObjectKeyword
+ | TSOptionalType
+ | TSParenthesizedType
+ | TSRestType
+ | TSStringKeyword
+ | TSSymbolKeyword
+ | TSTemplateLiteralType
+ | TSThisType
+ | TSTupleType
+ | TSTypeLiteral
+ | TSTypeOperator
+ | TSTypePredicate
+ | TSTypeQuery
+ | TSTypeReference
+ | TSUndefinedKeyword
+ | TSUnionType
+ | TSUnknownKeyword
+ | TSVoidKeyword;
diff --git a/packages/ast-spec/tests/ast-node-types.test.ts b/packages/ast-spec/tests/ast-node-types.test.ts
new file mode 100644
index 000000000000..7cc247f2d094
--- /dev/null
+++ b/packages/ast-spec/tests/ast-node-types.test.ts
@@ -0,0 +1,16 @@
+import type { AST_NODE_TYPES } from '../src/ast-node-types';
+import type { Node } from '../src/unions/Node';
+
+type GetKeys = keyof Extract;
+
+type AllKeys = {
+ readonly [T in AST_NODE_TYPES]: GetKeys;
+};
+
+type TakesString> = T;
+
+// @ts-expect-error: purposely unused
+type _Test =
+ // forcing the test onto a new line so it isn't covered by the expect error
+ // If there are any enum members that don't have a corresponding TSESTree.Node, then this line will error with "Type 'string | number | symbol' is not assignable to type 'string'."
+ TakesString | void;
diff --git a/packages/ast-spec/tsconfig.build.json b/packages/ast-spec/tsconfig.build.json
new file mode 100644
index 000000000000..215a0282df2b
--- /dev/null
+++ b/packages/ast-spec/tsconfig.build.json
@@ -0,0 +1,10 @@
+{
+ "extends": "../../tsconfig.base.json",
+ "compilerOptions": {
+ "composite": true,
+ "outDir": "./dist",
+ "rootDir": "./src",
+ "resolveJsonModule": true
+ },
+ "include": ["src", "typings"]
+}
diff --git a/packages/ast-spec/tsconfig.json b/packages/ast-spec/tsconfig.json
new file mode 100644
index 000000000000..4b76ef4253b9
--- /dev/null
+++ b/packages/ast-spec/tsconfig.json
@@ -0,0 +1,8 @@
+{
+ "extends": "./tsconfig.build.json",
+ "compilerOptions": {
+ "composite": false,
+ "rootDir": "."
+ },
+ "include": ["src", "typings", "tests", "tools", "./rollup.config.ts"]
+}
diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md
index 0d3715d66a7c..eabb843ecc74 100644
--- a/packages/eslint-plugin-internal/CHANGELOG.md
+++ b/packages/eslint-plugin-internal/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Features
+
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal
diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json
index f0c64a185df3..19c94ac2096e 100644
--- a/packages/eslint-plugin-internal/package.json
+++ b/packages/eslint-plugin-internal/package.json
@@ -1,12 +1,12 @@
{
"name": "@typescript-eslint/eslint-plugin-internal",
- "version": "4.22.1",
+ "version": "4.23.0",
"private": true,
"main": "dist/index.js",
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist",
+ "postclean": "rimraf dist && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
"test": "jest --coverage",
@@ -14,7 +14,7 @@
},
"dependencies": {
"@types/prettier": "*",
- "@typescript-eslint/experimental-utils": "4.22.1",
+ "@typescript-eslint/experimental-utils": "4.23.0",
"prettier": "*"
}
}
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 bc26d9d9d9a1..64fefc08f8ef 100644
--- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
+++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
@@ -408,7 +408,9 @@ export default createRule({
}
}
- function isNoFormatTemplateTag(tag: TSESTree.Expression): boolean {
+ function isNoFormatTemplateTag(
+ tag: TSESTree.LeftHandSideExpression,
+ ): boolean {
return tag.type === AST_NODE_TYPES.Identifier && tag.name === 'noFormat';
}
diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md
index d24f79ee7598..42674a224c72 100644
--- a/packages/eslint-plugin-tslint/CHANGELOG.md
+++ b/packages/eslint-plugin-tslint/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Features
+
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint
diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json
index fcd692ca596e..b623a32ad7b6 100644
--- a/packages/eslint-plugin-tslint/package.json
+++ b/packages/eslint-plugin-tslint/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin-tslint",
- "version": "4.22.1",
+ "version": "4.23.0",
"main": "dist/index.js",
"typings": "src/index.ts",
"description": "TSLint wrapper plugin for ESLint",
@@ -31,14 +31,14 @@
"scripts": {
"build": "tsc -b tsconfig.build.json",
"clean": "tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist",
+ "postclean": "rimraf dist && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
"test": "jest --coverage",
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/experimental-utils": "4.22.1",
+ "@typescript-eslint/experimental-utils": "4.23.0",
"lodash": "^4.17.15"
},
"peerDependencies": {
@@ -48,6 +48,6 @@
},
"devDependencies": {
"@types/lodash": "*",
- "@typescript-eslint/parser": "4.22.1"
+ "@typescript-eslint/parser": "4.23.0"
}
}
diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md
index fb6b1f65dd07..8e6b83868d96 100644
--- a/packages/eslint-plugin/CHANGELOG.md
+++ b/packages/eslint-plugin/CHANGELOG.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Bug Fixes
+
+* **scope-manager:** fix visiting TSAsExpression in assignment ([#3355](https://github.com/typescript-eslint/typescript-eslint/issues/3355)) ([87521a0](https://github.com/typescript-eslint/typescript-eslint/commit/87521a024103bc5fc643861649bee9a288f55b7b))
+
+
+### Features
+
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/eslint-plugin
diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json
index 38db92807b9e..486d0bb75c1a 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/eslint-plugin",
- "version": "4.22.1",
+ "version": "4.23.0",
"description": "TypeScript plugin for ESLint",
"keywords": [
"eslint",
@@ -35,7 +35,7 @@
"check:docs": "jest tests/docs.test.ts --runTestsByPath --silent --runInBand",
"check:configs": "jest tests/configs.test.ts --runTestsByPath --silent --runInBand",
"clean": "tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist",
+ "postclean": "rimraf dist && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
"generate:configs": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-configs.ts",
"generate:rules-lists": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-rules-lists.ts",
@@ -44,8 +44,8 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/experimental-utils": "4.22.1",
- "@typescript-eslint/scope-manager": "4.22.1",
+ "@typescript-eslint/experimental-utils": "4.23.0",
+ "@typescript-eslint/scope-manager": "4.23.0",
"debug": "^4.1.1",
"functional-red-black-tree": "^1.0.1",
"lodash": "^4.17.15",
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 47ab5b1a74fa..1e04d080e747 100644
--- a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts
+++ b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts
@@ -46,7 +46,7 @@ export default util.createRule({
rules.Literal({
...node,
raw: isSeperatedNumeric(node) ? node.raw.replace(/_/g, '') : node.raw,
- });
+ } as never);
},
};
},
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
index aee4963a0c05..f5ca89e88d60 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
@@ -167,7 +167,7 @@ export default createRule({
});
}
- function getNodeType(node: TSESTree.Expression): ts.Type {
+ function getNodeType(node: TSESTree.Node): ts.Type {
const tsNode = service.esTreeNodeToTSNodeMap.get(node);
return getConstrainedTypeAtLocation(checker, tsNode);
}
diff --git a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts
index d78c4496164d..636fe2b3825a 100644
--- a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts
+++ b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts
@@ -40,7 +40,7 @@ export default createRule({
* Check if a given node is a string.
* @param node The node to check.
*/
- function isStringType(node: TSESTree.Expression): boolean {
+ function isStringType(node: TSESTree.Node): boolean {
const objectType = typeChecker.getTypeAtLocation(
parserServices.esTreeNodeToTSNodeMap.get(node),
);
@@ -51,7 +51,7 @@ export default createRule({
* Check if a given node is a RegExp.
* @param node The node to check.
*/
- function isRegExpType(node: TSESTree.Expression): boolean {
+ function isRegExpType(node: TSESTree.Node): boolean {
const objectType = typeChecker.getTypeAtLocation(
parserServices.esTreeNodeToTSNodeMap.get(node),
);
diff --git a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts
index fb83da6f318b..af80720c2904 100644
--- a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts
+++ b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts
@@ -82,7 +82,6 @@ function getGroup(node: TSESTree.TypeNode): Group {
return Group.union;
// These types should never occur as part of a union/intersection
- case AST_NODE_TYPES.TSInterfaceHeritage:
case AST_NODE_TYPES.TSNamedTupleMember:
case AST_NODE_TYPES.TSOptionalType:
case AST_NODE_TYPES.TSRestType:
diff --git a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts
index 020a4e715d67..4f2c9702411b 100644
--- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts
+++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts
@@ -139,6 +139,13 @@ function predicate(arg: any): asserts arg is T {
throw 'oops';
}
}
+ `,
+ `
+interface ITest {
+ attr: string;
+}
+let test: unknown;
+(test as ITest) = { attr: '' };
`,
{
code: `
diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md
index 063cc2fbe70f..eeb5bdce9315 100644
--- a/packages/experimental-utils/CHANGELOG.md
+++ b/packages/experimental-utils/CHANGELOG.md
@@ -3,6 +3,18 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Features
+
+* **experimental-utils:** Include `getCwd()` in `RuleContext` type ([#3308](https://github.com/typescript-eslint/typescript-eslint/issues/3308)) ([2b75c11](https://github.com/typescript-eslint/typescript-eslint/commit/2b75c11d69bee88ca0cb77d7efd32b8d0387e6b3))
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/experimental-utils
diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json
index b3402e64bde0..b6b957d9fbd4 100644
--- a/packages/experimental-utils/package.json
+++ b/packages/experimental-utils/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/experimental-utils",
- "version": "4.22.1",
+ "version": "4.23.0",
"description": "(Experimental) Utilities for working with TypeScript + ESLint together",
"keywords": [
"eslint",
@@ -32,7 +32,7 @@
"build": "tsc -b tsconfig.build.json",
"postbuild": "downlevel-dts dist _ts3.4/dist",
"clean": "tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist && rimraf _ts3.4",
+ "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
"test": "jest --coverage",
@@ -40,9 +40,9 @@
},
"dependencies": {
"@types/json-schema": "^7.0.3",
- "@typescript-eslint/scope-manager": "4.22.1",
- "@typescript-eslint/types": "4.22.1",
- "@typescript-eslint/typescript-estree": "4.22.1",
+ "@typescript-eslint/scope-manager": "4.23.0",
+ "@typescript-eslint/types": "4.23.0",
+ "@typescript-eslint/typescript-estree": "4.23.0",
"eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0"
},
diff --git a/packages/experimental-utils/src/ts-eslint/Rule.ts b/packages/experimental-utils/src/ts-eslint/Rule.ts
index d74af833121e..19f457201ef1 100644
--- a/packages/experimental-utils/src/ts-eslint/Rule.ts
+++ b/packages/experimental-utils/src/ts-eslint/Rule.ts
@@ -211,6 +211,14 @@ interface RuleContext<
*/
getDeclaredVariables(node: TSESTree.Node): Scope.Variable[];
+ /**
+ * Returns the current working directory passed to Linter.
+ * It is a path to a directory that should be considered as the current working directory.
+ * This was added in v6.6.0
+ * @since 6.6.0
+ */
+ getCwd?(): string;
+
/**
* Returns the filename associated with the source.
*/
diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md
index 9cf4c93a41da..24ee584b6616 100644
--- a/packages/parser/CHANGELOG.md
+++ b/packages/parser/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Features
+
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/parser
diff --git a/packages/parser/package.json b/packages/parser/package.json
index 7aaac815772d..3d1d4e994c68 100644
--- a/packages/parser/package.json
+++ b/packages/parser/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/parser",
- "version": "4.22.1",
+ "version": "4.23.0",
"description": "An ESLint custom parser which leverages TypeScript ESTree",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -34,7 +34,7 @@
"build": "tsc -b tsconfig.build.json",
"postbuild": "downlevel-dts dist _ts3.4/dist",
"clean": "tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist",
+ "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
"test": "jest --coverage",
@@ -44,14 +44,14 @@
"eslint": "^5.0.0 || ^6.0.0 || ^7.0.0"
},
"dependencies": {
- "@typescript-eslint/scope-manager": "4.22.1",
- "@typescript-eslint/types": "4.22.1",
- "@typescript-eslint/typescript-estree": "4.22.1",
+ "@typescript-eslint/scope-manager": "4.23.0",
+ "@typescript-eslint/types": "4.23.0",
+ "@typescript-eslint/typescript-estree": "4.23.0",
"debug": "^4.1.1"
},
"devDependencies": {
"@types/glob": "*",
- "@typescript-eslint/experimental-utils": "4.22.1",
+ "@typescript-eslint/experimental-utils": "4.23.0",
"glob": "*",
"typescript": "*"
},
diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md
index 6e810ce89e75..0ed98170f798 100644
--- a/packages/scope-manager/CHANGELOG.md
+++ b/packages/scope-manager/CHANGELOG.md
@@ -3,6 +3,22 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Bug Fixes
+
+* **scope-manager:** fix visiting TSAsExpression in assignment ([#3355](https://github.com/typescript-eslint/typescript-eslint/issues/3355)) ([87521a0](https://github.com/typescript-eslint/typescript-eslint/commit/87521a024103bc5fc643861649bee9a288f55b7b))
+
+
+### Features
+
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/scope-manager
diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json
index 51f58e98474b..0950b9c97ace 100644
--- a/packages/scope-manager/package.json
+++ b/packages/scope-manager/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/scope-manager",
- "version": "4.22.1",
+ "version": "4.23.0",
"description": "TypeScript scope analyser for ESLint",
"keywords": [
"eslint",
@@ -31,7 +31,7 @@
"build": "tsc -b tsconfig.build.json",
"postbuild": "downlevel-dts dist _ts3.4/dist",
"clean": "tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist",
+ "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
"generate:lib": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-lib.ts",
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
@@ -39,12 +39,12 @@
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/types": "4.22.1",
- "@typescript-eslint/visitor-keys": "4.22.1"
+ "@typescript-eslint/types": "4.23.0",
+ "@typescript-eslint/visitor-keys": "4.23.0"
},
"devDependencies": {
"@types/glob": "*",
- "@typescript-eslint/typescript-estree": "4.22.1",
+ "@typescript-eslint/typescript-estree": "4.23.0",
"glob": "*",
"jest-specific-snapshot": "*",
"make-dir": "*",
diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts
index b0e7557ee7eb..ef8bb513822f 100644
--- a/packages/scope-manager/src/referencer/Referencer.ts
+++ b/packages/scope-manager/src/referencer/Referencer.ts
@@ -320,7 +320,7 @@ class Referencer extends Visitor {
case AST_NODE_TYPES.TSAsExpression:
case AST_NODE_TYPES.TSTypeAssertion:
// explicitly visit the type annotation
- this.visit(left.typeAnnotation);
+ this.visitType(left.typeAnnotation);
// intentional fallthrough
case AST_NODE_TYPES.TSNonNullExpression:
// unwrap the expression
diff --git a/packages/scope-manager/src/scope/ScopeBase.ts b/packages/scope-manager/src/scope/ScopeBase.ts
index 04f38e8a65f3..602dd81a206a 100644
--- a/packages/scope-manager/src/scope/ScopeBase.ts
+++ b/packages/scope-manager/src/scope/ScopeBase.ts
@@ -87,22 +87,20 @@ function isStrictScope(
if (stmt.type !== AST_NODE_TYPES.ExpressionStatement) {
break;
}
- const expr = stmt.expression;
- if (
- expr.type !== AST_NODE_TYPES.Literal ||
- typeof expr.value !== 'string'
- ) {
+ if (stmt.directive === 'use strict') {
+ return true;
+ }
+
+ const expr = stmt.expression;
+ if (expr.type !== AST_NODE_TYPES.Literal) {
break;
}
- if (expr.raw !== null && expr.raw !== undefined) {
- if (expr.raw === '"use strict"' || expr.raw === "'use strict'") {
- return true;
- }
- } else {
- if (expr.value === 'use strict') {
- return true;
- }
+ if (expr.raw === '"use strict"' || expr.raw === "'use strict'") {
+ return true;
+ }
+ if (expr.value === 'use strict') {
+ return true;
}
}
return false;
diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md
index da5b4caeb197..6419ab67f15f 100644
--- a/packages/shared-fixtures/CHANGELOG.md
+++ b/packages/shared-fixtures/CHANGELOG.md
@@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+**Note:** Version bump only for package @typescript-eslint/shared-fixtures
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/shared-fixtures
diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json
index 3c06d355b8fa..a8e0d833683c 100644
--- a/packages/shared-fixtures/package.json
+++ b/packages/shared-fixtures/package.json
@@ -1,5 +1,5 @@
{
"name": "@typescript-eslint/shared-fixtures",
- "version": "4.22.1",
+ "version": "4.23.0",
"private": true
}
diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md
index f62ac84b89d4..0e43ee7cd8af 100644
--- a/packages/types/CHANGELOG.md
+++ b/packages/types/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Features
+
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/types
diff --git a/packages/types/package.json b/packages/types/package.json
index 5251c580de59..46b53fd9fd9d 100644
--- a/packages/types/package.json
+++ b/packages/types/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/types",
- "version": "4.22.1",
+ "version": "4.23.0",
"description": "Types for the TypeScript-ESTree AST spec",
"keywords": [
"eslint",
@@ -19,7 +19,7 @@
"repository": {
"type": "git",
"url": "https://github.com/typescript-eslint/typescript-eslint.git",
- "directory": "packages/visitor-keys"
+ "directory": "packages/types"
},
"bugs": {
"url": "https://github.com/typescript-eslint/typescript-eslint/issues"
@@ -28,10 +28,11 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
+ "prebuild": "yarn ts-node --transpile-only ./tools/copy-ast-spec.ts",
"build": "tsc -b tsconfig.build.json",
"postbuild": "downlevel-dts dist _ts3.4/dist",
"clean": "tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist",
+ "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
"generate:lib": "../../node_modules/.bin/ts-node --files --transpile-only ../scope-manager/tools/generate-lib.ts",
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
diff --git a/packages/types/src/index.ts b/packages/types/src/index.ts
index 59df48302df5..4bda24b13818 100644
--- a/packages/types/src/index.ts
+++ b/packages/types/src/index.ts
@@ -1,5 +1,5 @@
-export { AST_NODE_TYPES } from './ast-node-types';
-export { AST_TOKEN_TYPES } from './ast-token-types';
+export { AST_NODE_TYPES } from './ast-spec';
+export { AST_TOKEN_TYPES } from './ast-spec';
export * from './lib';
export * from './parser-options';
-export * as TSESTree from './ts-estree';
+export * from './ts-estree';
diff --git a/packages/types/src/ts-estree.ts b/packages/types/src/ts-estree.ts
index e296b5668ae0..037bd3f92c97 100644
--- a/packages/types/src/ts-estree.ts
+++ b/packages/types/src/ts-estree.ts
@@ -1,1769 +1,21 @@
-import { AST_NODE_TYPES } from './ast-node-types';
-import { AST_TOKEN_TYPES } from './ast-token-types';
+import * as TSESTree from './ast-spec';
-export interface LineAndColumnData {
- /**
- * Line number (1-indexed)
- */
- line: number;
- /**
- * Column number on the line (0-indexed)
- */
- column: number;
-}
-export interface SourceLocation {
- /**
- * The position of the first character of the parsed source region
- */
- start: LineAndColumnData;
- /**
- * The position of the first character after the parsed source region
- */
- end: LineAndColumnData;
-}
-export type Range = [number, number];
-
-export interface BaseNode {
- /**
- * The source location information of the node.
- */
- loc: SourceLocation;
- /**
- * An array of two numbers.
- * Both numbers are a 0-based index which is the position in the array of source code characters.
- * The first is the start position of the node, the second is the end position of the node.
- */
- range: Range;
- /**
- * The parent node of the current node
- */
- parent?: Node;
-
- // every node *will* have a type, but let the nodes define their own exact string
- // type: string;
-
- // we don't ever set this from within ts-estree
- // source?: string | null;
-}
-
-/*
- * Token and Comment are pseudo-nodes to represent pieces of source code
- *
- * NOTE:
- * They are not included in the `Node` union below on purpose because they
- * are not ever included as part of the standard AST tree.
- */
-interface BaseToken extends BaseNode {
- value: string;
-}
-
-export interface BooleanToken extends BaseToken {
- type: AST_TOKEN_TYPES.Boolean;
-}
-
-export interface IdentifierToken extends BaseToken {
- type: AST_TOKEN_TYPES.Identifier;
-}
-
-export interface JSXIdentifierToken extends BaseToken {
- type: AST_TOKEN_TYPES.JSXIdentifier;
-}
-
-export interface JSXTextToken extends BaseToken {
- type: AST_TOKEN_TYPES.JSXText;
-}
-
-export interface KeywordToken extends BaseToken {
- type: AST_TOKEN_TYPES.Keyword;
-}
-
-export interface NullToken extends BaseToken {
- type: AST_TOKEN_TYPES.Null;
-}
-
-export interface NumericToken extends BaseToken {
- type: AST_TOKEN_TYPES.Numeric;
-}
-
-export interface PunctuatorToken extends BaseToken {
- type: AST_TOKEN_TYPES.Punctuator;
-}
-
-export interface RegularExpressionToken extends BaseToken {
- type: AST_TOKEN_TYPES.RegularExpression;
- regex: {
- pattern: string;
- flags: string;
- };
-}
-
-export interface StringToken extends BaseToken {
- type: AST_TOKEN_TYPES.String;
-}
-
-export interface TemplateToken extends BaseToken {
- type: AST_TOKEN_TYPES.Template;
-}
-
-export interface BlockComment extends BaseToken {
- type: AST_TOKEN_TYPES.Block;
-}
-
-export interface LineComment extends BaseToken {
- type: AST_TOKEN_TYPES.Line;
-}
-
-export type Comment = BlockComment | LineComment;
-export type Token =
- | BooleanToken
- | Comment
- | IdentifierToken
- | JSXIdentifierToken
- | JSXTextToken
- | KeywordToken
- | NullToken
- | NumericToken
- | PunctuatorToken
- | RegularExpressionToken
- | StringToken
- | TemplateToken;
-
-export type OptionalRangeAndLoc = Pick<
- T,
- Exclude
-> & {
- range?: Range;
- loc?: SourceLocation;
-};
-
-// Every single valid AST Node
-// Please keep it sorted alphabetically.
-export type Node =
- | ArrayExpression
- | ArrayPattern
- | ArrowFunctionExpression
- | AssignmentExpression
- | AssignmentPattern
- | AwaitExpression
- | BigIntLiteral
- | BinaryExpression
- | BlockStatement
- | BreakStatement
- | CallExpression
- | CatchClause
- | ChainExpression
- | ClassBody
- | ClassDeclaration
- | ClassExpression
- | ClassProperty
- | ConditionalExpression
- | ContinueStatement
- | DebuggerStatement
- | Decorator
- | DoWhileStatement
- | EmptyStatement
- | ExportAllDeclaration
- | ExportDefaultDeclaration
- | ExportNamedDeclaration
- | ExportSpecifier
- | ExpressionStatement
- | ForInStatement
- | ForOfStatement
- | ForStatement
- | FunctionDeclaration
- | FunctionExpression
- | Identifier
- | IfStatement
- | ImportDeclaration
- | ImportDefaultSpecifier
- | ImportExpression
- | ImportNamespaceSpecifier
- | ImportSpecifier
- | JSXAttribute
- | JSXClosingElement
- | JSXClosingFragment
- | JSXElement
- | JSXEmptyExpression
- | JSXExpressionContainer
- | JSXFragment
- | JSXIdentifier
- | JSXMemberExpression
- | JSXNamespacedName
- | JSXOpeningElement
- | JSXOpeningFragment
- | JSXSpreadAttribute
- | JSXSpreadChild
- | JSXText
- | LabeledStatement
- | Literal
- | LogicalExpression
- | MemberExpression
- | MetaProperty
- | MethodDefinition
- | NewExpression
- | ObjectExpression
- | ObjectPattern
- | Program
- | Property
- | RestElement
- | ReturnStatement
- | SequenceExpression
- | SpreadElement
- | Super
- | SwitchCase
- | SwitchStatement
- | TaggedTemplateExpression
- | TemplateElement
- | TemplateLiteral
- | ThisExpression
- | ThrowStatement
- | TryStatement
- | TSAbstractClassProperty
- | TSAbstractKeyword
- | TSAbstractMethodDefinition
- | TSAnyKeyword
- | TSArrayType
- | TSAsExpression
- | TSAsyncKeyword
- | TSBigIntKeyword
- | TSBooleanKeyword
- | TSCallSignatureDeclaration
- | TSClassImplements
- | TSConditionalType
- | TSConstructorType
- | TSConstructSignatureDeclaration
- | TSDeclareFunction
- | TSDeclareKeyword
- | TSEmptyBodyFunctionExpression
- | TSEnumDeclaration
- | TSEnumMember
- | TSExportAssignment
- | TSExportKeyword
- | TSExternalModuleReference
- | TSFunctionType
- | TSImportEqualsDeclaration
- | TSImportType
- | TSIndexedAccessType
- | TSIndexSignature
- | TSInferType
- | TSInterfaceBody
- | TSInterfaceDeclaration
- | TSInterfaceHeritage
- | TSIntersectionType
- | TSIntrinsicKeyword
- | TSLiteralType
- | TSMappedType
- | TSMethodSignature
- | TSModuleBlock
- | TSModuleDeclaration
- | TSNamedTupleMember
- | TSNamespaceExportDeclaration
- | TSNeverKeyword
- | TSNonNullExpression
- | TSNullKeyword
- | TSNumberKeyword
- | TSObjectKeyword
- | TSOptionalType
- | TSParameterProperty
- | TSParenthesizedType
- | TSPrivateKeyword
- | TSPropertySignature
- | TSProtectedKeyword
- | TSPublicKeyword
- | TSQualifiedName
- | TSReadonlyKeyword
- | TSRestType
- | TSStaticKeyword
- | TSStringKeyword
- | TSSymbolKeyword
- | TSTemplateLiteralType
- | TSThisType
- | TSTupleType
- | TSTypeAliasDeclaration
- | TSTypeAnnotation
- | TSTypeAssertion
- | TSTypeLiteral
- | TSTypeOperator
- | TSTypeParameter
- | TSTypeParameterDeclaration
- | TSTypeParameterInstantiation
- | TSTypePredicate
- | TSTypeQuery
- | TSTypeReference
- | TSUndefinedKeyword
- | TSUnionType
- | TSUnknownKeyword
- | TSVoidKeyword
- | UnaryExpression
- | UpdateExpression
- | VariableDeclaration
- | VariableDeclarator
- | WhileStatement
- | WithStatement
- | YieldExpression;
-
-//////////
-// Reusable Unions
-// These are based off of types used in the Typescript AST definitions
-// **Ensure you sort the union members alphabetically**
-//////////
-
-export type Accessibility = 'public' | 'protected' | 'private';
-export type BindingPattern = ArrayPattern | ObjectPattern;
-export type BindingName = BindingPattern | Identifier;
-export type ChainElement =
- | CallExpression
- | MemberExpression
- | TSNonNullExpression;
-export type ClassElement =
- | ClassProperty
- | MethodDefinition
- | TSAbstractClassProperty
- | TSAbstractMethodDefinition
- | TSIndexSignature;
-export type ClassProperty =
- | ClassPropertyComputedName
- | ClassPropertyNonComputedName;
-export type DeclarationStatement =
- | ClassDeclaration
- | ClassExpression
- | ExportDefaultDeclaration
- | ExportAllDeclaration
- | ExportNamedDeclaration
- | FunctionDeclaration
- | TSDeclareFunction
- | TSImportEqualsDeclaration
- | TSInterfaceDeclaration
- | TSModuleDeclaration
- | TSNamespaceExportDeclaration
- | TSTypeAliasDeclaration
- | TSEnumDeclaration;
-export type DestructuringPattern =
- | Identifier
- | ObjectPattern
- | ArrayPattern
- | RestElement
- | AssignmentPattern
- | MemberExpression;
-export type EntityName = Identifier | TSQualifiedName;
-export type ExportDeclaration =
- | ClassDeclaration
- | ClassExpression
- | FunctionDeclaration
- | TSDeclareFunction
- | TSEnumDeclaration
- | TSInterfaceDeclaration
- | TSModuleDeclaration
- | TSTypeAliasDeclaration
- | VariableDeclaration;
-export type Expression =
- | ArrowFunctionExpression
- | AssignmentExpression
- | BinaryExpression
- | ChainExpression
- | ConditionalExpression
- | ImportExpression
- | JSXClosingElement
- | JSXClosingFragment
- | JSXExpressionContainer
- | JSXOpeningElement
- | JSXOpeningFragment
- | JSXSpreadChild
- | LogicalExpression
- | NewExpression
- | RestElement
- | SequenceExpression
- | SpreadElement
- | TSAsExpression
- | TSTypeAssertion
- | TSUnaryExpression
- | YieldExpression;
-export type ForInitialiser = Expression | VariableDeclaration;
-export type FunctionLike =
- | ArrowFunctionExpression
- | FunctionDeclaration
- | FunctionExpression
- | TSDeclareFunction
- | TSEmptyBodyFunctionExpression;
-export type ImportClause =
- | ImportDefaultSpecifier
- | ImportNamespaceSpecifier
- | ImportSpecifier;
-export type IterationStatement =
- | DoWhileStatement
- | ForInStatement
- | ForOfStatement
- | ForStatement
- | WhileStatement;
-export type JSXChild = JSXElement | JSXExpression | JSXFragment | JSXText;
-export type JSXExpression =
- | JSXEmptyExpression
- | JSXSpreadChild
- | JSXExpressionContainer;
-export type JSXTagNameExpression =
- | JSXIdentifier
- | JSXMemberExpression
- | JSXNamespacedName;
-export type LeftHandSideExpression =
- | CallExpression
- | ClassExpression
- | ClassDeclaration
- | FunctionExpression
- | LiteralExpression
- | MemberExpression
- | PrimaryExpression
- | TaggedTemplateExpression
- | TSNonNullExpression
- | TSAsExpression
- | ArrowFunctionExpression;
-export type Literal =
- | BigIntLiteral
- | BooleanLiteral
- | NumberLiteral
- | NullLiteral
- | RegExpLiteral
- | StringLiteral;
-export type LiteralExpression = Literal | TemplateLiteral;
-export type MemberExpression =
- | MemberExpressionComputedName
- | MemberExpressionNonComputedName;
-export type MethodDefinition =
- | MethodDefinitionComputedName
- | MethodDefinitionNonComputedName;
-export type Modifier =
- | TSAbstractKeyword
- | TSAsyncKeyword
- | TSPrivateKeyword
- | TSProtectedKeyword
- | TSPublicKeyword
- | TSReadonlyKeyword
- | TSStaticKeyword;
-export type ObjectLiteralElementLike =
- | MethodDefinition
- | Property
- | SpreadElement
- | TSAbstractMethodDefinition;
-export type Parameter =
- | ArrayPattern
- | AssignmentPattern
- | Identifier
- | ObjectPattern
- | RestElement
- | TSParameterProperty;
-export type PrimaryExpression =
- | ArrayExpression
- | ArrayPattern
- | ClassExpression
- | FunctionExpression
- | Identifier
- | JSXElement
- | JSXFragment
- | JSXOpeningElement
- | Literal
- | LiteralExpression
- | MetaProperty
- | ObjectExpression
- | ObjectPattern
- | Super
- | TemplateLiteral
- | ThisExpression
- | TSNullKeyword;
-/** TODO: re-align this with EStree spec in next major release */
-export type ProgramStatement = Statement;
-export type Property = PropertyComputedName | PropertyNonComputedName;
-export type PropertyName = PropertyNameComputed | PropertyNameNonComputed;
-export type PropertyNameComputed = Expression;
-export type PropertyNameNonComputed =
- | Identifier
- | StringLiteral
- | NumberLiteral;
-export type Statement =
- | BlockStatement
- | BreakStatement
- | ClassDeclaration
- | ContinueStatement
- | DebuggerStatement
- | DeclarationStatement
- | EmptyStatement
- | ExportAllDeclaration
- | ExportDefaultDeclaration
- | ExportNamedDeclaration
- | ExpressionStatement
- | IfStatement
- | IterationStatement
- | ImportDeclaration
- | LabeledStatement
- | TSDeclareFunction
- | TSEnumDeclaration
- | TSExportAssignment
- | TSImportEqualsDeclaration
- | TSInterfaceDeclaration
- | TSModuleBlock
- | TSNamespaceExportDeclaration
- | TSTypeAliasDeclaration
- | ReturnStatement
- | SwitchStatement
- | ThrowStatement
- | TryStatement
- | VariableDeclaration
- | WithStatement;
-export type TSAbstractClassProperty =
- | TSAbstractClassPropertyComputedName
- | TSAbstractClassPropertyNonComputedName;
-export type TSAbstractMethodDefinition =
- | TSAbstractMethodDefinitionComputedName
- | TSAbstractMethodDefinitionNonComputedName;
-export type TSMethodSignature =
- | TSMethodSignatureComputedName
- | TSMethodSignatureNonComputedName;
-export type TSPropertySignature =
- | TSPropertySignatureComputedName
- | TSPropertySignatureNonComputedName;
-export type TSEnumMember =
- | TSEnumMemberComputedName
- | TSEnumMemberNonComputedName;
-export type TSUnaryExpression =
- | AwaitExpression
- | LeftHandSideExpression
- | TSTypeAssertion
- | UnaryExpression
- | UpdateExpression;
-export type TypeElement =
- | TSCallSignatureDeclaration
- | TSConstructSignatureDeclaration
- | TSIndexSignature
- | TSMethodSignature
- | TSPropertySignature;
-export type TypeNode =
- | TSAnyKeyword
- | TSArrayType
- | TSBigIntKeyword
- | TSBooleanKeyword
- | TSConditionalType
- | TSConstructorType
- | TSFunctionType
- | TSImportType
- | TSIndexedAccessType
- | TSInferType
- | TSInterfaceHeritage
- | TSIntersectionType
- | TSIntrinsicKeyword
- | TSLiteralType
- | TSMappedType
- | TSNamedTupleMember
- | TSNeverKeyword
- | TSNullKeyword
- | TSNumberKeyword
- | TSObjectKeyword
- | TSOptionalType
- | TSParenthesizedType
- | TSRestType
- | TSStringKeyword
- | TSSymbolKeyword
- | TSTemplateLiteralType
- | TSThisType
- | TSTupleType
- | TSTypeLiteral
- | TSTypeOperator
- | TSTypePredicate
- | TSTypeQuery
- | TSTypeReference
- | TSUndefinedKeyword
- | TSUnionType
- | TSUnknownKeyword
- | TSVoidKeyword;
-
-///////////////
-// Base, common types
-// **Ensure you sort the interfaces alphabetically**
-///////////////
-
-interface BinaryExpressionBase extends BaseNode {
- operator: string;
- left: Expression;
- right: Expression;
-}
-
-interface CallExpressionBase extends BaseNode {
- callee: LeftHandSideExpression;
- arguments: Expression[];
- typeParameters?: TSTypeParameterInstantiation;
- optional: boolean;
-}
-
-interface ClassDeclarationBase extends BaseNode {
- typeParameters?: TSTypeParameterDeclaration;
- superTypeParameters?: TSTypeParameterInstantiation;
- id: Identifier | null;
- body: ClassBody;
- superClass: LeftHandSideExpression | null;
- implements?: TSClassImplements[];
- abstract?: boolean;
- declare?: boolean;
- decorators?: Decorator[];
-}
-
-/** this should not be directly used - instead use ClassPropertyComputedNameBase or ClassPropertyNonComputedNameBase */
-interface ClassPropertyBase extends BaseNode {
- key: PropertyName;
- value: Expression | null;
- computed: boolean;
- static: boolean;
- declare: boolean;
- readonly?: boolean;
- decorators?: Decorator[];
- accessibility?: Accessibility;
- optional?: boolean;
- definite?: boolean;
- typeAnnotation?: TSTypeAnnotation;
-}
-
-interface ClassPropertyComputedNameBase extends ClassPropertyBase {
- key: PropertyNameComputed;
- computed: true;
-}
-
-interface ClassPropertyNonComputedNameBase extends ClassPropertyBase {
- key: PropertyNameNonComputed;
- computed: false;
-}
-
-interface FunctionDeclarationBase extends BaseNode {
- id: Identifier | null;
- generator: boolean;
- expression: boolean;
- async: boolean;
- params: Parameter[];
- body?: BlockStatement | null;
- returnType?: TSTypeAnnotation;
- typeParameters?: TSTypeParameterDeclaration;
- declare?: boolean;
-}
+// augment to add the parent property, which isn't part of the spec
+declare module './ast-spec' {
+ interface BaseNode {
+ parent?: TSESTree.Node;
+ }
-interface FunctionSignatureBase extends BaseNode {
- params: Parameter[];
- returnType?: TSTypeAnnotation;
- typeParameters?: TSTypeParameterDeclaration;
-}
-
-interface LiteralBase extends BaseNode {
- raw: string;
- value: string | boolean | null | number | RegExp | bigint;
- regex?: {
- pattern: string;
- flags: string;
- };
-}
-
-/** this should not be directly used - instead use MemberExpressionComputedNameBase or MemberExpressionNonComputedNameBase */
-interface MemberExpressionBase extends BaseNode {
- object: LeftHandSideExpression;
- property: Expression | Identifier;
- computed: boolean;
- optional: boolean;
-}
-
-interface MemberExpressionComputedNameBase extends MemberExpressionBase {
- property: Expression;
- computed: true;
-}
-
-interface MemberExpressionNonComputedNameBase extends MemberExpressionBase {
- property: Identifier;
- computed: false;
-}
-
-/** this should not be directly used - instead use MethodDefinitionComputedNameBase or MethodDefinitionNonComputedNameBase */
-interface MethodDefinitionBase extends BaseNode {
- key: PropertyName;
- value: FunctionExpression | TSEmptyBodyFunctionExpression;
- computed: boolean;
- static: boolean;
- kind: 'method' | 'get' | 'set' | 'constructor';
- optional?: boolean;
- decorators?: Decorator[];
- accessibility?: Accessibility;
- typeParameters?: TSTypeParameterDeclaration;
-}
-
-interface MethodDefinitionComputedNameBase extends MethodDefinitionBase {
- key: PropertyNameComputed;
- computed: true;
-}
-
-interface MethodDefinitionNonComputedNameBase extends MethodDefinitionBase {
- key: PropertyNameNonComputed;
- computed: false;
-}
-
-interface PropertyBase extends BaseNode {
- type: AST_NODE_TYPES.Property;
- key: PropertyName;
- value:
- | Expression
- | AssignmentPattern
- | BindingName
- | TSEmptyBodyFunctionExpression;
- computed: boolean;
- method: boolean;
- shorthand: boolean;
- optional?: boolean;
- kind: 'init' | 'get' | 'set';
-}
-
-interface TSEnumMemberBase extends BaseNode {
- type: AST_NODE_TYPES.TSEnumMember;
- id:
- | PropertyNameNonComputed
- // this should only happen in semantically invalid code (ts error 1164)
- | PropertyNameComputed;
- initializer?: Expression;
- computed?: boolean;
-}
-
-interface TSHeritageBase extends BaseNode {
- expression: Expression;
- typeParameters?: TSTypeParameterInstantiation;
-}
-
-interface TSMethodSignatureBase extends BaseNode {
- type: AST_NODE_TYPES.TSMethodSignature;
- key: PropertyName;
- computed: boolean;
- params: Parameter[];
- optional?: boolean;
- returnType?: TSTypeAnnotation;
- readonly?: boolean;
- typeParameters?: TSTypeParameterDeclaration;
- accessibility?: Accessibility;
- export?: boolean;
- static?: boolean;
-}
-
-interface TSPropertySignatureBase extends BaseNode {
- type: AST_NODE_TYPES.TSPropertySignature;
- key: PropertyName;
- optional?: boolean;
- computed: boolean;
- typeAnnotation?: TSTypeAnnotation;
- initializer?: Expression;
- readonly?: boolean;
- static?: boolean;
- export?: boolean;
- accessibility?: Accessibility;
-}
-
-interface UnaryExpressionBase extends BaseNode {
- operator: string;
- prefix: boolean;
- argument: LeftHandSideExpression | Literal | UnaryExpression;
-}
-
-///////////////
-// Typescript ESTree Nodes
-// **Ensure you sort the interfaces alphabetically**
-///////////////
-
-export interface ArrayExpression extends BaseNode {
- type: AST_NODE_TYPES.ArrayExpression;
- elements: Expression[];
-}
-
-export interface ArrayPattern extends BaseNode {
- type: AST_NODE_TYPES.ArrayPattern;
- elements: (DestructuringPattern | null)[];
- typeAnnotation?: TSTypeAnnotation;
- optional?: boolean;
- decorators?: Decorator[];
-}
-
-export interface ArrowFunctionExpression extends BaseNode {
- type: AST_NODE_TYPES.ArrowFunctionExpression;
- generator: boolean;
- id: null;
- params: Parameter[];
- body: Expression | BlockStatement;
- async: boolean;
- expression: boolean;
- returnType?: TSTypeAnnotation;
- typeParameters?: TSTypeParameterDeclaration;
-}
-
-export interface AssignmentExpression extends BinaryExpressionBase {
- type: AST_NODE_TYPES.AssignmentExpression;
- operator:
- | '-='
- | '??='
- | '**='
- | '*='
- | '/='
- | '&&='
- | '&='
- | '%='
- | '^='
- | '+='
- | '<<='
- | '='
- | '>>='
- | '>>>='
- | '|='
- | '||=';
-}
-
-export interface AssignmentPattern extends BaseNode {
- type: AST_NODE_TYPES.AssignmentPattern;
- left: BindingName;
- right: Expression;
- typeAnnotation?: TSTypeAnnotation;
- optional?: boolean;
- decorators?: Decorator[];
-}
-
-export interface AwaitExpression extends BaseNode {
- type: AST_NODE_TYPES.AwaitExpression;
- argument: TSUnaryExpression;
-}
-
-export interface BigIntLiteral extends LiteralBase {
- type: AST_NODE_TYPES.Literal;
- value: bigint | null;
- bigint: string;
-}
-
-export interface BinaryExpression extends BinaryExpressionBase {
- type: AST_NODE_TYPES.BinaryExpression;
-}
-
-export interface BlockStatement extends BaseNode {
- type: AST_NODE_TYPES.BlockStatement;
- body: Statement[];
-}
-
-export interface BooleanLiteral extends LiteralBase {
- type: AST_NODE_TYPES.Literal;
- value: boolean;
-}
-
-export interface BreakStatement extends BaseNode {
- type: AST_NODE_TYPES.BreakStatement;
- label: Identifier | null;
-}
-
-export interface ChainExpression extends BaseNode {
- type: AST_NODE_TYPES.ChainExpression;
- expression: ChainElement;
-}
-
-export interface CallExpression extends CallExpressionBase {
- type: AST_NODE_TYPES.CallExpression;
-}
+ // TODO - make this change as a breaking change
+ /*
+ interface BaseNode {
+ parent: TSESTree.Node;
+ }
-export interface CatchClause extends BaseNode {
- type: AST_NODE_TYPES.CatchClause;
- param: BindingName | null;
- body: BlockStatement;
+ interface Program {
+ parent?: undefined;
+ }
+ */
}
-export interface ClassBody extends BaseNode {
- type: AST_NODE_TYPES.ClassBody;
- body: ClassElement[];
-}
-
-export interface ClassDeclaration extends ClassDeclarationBase {
- type: AST_NODE_TYPES.ClassDeclaration;
-}
-
-export interface ClassExpression extends ClassDeclarationBase {
- type: AST_NODE_TYPES.ClassExpression;
-}
-
-export interface ClassPropertyComputedName
- extends ClassPropertyComputedNameBase {
- type: AST_NODE_TYPES.ClassProperty;
-}
-
-export interface ClassPropertyNonComputedName
- extends ClassPropertyNonComputedNameBase {
- type: AST_NODE_TYPES.ClassProperty;
-}
-
-export interface ConditionalExpression extends BaseNode {
- type: AST_NODE_TYPES.ConditionalExpression;
- test: Expression;
- consequent: Expression;
- alternate: Expression;
-}
-
-export interface ContinueStatement extends BaseNode {
- type: AST_NODE_TYPES.ContinueStatement;
- label: Identifier | null;
-}
-
-export interface DebuggerStatement extends BaseNode {
- type: AST_NODE_TYPES.DebuggerStatement;
-}
-
-export interface Decorator extends BaseNode {
- type: AST_NODE_TYPES.Decorator;
- expression: LeftHandSideExpression;
-}
-
-export interface DoWhileStatement extends BaseNode {
- type: AST_NODE_TYPES.DoWhileStatement;
- test: Expression;
- body: Statement;
-}
-
-export interface EmptyStatement extends BaseNode {
- type: AST_NODE_TYPES.EmptyStatement;
-}
-
-export interface ExportAllDeclaration extends BaseNode {
- type: AST_NODE_TYPES.ExportAllDeclaration;
- source: Expression | null;
- exportKind: 'type' | 'value';
- exported: Identifier | null;
-}
-
-export interface ExportDefaultDeclaration extends BaseNode {
- type: AST_NODE_TYPES.ExportDefaultDeclaration;
- declaration: ExportDeclaration | Expression;
- exportKind: 'type' | 'value';
-}
-
-export interface ExportNamedDeclaration extends BaseNode {
- type: AST_NODE_TYPES.ExportNamedDeclaration;
- declaration: ExportDeclaration | null;
- specifiers: ExportSpecifier[];
- source: Expression | null;
- exportKind: 'type' | 'value';
-}
-
-export interface ExportSpecifier extends BaseNode {
- type: AST_NODE_TYPES.ExportSpecifier;
- local: Identifier;
- exported: Identifier;
-}
-
-export interface ExpressionStatement extends BaseNode {
- type: AST_NODE_TYPES.ExpressionStatement;
- expression: Expression;
- directive?: string;
-}
-
-export interface ForInStatement extends BaseNode {
- type: AST_NODE_TYPES.ForInStatement;
- left: ForInitialiser;
- right: Expression;
- body: Statement;
-}
-
-export interface ForOfStatement extends BaseNode {
- type: AST_NODE_TYPES.ForOfStatement;
- left: ForInitialiser;
- right: Expression;
- body: Statement;
- await: boolean;
-}
-
-export interface ForStatement extends BaseNode {
- type: AST_NODE_TYPES.ForStatement;
- init: Expression | ForInitialiser | null;
- test: Expression | null;
- update: Expression | null;
- body: Statement;
-}
-
-export interface FunctionDeclaration extends FunctionDeclarationBase {
- type: AST_NODE_TYPES.FunctionDeclaration;
- body: BlockStatement;
-}
-
-export interface FunctionExpression extends FunctionDeclarationBase {
- type: AST_NODE_TYPES.FunctionExpression;
- body: BlockStatement;
-}
-
-export interface Identifier extends BaseNode {
- type: AST_NODE_TYPES.Identifier;
- name: string;
- typeAnnotation?: TSTypeAnnotation;
- optional?: boolean;
- decorators?: Decorator[];
-}
-
-export interface IfStatement extends BaseNode {
- type: AST_NODE_TYPES.IfStatement;
- test: Expression;
- consequent: Statement;
- alternate: Statement | null;
-}
-
-export interface ImportDeclaration extends BaseNode {
- type: AST_NODE_TYPES.ImportDeclaration;
- source: Literal;
- specifiers: ImportClause[];
- importKind: 'type' | 'value';
-}
-
-export interface ImportDefaultSpecifier extends BaseNode {
- type: AST_NODE_TYPES.ImportDefaultSpecifier;
- local: Identifier;
-}
-
-export interface ImportExpression extends BaseNode {
- type: AST_NODE_TYPES.ImportExpression;
- source: Expression;
-}
-
-export interface ImportNamespaceSpecifier extends BaseNode {
- type: AST_NODE_TYPES.ImportNamespaceSpecifier;
- local: Identifier;
-}
-
-export interface ImportSpecifier extends BaseNode {
- type: AST_NODE_TYPES.ImportSpecifier;
- local: Identifier;
- imported: Identifier;
-}
-
-export interface JSXAttribute extends BaseNode {
- type: AST_NODE_TYPES.JSXAttribute;
- name: JSXIdentifier | JSXNamespacedName;
- value: Literal | JSXExpression | null;
-}
-
-export interface JSXClosingElement extends BaseNode {
- type: AST_NODE_TYPES.JSXClosingElement;
- name: JSXTagNameExpression;
-}
-
-export interface JSXClosingFragment extends BaseNode {
- type: AST_NODE_TYPES.JSXClosingFragment;
-}
-
-export interface JSXElement extends BaseNode {
- type: AST_NODE_TYPES.JSXElement;
- openingElement: JSXOpeningElement;
- closingElement: JSXClosingElement | null;
- children: JSXChild[];
-}
-
-export interface JSXEmptyExpression extends BaseNode {
- type: AST_NODE_TYPES.JSXEmptyExpression;
-}
-
-export interface JSXExpressionContainer extends BaseNode {
- type: AST_NODE_TYPES.JSXExpressionContainer;
- expression: Expression | JSXEmptyExpression;
-}
-
-export interface JSXFragment extends BaseNode {
- type: AST_NODE_TYPES.JSXFragment;
- openingFragment: JSXOpeningFragment;
- closingFragment: JSXClosingFragment;
- children: JSXChild[];
-}
-
-export interface JSXIdentifier extends BaseNode {
- type: AST_NODE_TYPES.JSXIdentifier;
- name: string;
-}
-
-export interface JSXMemberExpression extends BaseNode {
- type: AST_NODE_TYPES.JSXMemberExpression;
- object: JSXTagNameExpression;
- property: JSXIdentifier;
-}
-
-export interface JSXNamespacedName extends BaseNode {
- type: AST_NODE_TYPES.JSXNamespacedName;
- namespace: JSXIdentifier;
- name: JSXIdentifier;
-}
-
-export interface JSXOpeningElement extends BaseNode {
- type: AST_NODE_TYPES.JSXOpeningElement;
- typeParameters?: TSTypeParameterInstantiation;
- selfClosing: boolean;
- name: JSXTagNameExpression;
- attributes: (JSXAttribute | JSXSpreadAttribute)[];
-}
-
-export interface JSXOpeningFragment extends BaseNode {
- type: AST_NODE_TYPES.JSXOpeningFragment;
-}
-
-export interface JSXSpreadAttribute extends BaseNode {
- type: AST_NODE_TYPES.JSXSpreadAttribute;
- argument: Expression;
-}
-
-export interface JSXSpreadChild extends BaseNode {
- type: AST_NODE_TYPES.JSXSpreadChild;
- expression: Expression | JSXEmptyExpression;
-}
-
-export interface JSXText extends BaseNode {
- type: AST_NODE_TYPES.JSXText;
- value: string;
- raw: string;
-}
-
-export interface LabeledStatement extends BaseNode {
- type: AST_NODE_TYPES.LabeledStatement;
- label: Identifier;
- body: Statement;
-}
-
-export interface LogicalExpression extends BinaryExpressionBase {
- type: AST_NODE_TYPES.LogicalExpression;
-}
-
-export interface MemberExpressionComputedName
- extends MemberExpressionComputedNameBase {
- type: AST_NODE_TYPES.MemberExpression;
-}
-
-export interface MemberExpressionNonComputedName
- extends MemberExpressionNonComputedNameBase {
- type: AST_NODE_TYPES.MemberExpression;
-}
-
-export interface MetaProperty extends BaseNode {
- type: AST_NODE_TYPES.MetaProperty;
- meta: Identifier;
- property: Identifier;
-}
-
-export interface MethodDefinitionComputedName
- extends MethodDefinitionComputedNameBase {
- type: AST_NODE_TYPES.MethodDefinition;
-}
-
-export interface MethodDefinitionNonComputedName
- extends MethodDefinitionNonComputedNameBase {
- type: AST_NODE_TYPES.MethodDefinition;
-}
-
-export interface NewExpression extends BaseNode {
- type: AST_NODE_TYPES.NewExpression;
- callee: LeftHandSideExpression;
- arguments: Expression[];
- typeParameters?: TSTypeParameterInstantiation;
-}
-
-export interface NumberLiteral extends LiteralBase {
- type: AST_NODE_TYPES.Literal;
- value: number;
-}
-
-export interface NullLiteral extends LiteralBase {
- type: AST_NODE_TYPES.Literal;
- value: null;
-}
-
-export interface ObjectExpression extends BaseNode {
- type: AST_NODE_TYPES.ObjectExpression;
- properties: ObjectLiteralElementLike[];
-}
-
-export interface ObjectPattern extends BaseNode {
- type: AST_NODE_TYPES.ObjectPattern;
- properties: (Property | RestElement)[];
- typeAnnotation?: TSTypeAnnotation;
- optional?: boolean;
- decorators?: Decorator[];
-}
-
-export interface Program extends BaseNode {
- type: AST_NODE_TYPES.Program;
- body: Statement[];
- sourceType: 'module' | 'script';
- comments?: Comment[];
- tokens?: Token[];
-}
-
-export interface PropertyComputedName extends PropertyBase {
- key: PropertyNameComputed;
- computed: true;
-}
-
-export interface PropertyNonComputedName extends PropertyBase {
- key: PropertyNameNonComputed;
- computed: false;
-}
-
-export interface RegExpLiteral extends LiteralBase {
- type: AST_NODE_TYPES.Literal;
- value: RegExp | null;
-}
-
-export interface RestElement extends BaseNode {
- type: AST_NODE_TYPES.RestElement;
- argument: DestructuringPattern;
- typeAnnotation?: TSTypeAnnotation;
- optional?: boolean;
- value?: AssignmentPattern;
- decorators?: Decorator[];
-}
-
-export interface ReturnStatement extends BaseNode {
- type: AST_NODE_TYPES.ReturnStatement;
- argument: Expression | null;
-}
-
-export interface SequenceExpression extends BaseNode {
- type: AST_NODE_TYPES.SequenceExpression;
- expressions: Expression[];
-}
-
-export interface SpreadElement extends BaseNode {
- type: AST_NODE_TYPES.SpreadElement;
- argument: Expression;
-}
-
-export interface StringLiteral extends LiteralBase {
- type: AST_NODE_TYPES.Literal;
- value: string;
-}
-
-export interface Super extends BaseNode {
- type: AST_NODE_TYPES.Super;
-}
-
-export interface SwitchCase extends BaseNode {
- type: AST_NODE_TYPES.SwitchCase;
- test: Expression | null;
- consequent: Statement[];
-}
-
-export interface SwitchStatement extends BaseNode {
- type: AST_NODE_TYPES.SwitchStatement;
- discriminant: Expression;
- cases: SwitchCase[];
-}
-
-export interface TaggedTemplateExpression extends BaseNode {
- type: AST_NODE_TYPES.TaggedTemplateExpression;
- typeParameters?: TSTypeParameterInstantiation;
- tag: LeftHandSideExpression;
- quasi: TemplateLiteral;
-}
-
-export interface TemplateElement extends BaseNode {
- type: AST_NODE_TYPES.TemplateElement;
- value: {
- raw: string;
- cooked: string;
- };
- tail: boolean;
-}
-
-export interface TemplateLiteral extends BaseNode {
- type: AST_NODE_TYPES.TemplateLiteral;
- quasis: TemplateElement[];
- expressions: Expression[];
-}
-
-export interface ThisExpression extends BaseNode {
- type: AST_NODE_TYPES.ThisExpression;
-}
-
-export interface ThrowStatement extends BaseNode {
- type: AST_NODE_TYPES.ThrowStatement;
- argument: Statement | TSAsExpression | null;
-}
-
-export interface TryStatement extends BaseNode {
- type: AST_NODE_TYPES.TryStatement;
- block: BlockStatement;
- handler: CatchClause | null;
- finalizer: BlockStatement | null;
-}
-
-export interface TSAbstractClassPropertyComputedName
- extends ClassPropertyComputedNameBase {
- type: AST_NODE_TYPES.TSAbstractClassProperty;
-}
-
-export interface TSAbstractClassPropertyNonComputedName
- extends ClassPropertyNonComputedNameBase {
- type: AST_NODE_TYPES.TSAbstractClassProperty;
-}
-
-export interface TSAbstractKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSAbstractKeyword;
-}
-
-export interface TSAbstractMethodDefinitionComputedName
- extends MethodDefinitionComputedNameBase {
- type: AST_NODE_TYPES.TSAbstractMethodDefinition;
-}
-
-export interface TSAbstractMethodDefinitionNonComputedName
- extends MethodDefinitionNonComputedNameBase {
- type: AST_NODE_TYPES.TSAbstractMethodDefinition;
-}
-
-export interface TSAnyKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSAnyKeyword;
-}
-
-export interface TSArrayType extends BaseNode {
- type: AST_NODE_TYPES.TSArrayType;
- elementType: TypeNode;
-}
-
-export interface TSAsExpression extends BaseNode {
- type: AST_NODE_TYPES.TSAsExpression;
- expression: Expression;
- typeAnnotation: TypeNode;
-}
-
-export interface TSAsyncKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSAsyncKeyword;
-}
-
-export interface TSBigIntKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSBigIntKeyword;
-}
-
-export interface TSBooleanKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSBooleanKeyword;
-}
-
-export interface TSCallSignatureDeclaration extends FunctionSignatureBase {
- type: AST_NODE_TYPES.TSCallSignatureDeclaration;
-}
-
-export interface TSClassImplements extends TSHeritageBase {
- type: AST_NODE_TYPES.TSClassImplements;
-}
-
-export interface TSConditionalType extends BaseNode {
- type: AST_NODE_TYPES.TSConditionalType;
- checkType: TypeNode;
- extendsType: TypeNode;
- trueType: TypeNode;
- falseType: TypeNode;
-}
-
-export interface TSConstructorType extends FunctionSignatureBase {
- type: AST_NODE_TYPES.TSConstructorType;
- abstract: boolean;
-}
-
-export interface TSConstructSignatureDeclaration extends FunctionSignatureBase {
- type: AST_NODE_TYPES.TSConstructSignatureDeclaration;
-}
-
-export interface TSDeclareFunction extends FunctionDeclarationBase {
- type: AST_NODE_TYPES.TSDeclareFunction;
-}
-
-export interface TSDeclareKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSDeclareKeyword;
-}
-
-export interface TSEmptyBodyFunctionExpression extends FunctionDeclarationBase {
- type: AST_NODE_TYPES.TSEmptyBodyFunctionExpression;
- body: null;
-}
-
-export interface TSEnumDeclaration extends BaseNode {
- type: AST_NODE_TYPES.TSEnumDeclaration;
- id: Identifier;
- members: TSEnumMember[];
- const?: boolean;
- declare?: boolean;
- modifiers?: Modifier[];
-}
-
-/**
- * this should only really happen in semantically invalid code (errors 1164 and 2452)
- *
- * VALID:
- * enum Foo { ['a'] }
- *
- * INVALID:
- * const x = 'a';
- * enum Foo { [x] }
- * enum Bar { ['a' + 'b'] }
- */
-export interface TSEnumMemberComputedName extends TSEnumMemberBase {
- id: PropertyNameComputed;
- computed: true;
-}
-
-export interface TSEnumMemberNonComputedName extends TSEnumMemberBase {
- id: PropertyNameNonComputed;
- computed?: false;
-}
-
-export interface TSExportAssignment extends BaseNode {
- type: AST_NODE_TYPES.TSExportAssignment;
- expression: Expression;
-}
-
-export interface TSExportKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSExportKeyword;
-}
-
-export interface TSExternalModuleReference extends BaseNode {
- type: AST_NODE_TYPES.TSExternalModuleReference;
- expression: Expression;
-}
-
-export interface TSFunctionType extends FunctionSignatureBase {
- type: AST_NODE_TYPES.TSFunctionType;
-}
-
-export interface TSImportEqualsDeclaration extends BaseNode {
- type: AST_NODE_TYPES.TSImportEqualsDeclaration;
- id: Identifier;
- moduleReference: EntityName | TSExternalModuleReference;
- importKind: 'type' | 'value';
- isExport: boolean;
-}
-
-export interface TSImportType extends BaseNode {
- type: AST_NODE_TYPES.TSImportType;
- isTypeOf: boolean;
- parameter: TypeNode;
- qualifier: EntityName | null;
- typeParameters: TSTypeParameterInstantiation | null;
-}
-
-export interface TSIndexedAccessType extends BaseNode {
- type: AST_NODE_TYPES.TSIndexedAccessType;
- objectType: TypeNode;
- indexType: TypeNode;
-}
-
-export interface TSIndexSignature extends BaseNode {
- type: AST_NODE_TYPES.TSIndexSignature;
- parameters: Parameter[];
- typeAnnotation?: TSTypeAnnotation;
- readonly?: boolean;
- accessibility?: Accessibility;
- export?: boolean;
- static?: boolean;
-}
-
-export interface TSInferType extends BaseNode {
- type: AST_NODE_TYPES.TSInferType;
- typeParameter: TSTypeParameter;
-}
-
-export interface TSInterfaceDeclaration extends BaseNode {
- type: AST_NODE_TYPES.TSInterfaceDeclaration;
- body: TSInterfaceBody;
- id: Identifier;
- typeParameters?: TSTypeParameterDeclaration;
- extends?: TSInterfaceHeritage[];
- implements?: TSInterfaceHeritage[];
- abstract?: boolean;
- declare?: boolean;
-}
-
-export interface TSInterfaceBody extends BaseNode {
- type: AST_NODE_TYPES.TSInterfaceBody;
- body: TypeElement[];
-}
-
-export interface TSInterfaceHeritage extends TSHeritageBase {
- type: AST_NODE_TYPES.TSInterfaceHeritage;
-}
-
-export interface TSIntersectionType extends BaseNode {
- type: AST_NODE_TYPES.TSIntersectionType;
- types: TypeNode[];
-}
-
-export interface TSIntrinsicKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSIntrinsicKeyword;
-}
-
-export interface TSLiteralType extends BaseNode {
- type: AST_NODE_TYPES.TSLiteralType;
- literal: LiteralExpression | UnaryExpression | UpdateExpression;
-}
-
-export interface TSMappedType extends BaseNode {
- type: AST_NODE_TYPES.TSMappedType;
- typeParameter: TSTypeParameter;
- readonly?: boolean | '-' | '+';
- optional?: boolean | '-' | '+';
- typeAnnotation?: TypeNode;
- nameType: TypeNode | null;
-}
-
-export interface TSMethodSignatureComputedName extends TSMethodSignatureBase {
- key: PropertyNameComputed;
- computed: true;
-}
-
-export interface TSMethodSignatureNonComputedName
- extends TSMethodSignatureBase {
- key: PropertyNameNonComputed;
- computed: false;
-}
-
-export interface TSModuleBlock extends BaseNode {
- type: AST_NODE_TYPES.TSModuleBlock;
- body: Statement[];
-}
-
-export interface TSModuleDeclaration extends BaseNode {
- type: AST_NODE_TYPES.TSModuleDeclaration;
- id: Identifier | Literal;
- body?: TSModuleBlock | TSModuleDeclaration;
- global?: boolean;
- declare?: boolean;
- modifiers?: Modifier[];
-}
-
-export interface TSNamedTupleMember extends BaseNode {
- type: AST_NODE_TYPES.TSNamedTupleMember;
- elementType: TypeNode;
- label: Identifier;
- optional: boolean;
-}
-
-export interface TSNamespaceExportDeclaration extends BaseNode {
- type: AST_NODE_TYPES.TSNamespaceExportDeclaration;
- id: Identifier;
-}
-
-export interface TSNeverKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSNeverKeyword;
-}
-
-export interface TSNonNullExpression extends BaseNode {
- type: AST_NODE_TYPES.TSNonNullExpression;
- expression: Expression;
-}
-
-export interface TSNullKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSNullKeyword;
-}
-
-export interface TSNumberKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSNumberKeyword;
-}
-
-export interface TSObjectKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSObjectKeyword;
-}
-
-export interface TSOptionalType extends BaseNode {
- type: AST_NODE_TYPES.TSOptionalType;
- typeAnnotation: TypeNode;
-}
-
-export interface TSParameterProperty extends BaseNode {
- type: AST_NODE_TYPES.TSParameterProperty;
- accessibility?: Accessibility;
- readonly?: boolean;
- static?: boolean;
- export?: boolean;
- parameter: AssignmentPattern | BindingName | RestElement;
- decorators?: Decorator[];
-}
-
-export interface TSParenthesizedType extends BaseNode {
- type: AST_NODE_TYPES.TSParenthesizedType;
- typeAnnotation: TypeNode;
-}
-
-export interface TSPropertySignatureComputedName
- extends TSPropertySignatureBase {
- key: PropertyNameComputed;
- computed: true;
-}
-
-export interface TSPropertySignatureNonComputedName
- extends TSPropertySignatureBase {
- key: PropertyNameNonComputed;
- computed: false;
-}
-
-export interface TSPublicKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSPublicKeyword;
-}
-
-export interface TSPrivateKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSPrivateKeyword;
-}
-
-export interface TSProtectedKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSProtectedKeyword;
-}
-
-export interface TSQualifiedName extends BaseNode {
- type: AST_NODE_TYPES.TSQualifiedName;
- left: EntityName;
- right: Identifier;
-}
-
-export interface TSReadonlyKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSReadonlyKeyword;
-}
-
-export interface TSRestType extends BaseNode {
- type: AST_NODE_TYPES.TSRestType;
- typeAnnotation: TypeNode;
-}
-
-export interface TSStaticKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSStaticKeyword;
-}
-
-export interface TSStringKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSStringKeyword;
-}
-
-export interface TSSymbolKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSSymbolKeyword;
-}
-
-export interface TSTemplateLiteralType extends BaseNode {
- type: AST_NODE_TYPES.TSTemplateLiteralType;
- quasis: TemplateElement[];
- types: TypeNode[];
-}
-
-export interface TSThisType extends BaseNode {
- type: AST_NODE_TYPES.TSThisType;
-}
-
-export interface TSTupleType extends BaseNode {
- type: AST_NODE_TYPES.TSTupleType;
- elementTypes: TypeNode[];
-}
-
-export interface TSTypeAliasDeclaration extends BaseNode {
- type: AST_NODE_TYPES.TSTypeAliasDeclaration;
- id: Identifier;
- typeAnnotation: TypeNode;
- declare?: boolean;
- typeParameters?: TSTypeParameterDeclaration;
-}
-
-export interface TSTypeAnnotation extends BaseNode {
- type: AST_NODE_TYPES.TSTypeAnnotation;
- typeAnnotation: TypeNode;
-}
-
-export interface TSTypeAssertion extends BaseNode {
- type: AST_NODE_TYPES.TSTypeAssertion;
- typeAnnotation: TypeNode;
- expression: Expression;
-}
-
-export interface TSTypeLiteral extends BaseNode {
- type: AST_NODE_TYPES.TSTypeLiteral;
- members: TypeElement[];
-}
-
-export interface TSTypeOperator extends BaseNode {
- type: AST_NODE_TYPES.TSTypeOperator;
- operator: 'keyof' | 'unique' | 'readonly';
- typeAnnotation?: TypeNode;
-}
-
-export interface TSTypeParameter extends BaseNode {
- type: AST_NODE_TYPES.TSTypeParameter;
- name: Identifier;
- constraint?: TypeNode;
- default?: TypeNode;
-}
-
-export interface TSTypeParameterDeclaration extends BaseNode {
- type: AST_NODE_TYPES.TSTypeParameterDeclaration;
- params: TSTypeParameter[];
-}
-
-export interface TSTypeParameterInstantiation extends BaseNode {
- type: AST_NODE_TYPES.TSTypeParameterInstantiation;
- params: TypeNode[];
-}
-
-export interface TSTypePredicate extends BaseNode {
- type: AST_NODE_TYPES.TSTypePredicate;
- asserts: boolean;
- parameterName: Identifier | TSThisType;
- typeAnnotation: TSTypeAnnotation | null;
-}
-
-export interface TSTypeQuery extends BaseNode {
- type: AST_NODE_TYPES.TSTypeQuery;
- exprName: EntityName;
-}
-
-export interface TSTypeReference extends BaseNode {
- type: AST_NODE_TYPES.TSTypeReference;
- typeName: EntityName;
- typeParameters?: TSTypeParameterInstantiation;
-}
-
-export interface TSUndefinedKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSUndefinedKeyword;
-}
-
-export interface TSUnionType extends BaseNode {
- type: AST_NODE_TYPES.TSUnionType;
- types: TypeNode[];
-}
-
-export interface TSUnknownKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSUnknownKeyword;
-}
-
-export interface TSVoidKeyword extends BaseNode {
- type: AST_NODE_TYPES.TSVoidKeyword;
-}
-
-export interface UpdateExpression extends UnaryExpressionBase {
- type: AST_NODE_TYPES.UpdateExpression;
- operator: '++' | '--';
-}
-
-export interface UnaryExpression extends UnaryExpressionBase {
- type: AST_NODE_TYPES.UnaryExpression;
- operator: '+' | '-' | '!' | '~' | 'delete' | 'void' | 'typeof';
-}
-
-export interface VariableDeclaration extends BaseNode {
- type: AST_NODE_TYPES.VariableDeclaration;
- // NOTE - this is not guaranteed to have any elements in it. i.e. `const;`
- declarations: VariableDeclarator[];
- kind: 'let' | 'const' | 'var';
- declare?: boolean;
-}
-
-export interface VariableDeclarator extends BaseNode {
- type: AST_NODE_TYPES.VariableDeclarator;
- id: BindingName;
- init: Expression | null;
- definite?: boolean;
-}
-
-export interface WhileStatement extends BaseNode {
- type: AST_NODE_TYPES.WhileStatement;
- test: Expression;
- body: Statement;
-}
-
-export interface WithStatement extends BaseNode {
- type: AST_NODE_TYPES.WithStatement;
- object: Expression;
- body: Statement;
-}
-
-export interface YieldExpression extends BaseNode {
- type: AST_NODE_TYPES.YieldExpression;
- delegate: boolean;
- argument?: Expression;
-}
+export * as TSESTree from './ast-spec';
diff --git a/packages/types/tools/copy-ast-spec.ts b/packages/types/tools/copy-ast-spec.ts
new file mode 100644
index 000000000000..ed231195eeb4
--- /dev/null
+++ b/packages/types/tools/copy-ast-spec.ts
@@ -0,0 +1,59 @@
+import chlidProcess from 'child_process';
+import fs from 'fs';
+import path from 'path';
+import { promisify } from 'util';
+
+const readFile = promisify(fs.readFile);
+const writeFile = promisify(fs.writeFile);
+const execAsync = promisify(chlidProcess.exec);
+
+const AST_SPEC_PATH = path.resolve(__dirname, '../../ast-spec');
+const OUTPUT_PATH = path.join(path.resolve(__dirname, '../src/'));
+
+// ensure the package is built
+chlidProcess.execSync('yarn build', { cwd: AST_SPEC_PATH });
+
+const HEADER = `\
+/**********************************************
+ * DO NOT MODIFY THIS FILE MANUALLY *
+ * *
+ * THIS FILE HAS BEEN COPIED FROM ast-spec. *
+ * ANY CHANGES WILL BE LOST ON THE NEXT BUILD *
+ * *
+ * MAKE CHANGES TO ast-spec AND THEN RUN *
+ * yarn build *
+ **********************************************/
+
+`;
+
+async function copyFile(
+ folderName: string,
+ fileName: string,
+ transformer: (code: string) => string = (s): string => s,
+): Promise {
+ const code = await readFile(
+ path.join(AST_SPEC_PATH, folderName, fileName),
+ 'utf-8',
+ );
+
+ const transformedCode = transformer(code);
+
+ const outpath = path.join(OUTPUT_PATH, fileName);
+ await writeFile(outpath, HEADER + transformedCode, {
+ encoding: 'utf-8',
+ });
+
+ await execAsync(`yarn prettier --write ${outpath}`);
+
+ console.log('Copied', fileName);
+}
+
+async function main(): Promise {
+ await Promise.all([
+ copyFile('dist', 'ast-spec.ts', code =>
+ code.replace(/export declare enum/g, 'export enum'),
+ ),
+ ]);
+}
+
+void main();
diff --git a/packages/types/tsconfig.build.json b/packages/types/tsconfig.build.json
index 215a0282df2b..b9ac3e1b9770 100644
--- a/packages/types/tsconfig.build.json
+++ b/packages/types/tsconfig.build.json
@@ -6,5 +6,6 @@
"rootDir": "./src",
"resolveJsonModule": true
},
- "include": ["src", "typings"]
+ "include": ["src", "typings"],
+ "references": []
}
diff --git a/packages/types/tsconfig.json b/packages/types/tsconfig.json
index 9cea515ba6b2..d1305674c8bb 100644
--- a/packages/types/tsconfig.json
+++ b/packages/types/tsconfig.json
@@ -4,5 +4,6 @@
"composite": false,
"rootDir": "."
},
- "include": ["src", "typings", "tests", "tools"]
+ "include": ["src", "typings", "tests", "tools"],
+ "references": []
}
diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md
index e6363f7ae2da..6f3659179752 100644
--- a/packages/typescript-estree/CHANGELOG.md
+++ b/packages/typescript-estree/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Features
+
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/typescript-estree
diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json
index 4f65000f6bc6..4a3f520faed9 100644
--- a/packages/typescript-estree/package.json
+++ b/packages/typescript-estree/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/typescript-estree",
- "version": "4.22.1",
+ "version": "4.23.0",
"description": "A parser that converts TypeScript source code into an ESTree compatible form",
"main": "dist/index.js",
"types": "dist/index.d.ts",
@@ -34,15 +34,15 @@
"build": "tsc -b tsconfig.build.json",
"postbuild": "downlevel-dts dist _ts3.4/dist",
"clean": "tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist",
+ "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
"test": "jest --coverage",
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/types": "4.22.1",
- "@typescript-eslint/visitor-keys": "4.22.1",
+ "@typescript-eslint/types": "4.23.0",
+ "@typescript-eslint/visitor-keys": "4.23.0",
"debug": "^4.1.1",
"globby": "^11.0.1",
"is-glob": "^4.0.1",
@@ -59,7 +59,7 @@
"@types/is-glob": "*",
"@types/semver": "*",
"@types/tmp": "*",
- "@typescript-eslint/shared-fixtures": "4.22.1",
+ "@typescript-eslint/shared-fixtures": "4.23.0",
"glob": "*",
"jest-specific-snapshot": "*",
"make-dir": "*",
diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts
index e0c34e513ec9..aad29f9b1467 100644
--- a/packages/typescript-estree/src/convert.ts
+++ b/packages/typescript-estree/src/convert.ts
@@ -1987,7 +1987,7 @@ export class Converter {
let regex = null;
try {
regex = new RegExp(pattern, flags);
- } catch (exception) {
+ } catch (exception: unknown) {
regex = null;
}
@@ -2166,7 +2166,7 @@ export class Converter {
range: [start, end],
});
} else {
- return this.createNode(node, {
+ return this.createNode(node, {
type: AST_NODE_TYPES.Literal,
value: unescapeStringLiteralText(text),
raw: text,
diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md
index 29bc084e5c5d..ee37f1a8cc19 100644
--- a/packages/visitor-keys/CHANGELOG.md
+++ b/packages/visitor-keys/CHANGELOG.md
@@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
+# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10)
+
+
+### Features
+
+* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf))
+
+
+
+
+
## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04)
**Note:** Version bump only for package @typescript-eslint/visitor-keys
diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json
index 594ca4ce55b1..018dd006a0cb 100644
--- a/packages/visitor-keys/package.json
+++ b/packages/visitor-keys/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/visitor-keys",
- "version": "4.22.1",
+ "version": "4.23.0",
"description": "Visitor keys used to help traverse the TypeScript-ESTree AST",
"keywords": [
"eslint",
@@ -31,14 +31,14 @@
"build": "tsc -b tsconfig.build.json",
"postbuild": "downlevel-dts dist _ts3.4/dist",
"clean": "tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist",
+ "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore",
"lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'",
"test": "jest --coverage",
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
- "@typescript-eslint/types": "4.22.1",
+ "@typescript-eslint/types": "4.23.0",
"eslint-visitor-keys": "^2.0.0"
},
"devDependencies": {
diff --git a/tests/integration/docker-compose.yml b/tests/integration/docker-compose.yml
index abe82a67cfb6..b1df8c206699 100644
--- a/tests/integration/docker-compose.yml
+++ b/tests/integration/docker-compose.yml
@@ -22,9 +22,11 @@ services:
- ../../packages/types/:/usr/types
- /usr/types/tests
- ../../packages/visitor-keys/:/usr/visitor-keys
- - /usr/types/visitor-keys
+ - /usr/visitor-keys/tests
- ../../packages/scope-manager/:/usr/scope-manager
- - /usr/types/scope-manager
+ - /usr/scope-manager/tests
+ - ../../packages/ast-spec/:/usr/ast-spec
+ - /usr/ast-spec/tests
# Runtime link to all the specific integration test files, so that most updates don't require a rebuild.
- ./fixtures/typescript-and-tslint-plugins-together:/usr/linked
@@ -47,9 +49,11 @@ services:
- ../../packages/types/:/usr/types
- /usr/types/tests
- ../../packages/visitor-keys/:/usr/visitor-keys
- - /usr/types/visitor-keys
+ - /usr/visitor-keys/tests
- ../../packages/scope-manager/:/usr/scope-manager
- - /usr/types/scope-manager
+ - /usr/scope-manager/tests
+ - ../../packages/ast-spec/:/usr/ast-spec
+ - /usr/ast-spec/tests
# Runtime link to all the specific integration test files, so that most updates don't require a rebuild.
- ./fixtures/vue-sfc:/usr/linked
@@ -72,9 +76,11 @@ services:
- ../../packages/types/:/usr/types
- /usr/types/tests
- ../../packages/visitor-keys/:/usr/visitor-keys
- - /usr/types/visitor-keys
+ - /usr/visitor-keys/tests
- ../../packages/scope-manager/:/usr/scope-manager
- - /usr/types/scope-manager
+ - /usr/scope-manager/tests
+ - ../../packages/ast-spec/:/usr/ast-spec
+ - /usr/ast-spec/tests
# Runtime link to all the specific integration test files, so that most updates don't require a rebuild.
- ./fixtures/vue-jsx:/usr/linked
@@ -97,9 +103,11 @@ services:
- ../../packages/types/:/usr/types
- /usr/types/tests
- ../../packages/visitor-keys/:/usr/visitor-keys
- - /usr/types/visitor-keys
+ - /usr/visitor-keys/tests
- ../../packages/scope-manager/:/usr/scope-manager
- - /usr/types/scope-manager
+ - /usr/scope-manager/tests
+ - ../../packages/ast-spec/:/usr/ast-spec
+ - /usr/ast-spec/tests
# Runtime link to all the specific integration test files, so that most updates don't require a rebuild.
- ./fixtures/recommended-does-not-require-program:/usr/linked
@@ -122,9 +130,11 @@ services:
- ../../packages/types/:/usr/types
- /usr/types/tests
- ../../packages/visitor-keys/:/usr/visitor-keys
- - /usr/types/visitor-keys
+ - /usr/visitor-keys/tests
- ../../packages/scope-manager/:/usr/scope-manager
- - /usr/types/scope-manager
+ - /usr/scope-manager/tests
+ - ../../packages/ast-spec/:/usr/ast-spec
+ - /usr/ast-spec/tests
# Runtime link to all the specific integration test files, so that most updates don't require a rebuild.
- ./fixtures/markdown:/usr/linked
@@ -147,8 +157,10 @@ services:
- ../../packages/types/:/usr/types
- /usr/types/tests
- ../../packages/visitor-keys/:/usr/visitor-keys
- - /usr/types/visitor-keys
+ - /usr/visitor-keys/tests
- ../../packages/scope-manager/:/usr/scope-manager
- - /usr/types/scope-manager
+ - /usr/scope-manager/tests
+ - ../../packages/ast-spec/:/usr/ast-spec
+ - /usr/ast-spec/tests
# Runtime link to all the specific integration test files, so that most updates don't require a rebuild.
- ./fixtures/eslint-v6:/usr/linked
diff --git a/tests/integration/fixtures/eslint-v6/test.sh b/tests/integration/fixtures/eslint-v6/test.sh
index ab184f9ceb15..e2c988854164 100755
--- a/tests/integration/fixtures/eslint-v6/test.sh
+++ b/tests/integration/fixtures/eslint-v6/test.sh
@@ -9,6 +9,7 @@ npm install
npm install eslint@6.0.0
# Use the local volumes for our own packages
+npm install $(npm pack /usr/ast-spec | tail -1)
npm install $(npm pack /usr/types | tail -1)
npm install $(npm pack /usr/visitor-keys | tail -1)
npm install $(npm pack /usr/scope-manager | tail -1)
diff --git a/tests/integration/fixtures/markdown/test.sh b/tests/integration/fixtures/markdown/test.sh
index 30cd435eaac7..91e4c4f0a045 100755
--- a/tests/integration/fixtures/markdown/test.sh
+++ b/tests/integration/fixtures/markdown/test.sh
@@ -8,6 +8,7 @@ node /usr/utils/generate-package-json.js
npm install
# Use the local volumes for our own packages
+npm install $(npm pack /usr/ast-spec | tail -1)
npm install $(npm pack /usr/types | tail -1)
npm install $(npm pack /usr/visitor-keys | tail -1)
npm install $(npm pack /usr/scope-manager | tail -1)
diff --git a/tests/integration/fixtures/recommended-does-not-require-program/test.sh b/tests/integration/fixtures/recommended-does-not-require-program/test.sh
index cfe4d0e6d570..ea25b6d7292d 100755
--- a/tests/integration/fixtures/recommended-does-not-require-program/test.sh
+++ b/tests/integration/fixtures/recommended-does-not-require-program/test.sh
@@ -8,6 +8,7 @@ node /usr/utils/generate-package-json.js
npm install
# Use the local volumes for our own packages
+npm install $(npm pack /usr/ast-spec | tail -1)
npm install $(npm pack /usr/types | tail -1)
npm install $(npm pack /usr/visitor-keys | tail -1)
npm install $(npm pack /usr/scope-manager | tail -1)
diff --git a/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.sh b/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.sh
index 6abbeb42aa61..27c243e38081 100755
--- a/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.sh
+++ b/tests/integration/fixtures/typescript-and-tslint-plugins-together/test.sh
@@ -8,6 +8,7 @@ node /usr/utils/generate-package-json.js
npm install
# Use the local volumes for our own packages
+npm install $(npm pack /usr/ast-spec | tail -1)
npm install $(npm pack /usr/types | tail -1)
npm install $(npm pack /usr/visitor-keys | tail -1)
npm install $(npm pack /usr/scope-manager | tail -1)
diff --git a/tests/integration/fixtures/vue-jsx/test.sh b/tests/integration/fixtures/vue-jsx/test.sh
index 96376fb0f83c..fc41933a87ec 100755
--- a/tests/integration/fixtures/vue-jsx/test.sh
+++ b/tests/integration/fixtures/vue-jsx/test.sh
@@ -8,6 +8,7 @@ node /usr/utils/generate-package-json.js
npm install
# Use the local volumes for our own packages
+npm install $(npm pack /usr/ast-spec | tail -1)
npm install $(npm pack /usr/types | tail -1)
npm install $(npm pack /usr/visitor-keys | tail -1)
npm install $(npm pack /usr/scope-manager | tail -1)
diff --git a/tests/integration/fixtures/vue-sfc/test.sh b/tests/integration/fixtures/vue-sfc/test.sh
index 80f7cfe4adf4..e22a51a62c62 100755
--- a/tests/integration/fixtures/vue-sfc/test.sh
+++ b/tests/integration/fixtures/vue-sfc/test.sh
@@ -8,6 +8,7 @@ node /usr/utils/generate-package-json.js
npm install
# Use the local volumes for our own packages
+npm install $(npm pack /usr/ast-spec | tail -1)
npm install $(npm pack /usr/types | tail -1)
npm install $(npm pack /usr/visitor-keys | tail -1)
npm install $(npm pack /usr/scope-manager | tail -1)
diff --git a/yarn.lock b/yarn.lock
index 6d63f30fdd4b..3f720199bc2c 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -143,10 +143,10 @@
dependencies:
"@babel/types" "^7.12.13"
-"@babel/helper-validator-identifier@^7.12.11":
- version "7.12.11"
- resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz#c9a1f021917dcb5ccf0d4e453e399022981fc9ed"
- integrity sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==
+"@babel/helper-validator-identifier@^7.12.11", "@babel/helper-validator-identifier@^7.14.0":
+ version "7.14.0"
+ resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288"
+ integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==
"@babel/helper-validator-option@^7.12.17":
version "7.12.17"
@@ -292,12 +292,11 @@
lodash "^4.17.19"
"@babel/types@^7.0.0", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3":
- version "7.13.14"
- resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.13.14.tgz#c35a4abb15c7cd45a2746d78ab328e362cbace0d"
- integrity sha512-A2aa3QTkWoyqsZZFl56MLUsfmh7O0gN41IPvXAE/++8ojpbz12SszD7JEGYVdn4f9Kt4amIei07swF1h4AqmmQ==
+ version "7.14.1"
+ resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.1.tgz#095bd12f1c08ab63eff6e8f7745fa7c9cc15a9db"
+ integrity sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==
dependencies:
- "@babel/helper-validator-identifier" "^7.12.11"
- lodash "^4.17.19"
+ "@babel/helper-validator-identifier" "^7.14.0"
to-fast-properties "^2.0.0"
"@bcoe/v8-coverage@^0.2.3":
@@ -1638,6 +1637,36 @@
npmlog "^4.1.2"
write-file-atomic "^2.3.0"
+"@microsoft/api-extractor-model@7.12.2":
+ version "7.12.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.12.2.tgz#d48b35e8ed20643b1c19d7a4f80c90c42dc7d1d8"
+ integrity sha512-EU+U09Mj65zUH0qwPF4PFJiL6Y+PQQE/RRGEHEDGJJzab/mRQDpKOyrzSdb00xvcd/URehIHJqC55cY2Y4jGOA==
+ dependencies:
+ "@microsoft/tsdoc" "0.12.24"
+ "@rushstack/node-core-library" "3.36.0"
+
+"@microsoft/api-extractor@^7.13.2":
+ version "7.13.2"
+ resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.13.2.tgz#c44762d27aee05c4da16c03fc8786bd0fa31c7eb"
+ integrity sha512-2fD0c8OxZW+e6NTaxbtrdNxXVuX7aqil3+cqig3pKsHymvUuRJVCEAcAJmZrJ/ENqYXNiB265EyqOT6VxbMysw==
+ dependencies:
+ "@microsoft/api-extractor-model" "7.12.2"
+ "@microsoft/tsdoc" "0.12.24"
+ "@rushstack/node-core-library" "3.36.0"
+ "@rushstack/rig-package" "0.2.10"
+ "@rushstack/ts-command-line" "4.7.8"
+ colors "~1.2.1"
+ lodash "~4.17.15"
+ resolve "~1.17.0"
+ semver "~7.3.0"
+ source-map "~0.6.1"
+ typescript "~4.1.3"
+
+"@microsoft/tsdoc@0.12.24":
+ version "0.12.24"
+ resolved "https://registry.yarnpkg.com/@microsoft/tsdoc/-/tsdoc-0.12.24.tgz#30728e34ebc90351dd3aff4e18d038eed2c3e098"
+ integrity sha512-Mfmij13RUTmHEMi9vRUhMXD7rnGR2VvxeNYtaGtaJ4redwwjT4UXYJ+nzmVJF7hhd4pn/Fx5sncDKxMVFJSWPg==
+
"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
resolved "https://registry.yarnpkg.com/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz#524af240d1a360527b730475ecfa1344aa540dde"
@@ -1781,6 +1810,39 @@
dependencies:
"@types/node" ">= 8"
+"@rushstack/node-core-library@3.36.0":
+ version "3.36.0"
+ resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.36.0.tgz#95dace39d763c8695d6607c421f95c6ac65b0ed4"
+ integrity sha512-bID2vzXpg8zweXdXgQkKToEdZwVrVCN9vE9viTRk58gqzYaTlz4fMId6V3ZfpXN6H0d319uGi2KDlm+lUEeqCg==
+ dependencies:
+ "@types/node" "10.17.13"
+ colors "~1.2.1"
+ fs-extra "~7.0.1"
+ import-lazy "~4.0.0"
+ jju "~1.4.0"
+ resolve "~1.17.0"
+ semver "~7.3.0"
+ timsort "~0.3.0"
+ z-schema "~3.18.3"
+
+"@rushstack/rig-package@0.2.10":
+ version "0.2.10"
+ resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.2.10.tgz#e861eb94953d8c22c509dc3e9d91d6f337eab3cd"
+ integrity sha512-WXYerEJEPf8bS3ruqfM57NnwXtA7ehn8VJjLjrjls6eSduE5CRydcob/oBTzlHKsQ7N196XKlqQl9P6qIyYG2A==
+ dependencies:
+ resolve "~1.17.0"
+ strip-json-comments "~3.1.1"
+
+"@rushstack/ts-command-line@4.7.8":
+ version "4.7.8"
+ resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.7.8.tgz#3aa77cf544c571be3206fc2bcba20c7a096ed254"
+ integrity sha512-8ghIWhkph7NnLCMDJtthpsb7TMOsVGXVDvmxjE/CeklTqjbbUFBjGXizJfpbEkRQTELuZQ2+vGn7sGwIWKN2uA==
+ dependencies:
+ "@types/argparse" "1.0.38"
+ argparse "~1.0.9"
+ colors "~1.2.1"
+ string-argv "~0.3.1"
+
"@sinonjs/commons@^1.7.0":
version "1.8.2"
resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.2.tgz#858f5c4b48d80778fde4b9d541f27edc0d56488b"
@@ -1795,6 +1857,11 @@
dependencies:
"@sinonjs/commons" "^1.7.0"
+"@types/argparse@1.0.38":
+ version "1.0.38"
+ resolved "https://registry.yarnpkg.com/@types/argparse/-/argparse-1.0.38.tgz#a81fd8606d481f873a3800c6ebae4f1d768a56a9"
+ integrity sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==
+
"@types/babel__code-frame@*", "@types/babel__code-frame@^7.0.2":
version "7.0.2"
resolved "https://registry.yarnpkg.com/@types/babel__code-frame/-/babel__code-frame-7.0.2.tgz#e0c0f1648cbc09a9d4e5b4ed2ae9a6f7c8f5aeb0"
@@ -1940,10 +2007,15 @@
"@types/node" "*"
form-data "^3.0.0"
-"@types/node@*", "@types/node@>= 8", "@types/node@^14.14.27":
- version "14.14.41"
- resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.41.tgz#d0b939d94c1d7bd53d04824af45f1139b8c45615"
- integrity sha512-dueRKfaJL4RTtSa7bWeTK1M+VH+Gns73oCgzvYfHZywRCoPSd8EkXBL0mZ9unPTveBn+D9phZBaxuzpwjWkW0g==
+"@types/node@*", "@types/node@>= 8", "@types/node@^15.0.2":
+ version "15.0.2"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-15.0.2.tgz#51e9c0920d1b45936ea04341aa3e2e58d339fb67"
+ integrity sha512-p68+a+KoxpoB47015IeYZYRrdqMUcpbK8re/zpFB8Ld46LHC1lPEbp3EXgkEhAYEcPvjJF6ZO+869SQ0aH1dcA==
+
+"@types/node@10.17.13":
+ version "10.17.13"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-10.17.13.tgz#ccebcdb990bd6139cd16e84c39dc2fb1023ca90c"
+ integrity sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg==
"@types/normalize-package-data@^2.4.0":
version "2.4.0"
@@ -2206,7 +2278,7 @@ arg@^4.1.0:
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
-argparse@^1.0.7:
+argparse@^1.0.7, argparse@~1.0.9:
version "1.0.10"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
@@ -2861,6 +2933,11 @@ colorette@^1.2.1:
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.1.tgz#4d0b921325c14faf92633086a536db6e89564b1b"
integrity sha512-puCDz0CzydiSYOrnXpz/PKd69zRrribezjtE9yd4zvytoRc8+RY/KJPvtPFKZS3E3wP6neGyMe0vOTlHO5L3Pw==
+colors@~1.2.1:
+ version "1.2.5"
+ resolved "https://registry.yarnpkg.com/colors/-/colors-1.2.5.tgz#89c7ad9a374bc030df8013241f68136ed8835afc"
+ integrity sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==
+
columnify@^1.5.4:
version "1.5.4"
resolved "https://registry.yarnpkg.com/columnify/-/columnify-1.5.4.tgz#4737ddf1c7b69a8a7c340570782e947eec8e78bb"
@@ -2876,7 +2953,7 @@ combined-stream@^1.0.6, combined-stream@^1.0.8, combined-stream@~1.0.6:
dependencies:
delayed-stream "~1.0.0"
-commander@^2.12.1:
+commander@^2.12.1, commander@^2.7.1:
version "2.20.3"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==
@@ -3756,12 +3833,17 @@ eslint-plugin-import@^2.22.0:
tsconfig-paths "^3.9.0"
eslint-plugin-jest@^24.1.3:
- version "24.3.5"
- resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.3.5.tgz#71f0b580f87915695c286c3f0eb88cf23664d044"
- integrity sha512-XG4rtxYDuJykuqhsOqokYIR84/C8pRihRtEpVskYLbIIKGwPNW2ySxdctuVzETZE+MbF/e7wmsnbNVpzM0rDug==
+ version "24.3.6"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-24.3.6.tgz#5f0ca019183c3188c5ad3af8e80b41de6c8e9173"
+ integrity sha512-WOVH4TIaBLIeCX576rLcOgjNXqP+jNlCiEmRgFTfQtJ52DpwnIQKAVGlGPAN7CZ33bW6eNfHD6s8ZbEUTQubJg==
dependencies:
"@typescript-eslint/experimental-utils" "^4.0.1"
+eslint-plugin-simple-import-sort@^7.0.0:
+ version "7.0.0"
+ resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz#a1dad262f46d2184a90095a60c66fef74727f0f8"
+ integrity sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw==
+
eslint-scope@^5.0.0, eslint-scope@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
@@ -4241,6 +4323,15 @@ fs-extra@^9.0.0, fs-extra@^9.1.0:
jsonfile "^6.0.1"
universalify "^2.0.0"
+fs-extra@~7.0.1:
+ version "7.0.1"
+ resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
+ integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
+ dependencies:
+ graceful-fs "^4.1.2"
+ jsonfile "^4.0.0"
+ universalify "^0.1.0"
+
fs-minipass@^1.2.5:
version "1.2.7"
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7"
@@ -4654,9 +4745,9 @@ homedir-polyfill@^1.0.1:
parse-passwd "^1.0.0"
hosted-git-info@^2.1.4, hosted-git-info@^2.7.1:
- version "2.8.8"
- resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.8.tgz#7539bd4bc1e0e0a895815a2e0262420b12858488"
- integrity sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==
+ version "2.8.9"
+ resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9"
+ integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==
html-encoding-sniffer@^2.0.1:
version "2.0.1"
@@ -4776,6 +4867,11 @@ import-from@3.0.0:
dependencies:
resolve-from "^5.0.0"
+import-lazy@~4.0.0:
+ version "4.0.0"
+ resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-4.0.0.tgz#e8eb627483a0a43da3c03f3e35548be5cb0cc153"
+ integrity sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==
+
import-local@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d"
@@ -5619,6 +5715,11 @@ jest@^26.6.3:
import-local "^3.0.2"
jest-cli "^26.6.3"
+jju@~1.4.0:
+ version "1.4.0"
+ resolved "https://registry.yarnpkg.com/jju/-/jju-1.4.0.tgz#a3abe2718af241a2b2904f84a625970f389ae32a"
+ integrity sha1-o6vicYryQaKykE+EpiWXDzia4yo=
+
js-tokens@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
@@ -5989,11 +6090,16 @@ lodash.flatten@~4.4.0:
resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=
-lodash.get@^4.4.2:
+lodash.get@^4.0.0, lodash.get@^4.4.2:
version "4.4.2"
resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99"
integrity sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=
+lodash.isequal@^4.0.0:
+ version "4.5.0"
+ resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"
+ integrity sha1-QVxEePK8wwEgwizhDtMib30+GOA=
+
lodash.ismatch@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37"
@@ -6034,7 +6140,7 @@ lodash.uniq@^4.5.0:
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=
-lodash@4.x, lodash@^4.11.2, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.2.1:
+lodash@4.x, lodash@^4.11.2, lodash@^4.17.12, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.2.1, lodash@~4.17.15:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@@ -7664,6 +7770,13 @@ resolve@^1.1.6, resolve@^1.10.0, resolve@^1.13.1, resolve@^1.17.0, resolve@^1.18
is-core-module "^2.1.0"
path-parse "^1.0.6"
+resolve@~1.17.0:
+ version "1.17.0"
+ resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.17.0.tgz#b25941b54968231cc2d1bb76a79cb7f2c0bf8444"
+ integrity sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==
+ dependencies:
+ path-parse "^1.0.6"
+
restore-cursor@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"
@@ -7792,7 +7905,7 @@ semver-compare@^1.0.0:
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==
-semver@7.3.5, semver@7.x, semver@^7.2.1, semver@^7.3.2:
+semver@7.3.5, semver@7.x, semver@^7.2.1, semver@^7.3.2, semver@~7.3.0:
version "7.3.5"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
@@ -8111,7 +8224,7 @@ stream-shift@^1.0.0:
resolved "https://registry.yarnpkg.com/stream-shift/-/stream-shift-1.0.1.tgz#d7088281559ab2778424279b0877da3c392d5a3d"
integrity sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==
-string-argv@0.3.1:
+string-argv@0.3.1, string-argv@~0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/string-argv/-/string-argv-0.3.1.tgz#95e2fbec0427ae19184935f816d74aaa4c5c19da"
integrity sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==
@@ -8277,7 +8390,7 @@ strip-json-comments@3.0.1:
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.0.1.tgz#85713975a91fb87bf1b305cca77395e40d2a64a7"
integrity sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==
-strip-json-comments@^3.1.0, strip-json-comments@^3.1.1:
+strip-json-comments@^3.1.0, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==
@@ -8430,6 +8543,11 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6, through@^2.3.8:
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=
+timsort@~0.3.0:
+ version "0.3.0"
+ resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4"
+ integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=
+
tmp@^0.0.33:
version "0.0.33"
resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"
@@ -8681,7 +8799,7 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
-typescript@*, typescript@4.2.2, "typescript@>=3.3.1 <4.3.0", typescript@^4.1.0-dev.20201026:
+typescript@*, typescript@4.2.2, "typescript@>=3.3.1 <4.3.0", typescript@^4.1.0-dev.20201026, typescript@~4.1.3:
version "4.2.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.2.tgz#1450f020618f872db0ea17317d16d8da8ddb8c4c"
integrity sha512-tbb+NVrLfnsJy3M59lsDgrzWIflR4d4TIUjz+heUnHZwdF7YsrMTKoRERiIvI2lvBG95dfpLxB21WZhys1bgaQ==
@@ -8845,6 +8963,11 @@ validate-npm-package-name@^3.0.0:
dependencies:
builtins "^1.0.3"
+validator@^8.0.0:
+ version "8.2.0"
+ resolved "https://registry.yarnpkg.com/validator/-/validator-8.2.0.tgz#3c1237290e37092355344fef78c231249dab77b9"
+ integrity sha512-Yw5wW34fSv5spzTXNkokD6S6/Oq92d8q/t14TqsS3fAiA1RYnxSFSIZ+CY3n6PGGRCq5HhJTSepQvFUS2QUDxA==
+
verror@1.10.0:
version "1.10.0"
resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"
@@ -9185,3 +9308,14 @@ yocto-queue@^0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
+
+z-schema@~3.18.3:
+ version "3.18.4"
+ resolved "https://registry.yarnpkg.com/z-schema/-/z-schema-3.18.4.tgz#ea8132b279533ee60be2485a02f7e3e42541a9a2"
+ integrity sha512-DUOKC/IhbkdLKKiV89gw9DUauTV8U/8yJl1sjf6MtDmzevLKOF2duNJ495S3MFVjqZarr+qNGCPbkg4mu4PpLw==
+ dependencies:
+ lodash.get "^4.0.0"
+ lodash.isequal "^4.0.0"
+ validator "^8.0.0"
+ optionalDependencies:
+ commander "^2.7.1"