diff --git a/.cspell.json b/.cspell.json
index ec67987a3b5a..91dc7f910d0f 100644
--- a/.cspell.json
+++ b/.cspell.json
@@ -15,7 +15,6 @@
".vscode/*.json",
"**/*.{json,snap}",
"**/**/CHANGELOG.md",
- "**/**/CONTRIBUTORS.md",
"**/**/TSLINT_RULE_ALTERNATIVES.md",
"**/coverage/**",
"**/dist/**",
@@ -47,6 +46,7 @@
"\\(#.+?\\)"
],
"words": [
+ "AFAICT",
"Airbnb",
"Airbnb's",
"allowdefaultproject",
@@ -150,6 +150,7 @@
"oxlint",
"packagespecifier",
"parameterised",
+ "parenthesization",
"performant",
"pluggable",
"postprocess",
@@ -196,6 +197,7 @@
"tsconfigrootdir",
"tsconfigs",
"tseslint",
+ "tsgo",
"tsvfs",
"typedef",
"typedefs",
diff --git a/.gitattributes b/.gitattributes
index b94bd55a2808..8090a19ef303 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,6 +1,4 @@
* text=auto eol=lf
-# force github to treat out custom jest snapshot extension as normal jest snapshots
-*.shot linguist-language=Jest-Snapshot
*.shot linguist-generated
packages/scope-manager/src/lib/**/* linguist-generated
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
new file mode 100644
index 000000000000..a1eb95ebcfbd
--- /dev/null
+++ b/.github/CODEOWNERS
@@ -0,0 +1,2 @@
+# All files in the .github directory require approval from core maintainers
+.github/** @JamesHenry @bradzacher @JoshuaKGoldberg
diff --git a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml
index 59b8783d1e75..d1d8b6fc4225 100644
--- a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml
+++ b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml
@@ -40,8 +40,11 @@ body:
- ast-spec
- eslint-plugin
- parser
+ - project-service
+ - rule-schema-to-typescript-types
- rule-tester
- scope-manager
+ - tsconfig-utils
- type-utils
- types
- typescript-eslint
diff --git a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml
index 604ce5468161..de9f9324e4c0 100644
--- a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml
+++ b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml
@@ -26,8 +26,11 @@ body:
- ast-spec
- eslint-plugin
- parser
+ - project-service
+ - rule-schema-to-typescript-types
- rule-tester
- scope-manager
+ - tsconfig-utils
- type-utils
- types
- typescript-eslint
diff --git a/.github/actions/breaking-pr-check/action.yml b/.github/actions/breaking-pr-check/action.yml
deleted file mode 100644
index f54443a4f433..000000000000
--- a/.github/actions/breaking-pr-check/action.yml
+++ /dev/null
@@ -1,6 +0,0 @@
-name: Validate Breaking Change PR
-description: Validate breaking change PR title and description
-
-runs:
- using: node20
- main: index.js
diff --git a/.github/actions/breaking-pr-check/index.js b/.github/actions/breaking-pr-check/index.js
deleted file mode 100644
index 2aa900456a9c..000000000000
--- a/.github/actions/breaking-pr-check/index.js
+++ /dev/null
@@ -1,78 +0,0 @@
-// @ts-check
-/* eslint-disable jsdoc/no-types, @typescript-eslint/no-require-imports */
-
-const core = require('@actions/core');
-const github = require('@actions/github');
-
-async function getPullRequest() {
- const token = process.env.GITHUB_TOKEN;
- if (!token) {
- throw new Error(
- 'The GITHUB_TOKEN environment variable is required to run this action.',
- );
- }
- const client = github.getOctokit(token);
-
- const pr = github.context.payload.pull_request;
- if (!pr) {
- throw new Error(
- "This action can only be invoked in `pull_request_target` or `pull_request` events. Otherwise the pull request can't be inferred.",
- );
- }
-
- const owner = pr.base.user.login;
- const repo = pr.base.repo.name;
-
- const { data } = await client.rest.pulls.get({
- owner,
- pull_number: pr.number,
- repo,
- });
-
- return data;
-}
-
-/**
- * @param {string} title The PR title to check
- */
-function checkTitle(title) {
- if (/^[a-z]+(\([a-z-]+\))?!: /.test(title)) {
- throw new Error(
- `Do not use exclamation mark ('!') to indicate breaking change in the PR Title.`,
- );
- }
-}
-
-/**
- * @param {string} body The body of the PR
- * @param {any[]} labels The labels applied to the PR
- */
-function checkDescription(body, labels) {
- if (!labels.some(label => label.name === 'breaking change')) {
- return;
- }
- const [firstLine, secondLine] = body.split(/\r?\n/);
-
- if (!firstLine || !/^BREAKING CHANGE:/.test(firstLine)) {
- throw new Error(
- `Breaking change PR body should start with "BREAKING CHANGE:". See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`,
- );
- }
- if (!secondLine) {
- throw new Error(
- `The description of breaking change is missing. See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`,
- );
- }
-}
-
-async function run() {
- const pullRequest = await getPullRequest();
- try {
- checkTitle(pullRequest.title);
- checkDescription(pullRequest.body ?? '', pullRequest.labels);
- } catch (/** @type {any} */ e) {
- core.setFailed(e.message);
- }
-}
-
-run();
diff --git a/.github/actions/prepare-build/action.yml b/.github/actions/prepare-build/action.yml
index e88bd2cfb93b..d191358d6503 100644
--- a/.github/actions/prepare-build/action.yml
+++ b/.github/actions/prepare-build/action.yml
@@ -22,7 +22,7 @@ runs:
if: steps['build-cache'].outputs.cache-hit == 'true'
shell: bash
run: |
- npx nx run types:build
+ yarn nx run types:build
env:
SKIP_AST_SPEC_REBUILD: true
@@ -31,6 +31,6 @@ runs:
shell: bash
# Website will be built by the Netlify GitHub App
run: |
- npx nx run-many --target=build --parallel --exclude=website --exclude=website-eslint
+ yarn nx run-many --target=build --parallel --exclude=website --exclude=website-eslint
env:
SKIP_AST_SPEC_REBUILD: true
diff --git a/.github/actions/prepare-install/action.yml b/.github/actions/prepare-install/action.yml
index 2334ef0b406f..7686f9cd4de2 100644
--- a/.github/actions/prepare-install/action.yml
+++ b/.github/actions/prepare-install/action.yml
@@ -76,3 +76,4 @@ runs:
YARN_INSTALL_STATE_PATH: .yarn/ci-cache/install-state.gz # Very small speedup when lock does not change
# Other environment variables
HUSKY: '0' # By default do not run HUSKY install
+ SKIP_POSTINSTALL: 'true'
diff --git a/.github/workflows/a11y-alt-bot.yml b/.github/workflows/a11y-alt-bot.yml
index 3ba37a7d9759..f59ac53a8dc6 100644
--- a/.github/workflows/a11y-alt-bot.yml
+++ b/.github/workflows/a11y-alt-bot.yml
@@ -2,11 +2,11 @@ name: Accessibility-alt-text-bot
on:
issues:
types: [opened, edited]
+ # NOTE: Never use pull_request_target here because that would populate secrets for forks
pull_request:
types: [opened, edited]
issue_comment:
- # nx bot and netlify bot edit their comments regularly
- # this floods our action queue with this action
+ # nx bot and netlify bot edit their comments regularly, this floods our action queue with this action
# it's rare that someone edits a comment to add an image so to save our queue we ignore the edit
types: [created]
discussion:
@@ -14,6 +14,7 @@ on:
discussion_comment:
types: [created, edited]
+# IMPORTANT: Minimal permissions necessary for this workflow to function
permissions:
issues: write
pull-requests: write
diff --git a/.github/workflows/breaking-change-validation.yml b/.github/workflows/breaking-change-validation.yml
new file mode 100644
index 000000000000..a441c68d250a
--- /dev/null
+++ b/.github/workflows/breaking-change-validation.yml
@@ -0,0 +1,79 @@
+# IMPORTANT: Do not reuse old name of "Semantic Breaking Change PR Test" here
+name: Breaking Change Validation
+
+on:
+ # WARNING: Using pull_request_target here because we want to validate PRs on forks
+ # pull_request_target can be UNSAFE because it runs in the TARGET repo context (not fork context).
+ # DO NOT CHECK OUT THE REPO IN THIS WORKFLOW
+ pull_request_target:
+ types:
+ - opened
+ - edited
+ - synchronize
+ - labeled
+ - unlabeled
+
+# IMPORTANT: Minimal permissions necessary for this workflow to function
+permissions:
+ pull-requests: read
+
+jobs:
+ validate:
+ name: Validate Breaking Change PR
+ runs-on: ubuntu-latest
+ steps:
+ - name: Check PR title and body
+ uses: actions/github-script@v7
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ script: |
+ async function getPullRequest() {
+ const pr = context.payload.pull_request;
+ if (!pr) {
+ throw new Error("This action can only be run on pull_request events.");
+ }
+
+ const owner = pr.base.repo.owner.login;
+ const repo = pr.base.repo.name;
+ const pull_number = pr.number;
+
+ const { data } = await github.rest.pulls.get({
+ owner,
+ repo,
+ pull_number,
+ });
+
+ return data;
+ }
+
+ function checkTitle(title) {
+ if (/^[a-z]+(\([a-z-]+\))?!: /.test(title)) {
+ throw new Error(
+ `Do not use exclamation mark ('!') to indicate breaking change in the PR Title.`,
+ );
+ }
+ }
+
+ function checkDescription(body, labels) {
+ if (!labels.some(label => label.name === 'breaking change')) {
+ return;
+ }
+
+ const [firstLine, secondLine] = body.split(/\r?\n/);
+
+ if (!firstLine || !/^BREAKING CHANGE:/.test(firstLine)) {
+ throw new Error(
+ `Breaking change PR body should start with "BREAKING CHANGE:". See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`,
+ );
+ }
+
+ if (!secondLine) {
+ throw new Error(
+ `The description of breaking change is missing. See https://typescript-eslint.io/maintenance/releases#2-merging-breaking-changes.`,
+ );
+ }
+ }
+
+ const pr = await getPullRequest();
+ checkTitle(pr.title);
+ checkDescription(pr.body ?? '', pr.labels);
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 398c05e17baa..38173f35a252 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,9 +1,11 @@
+# NOTE: The name of this workflow is significant - it is used as the identifier for the workflow_run trigger in the release workflow
name: CI
on:
push:
branches:
- main
+ # NOTE: Never use pull_request_target here because that would populate secrets for forks
pull_request:
branches:
- '**'
@@ -15,8 +17,8 @@ concurrency:
env:
PRIMARY_NODE_VERSION: 20
- # Only set the read-write token if we are on the main branch
- NX_CLOUD_ACCESS_TOKEN: ${{ (github.event_name == 'push' && github.ref == 'refs/heads/main') && secrets.NX_CLOUD_ACCESS_TOKEN || '' }}
+ # Value will be controlled via GitHub environment (called "main") secret, will be read-write for main branch, read-only for other branches
+ NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
# This increases the verbosity of the logs for everything, including Nx Cloud, but will hopefully surface more info about recent lint failures
NX_VERBOSE_LOGGING: false
@@ -38,7 +40,10 @@ permissions:
jobs:
install:
name: Checkout and Install
+ environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job
runs-on: ubuntu-latest
+ env:
+ NX_CI_EXECUTION_ENV: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -49,8 +54,11 @@ jobs:
build:
name: Build All Packages
+ environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job
needs: [install]
runs-on: ubuntu-latest
+ env:
+ NX_CI_EXECUTION_ENV: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -63,8 +71,11 @@ jobs:
generate_configs:
name: Generate Configs
+ environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job
needs: [build]
runs-on: ubuntu-latest
+ env:
+ NX_CI_EXECUTION_ENV: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -72,18 +83,21 @@ jobs:
uses: ./.github/actions/prepare-install
with:
node-version: ${{ env.PRIMARY_NODE_VERSION }}
- - run: yarn generate-configs
+ - run: yarn nx run generate-configs
- run: git status --porcelain
- if: failure()
run: echo "Outdated result detected from yarn generate-configs. Please check in any file changes."
lint_without_build:
name: Lint without build
+ environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job
needs: [install]
runs-on: ubuntu-latest
strategy:
matrix:
lint-task: ['check-spelling', 'check-format', 'lint-markdown']
+ env:
+ NX_CI_EXECUTION_ENV: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -97,12 +111,15 @@ jobs:
lint_with_build:
name: Lint with build
+ environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job
# because we lint with our own tooling, we need to build
needs: [build]
runs-on: ubuntu-latest
strategy:
matrix:
- lint-task: ['lint', 'typecheck', 'knip']
+ lint-task: ['deduplicate', 'lint', 'typecheck', 'knip']
+ env:
+ NX_CI_EXECUTION_ENV: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -120,8 +137,11 @@ jobs:
stylelint:
name: Stylelint
+ environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job
needs: [install]
runs-on: ubuntu-latest
+ env:
+ NX_CI_EXECUTION_ENV: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -135,8 +155,11 @@ jobs:
integration_tests:
name: Run integration tests on primary Node.js version
+ environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job
needs: [build]
runs-on: ubuntu-latest
+ env:
+ NX_CI_EXECUTION_ENV: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -154,6 +177,7 @@ jobs:
unit_tests:
name: Run Unit Tests
+ environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job
needs: [build]
runs-on: ${{ matrix.os }}
strategy:
@@ -170,8 +194,11 @@ jobs:
'eslint-plugin',
'eslint-plugin-internal',
'parser',
+ 'project-service',
+ 'rule-schema-to-typescript-types',
'rule-tester',
'scope-manager',
+ 'tsconfig-utils',
'type-utils',
'typescript-eslint',
'typescript-estree',
@@ -179,8 +206,7 @@ jobs:
'visitor-keys',
]
env:
- # Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app
- NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -'
+ NX_CI_EXECUTION_ENV: '${{ matrix.os }} - Node ${{ matrix.node-version }}'
COLLECT_COVERAGE: false
steps:
- name: Checkout
@@ -198,12 +224,12 @@ jobs:
# we don't collect coverage on other node versions so they run faster
- name: Run unit tests with coverage for ${{ matrix.package }}
if: env.PRIMARY_NODE_VERSION == matrix.node-version && matrix.os == 'ubuntu-latest'
- run: npx nx run ${{ matrix.package }}:test -- --coverage
+ run: yarn nx run ${{ matrix.package }}:test -- --coverage
env:
CI: true
- name: Run unit tests for ${{ matrix.package }}
if: env.PRIMARY_NODE_VERSION != matrix.node-version || matrix.os != 'ubuntu-latest'
- run: npx nx test ${{ matrix.package }}
+ run: yarn nx test ${{ matrix.package }}
env:
CI: true
@@ -218,6 +244,7 @@ jobs:
unit_tests_project_service:
name: Run Unit Tests with Project Service
+ environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job
needs: [build]
runs-on: ubuntu-latest
strategy:
@@ -225,7 +252,8 @@ jobs:
package:
['eslint-plugin', 'eslint-plugin-internal', 'typescript-estree']
env:
- COLLECT_COVERAGE: false
+ NX_CI_EXECUTION_ENV: 'ubuntu-latest'
+ COLLECT_COVERAGE: false,
steps:
- name: Checkout
uses: actions/checkout@v4
@@ -238,13 +266,14 @@ jobs:
- name: Build
uses: ./.github/actions/prepare-build
- name: Run unit tests for ${{ matrix.package }}
- run: npx nx test ${{ matrix.package }} --coverage=false
+ run: yarn nx test ${{ matrix.package }} --coverage=false
env:
CI: true
TYPESCRIPT_ESLINT_PROJECT_SERVICE: true
upload_coverage:
name: Upload Codecov Coverage
+ environment: ${{ (github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main') && 'main' || '' }} # Have to specify per job
needs: [unit_tests]
runs-on: ubuntu-latest
steps:
@@ -263,36 +292,3 @@ jobs:
files: coverage/**/lcov.info
flags: unittest
name: codecov
-
- publish_canary_version:
- name: Publish the latest code as a canary version
- runs-on: ubuntu-latest
- permissions:
- id-token: write
- needs: [integration_tests, lint_with_build, lint_without_build, unit_tests]
- if: github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main'
- steps:
- - name: Checkout
- uses: actions/checkout@v4
- with:
- fetch-depth: 0 # we need the tags to be available
-
- - name: Install
- uses: ./.github/actions/prepare-install
- with:
- node-version: ${{ env.PRIMARY_NODE_VERSION }}
- registry-url: 'https://registry.npmjs.org'
-
- - name: Build
- uses: ./.github/actions/prepare-build
-
- - name: Figure out and apply the next canary version
- run: npx tsx tools/release/apply-canary-version.mts
-
- - name: Publish all packages to npm with the canary tag
- # NOTE: this needs to be npx, rather than yarn, to make sure the authenticated npm registry is used
- run: npx nx release publish --tag canary --verbose
- env:
- NX_CLOUD_DISTRIBUTED_EXECUTION: false
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- NPM_CONFIG_PROVENANCE: true
diff --git a/.github/workflows/cleanup-cache.yml b/.github/workflows/cleanup-cache.yml
index 21cb7a3df7b0..b57bcabcb3fc 100644
--- a/.github/workflows/cleanup-cache.yml
+++ b/.github/workflows/cleanup-cache.yml
@@ -1,34 +1,35 @@
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
-name: cleanup caches by a branch
+name: Cleanup caches for the current PR branch
on:
+ # NOTE: Never use pull_request_target here because that would populate secrets for forks
pull_request:
types:
- closed
+# IMPORTANT: Minimal permissions necessary for this workflow to function
+permissions:
+ actions: write
+ contents: write
+
jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- - name: Check out code
- uses: actions/checkout@v4
-
- name: Cleanup
+ env:
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
- gh extension install actions/gh-actions-cache
-
REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
echo "Fetching list of cache key"
- cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
+ cacheKeysForPR=$(gh cache list -R $REPO --ref $BRANCH | cut -f 1)
## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
- gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
+ gh cache delete $cacheKey -R $REPO
done
echo "Done"
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml
deleted file mode 100644
index ae557bfdd433..000000000000
--- a/.github/workflows/lock.yml
+++ /dev/null
@@ -1,26 +0,0 @@
-name: 'Lock threads'
-
-on:
- schedule:
- - cron: '0 0 * * *'
-
-permissions: {}
-
-jobs:
- lock:
- permissions:
- issues: write # to lock issues (dessant/lock-threads)
- pull-requests: write # to lock PRs (dessant/lock-threads)
-
- runs-on: ubuntu-latest
- steps:
- - uses: dessant/lock-threads@v5.0.1
- with:
- add-issue-labels: 'locked due to age'
- github-token: ${{ github.token }}
- issue-inactive-days: '7'
- issue-lock-reason: 'resolved'
- issue-comment: ''
- pr-inactive-days: '7'
- pr-lock-reason: 'resolved'
- pr-comment: ''
diff --git a/.github/workflows/nx-migrate.yml b/.github/workflows/nx-migrate.yml
index ee1b4da6e4bc..5b0d8db9f9d4 100644
--- a/.github/workflows/nx-migrate.yml
+++ b/.github/workflows/nx-migrate.yml
@@ -2,11 +2,13 @@
# `nx migrate` when renovate opens a PR to change the version of @nx/workspace.
#
# You will therefore also notice that in the renovate configuration, we ignore any packages which
-# Nx will manage for us as part of `nx migrate` such as the remaining @nx/* packages and jest.
+# Nx will manage for us as part of `nx migrate` such as the remaining @nx/* packages.
name: Nx Migrate
on:
+ # NOTE: Never use pull_request_target here because that would populate secrets for forks
+ # Renovate creates branches directly on the main repo and acts like a trusted contributor
pull_request:
branches: [main]
paths:
diff --git a/.github/workflows/pr-labels.yml b/.github/workflows/pr-labels.yml
deleted file mode 100644
index 3f8770b799db..000000000000
--- a/.github/workflows/pr-labels.yml
+++ /dev/null
@@ -1,32 +0,0 @@
-name: Pull Request Labels
-
-on:
- pull_request:
- types: [labeled, opened, synchronize, unlabeled]
-
-jobs:
- label:
- runs-on: ubuntu-latest
- permissions:
- issues: write
- pull-requests: write
- #
- # WARNING!!!!!!!!!!!
- #
- # THIS ACTION WAS COMPROMISED: https://www.stepsecurity.io/blog/harden-runner-detection-tj-actions-changed-files-action-is-compromised
- #
- # DO NOT RE-ENABLE THIS WORKFLOW WITH THIS IN USE!!!!!
- #
- # steps:
- # - id: changed-stable-configs
- # uses: tj-actions/changed-files@v44.5.2
- # with:
- # files: packages/{eslint-plugin,typescript-eslint}/src/configs/{recommended,stylistic}*
- # - if: steps.changed-stable-configs.outputs.any_changed == 'true'
- # uses: mheap/github-action-required-labels@5.5.0
- # with:
- # add_comment: true
- # count: 1
- # labels: breaking change
- # message: '🤖 Beep boop! PRs that change our stable preset configs must be labeled with `breaking change`.'
- # mode: minimum
diff --git a/.github/workflows/pr-review-requested.yml b/.github/workflows/pr-review-requested.yml
index edfdbbdafb97..61c220e239cd 100644
--- a/.github/workflows/pr-review-requested.yml
+++ b/.github/workflows/pr-review-requested.yml
@@ -1,3 +1,17 @@
+name: PR Review Requested
+
+on:
+ # WARNING: Using pull_request_target here because we need write permissions to remove labels from fork PRs
+ # pull_request_target can be UNSAFE because it runs in the TARGET repo context (not fork context).
+ # DO NOT CHECK OUT THE REPO IN THIS WORKFLOW
+ pull_request_target:
+ types:
+ - review_requested
+
+# IMPORTANT: Minimal permissions necessary for this workflow to function
+permissions:
+ pull-requests: write
+
jobs:
pr_review_requested:
runs-on: ubuntu-latest
@@ -11,13 +25,3 @@ jobs:
run: |
echo "Don't worry if the previous step failed."
echo "See https://github.com/actions-ecosystem/action-remove-labels/issues/221."
-
-name: PR Review Requested
-
-on:
- pull_request_target:
- types:
- - review_requested
-
-permissions:
- pull-requests: write
diff --git a/.github/workflows/semantic-pr-titles.yml b/.github/workflows/pr-title-validation.yml
similarity index 73%
rename from .github/workflows/semantic-pr-titles.yml
rename to .github/workflows/pr-title-validation.yml
index 3a3c4a2c3164..a2a5e5e47a8a 100644
--- a/.github/workflows/semantic-pr-titles.yml
+++ b/.github/workflows/pr-title-validation.yml
@@ -1,14 +1,22 @@
-name: Semantic PR Titles
+# IMPORTANT: Do not reuse old name of "Semantic PR Titles" here
+name: PR Title Validation
on:
+ # WARNING: Using pull_request_target here because we want to validate PRs on forks
+ # pull_request_target can be UNSAFE because it runs in the TARGET repo context (not fork context).
+ # DO NOT CHECK OUT THE REPO IN THIS WORKFLOW
pull_request_target:
types:
- opened
- edited
- synchronize
+# IMPORTANT: Minimal permissions necessary for this workflow to function
+permissions:
+ pull-requests: read
+
jobs:
- main:
+ validate:
name: Validate PR title
runs-on: ubuntu-latest
steps:
@@ -30,8 +38,11 @@ jobs:
eslint-plugin
eslint-plugin-internal
parser
+ project-service
+ rule-schema-to-typescript-types
rule-tester
scope-manager
+ tsconfig-utils
type-utils
types
typescript-eslint
diff --git a/.github/workflows/prettier-update.yml b/.github/workflows/prettier-update.yml
index 5cd44a2d7a13..bdfb4d9fd05e 100644
--- a/.github/workflows/prettier-update.yml
+++ b/.github/workflows/prettier-update.yml
@@ -4,6 +4,8 @@
name: Prettier Update
on:
+ # NOTE: Never use pull_request_target here because that would populate secrets for forks
+ # Renovate creates branches directly on the main repo and acts like a trusted contributor
pull_request:
branches: [main]
paths:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
new file mode 100644
index 000000000000..0a23b7d8df4a
--- /dev/null
+++ b/.github/workflows/release.yml
@@ -0,0 +1,283 @@
+name: Release
+
+on:
+ # Triggered by completed CI runs (we check for successful status in the validate job) on main branch for canary releases
+ workflow_run:
+ workflows: ['CI']
+ types: [completed]
+ branches: [main]
+
+ schedule:
+ # Github actions do not currently support specifying a timezone.
+ # Run on Mondays at 5pm UTC (1pm Eastern (Summer) Time)
+ - cron: '0 17 * * 1'
+
+ # Manual trigger for out of band releases and next major version prereleases
+ workflow_dispatch:
+ inputs:
+ release_type:
+ description: 'Type of release to perform'
+ required: true
+ type: choice
+ options:
+ - canary
+ - stable
+ default: 'canary'
+ override_major_version:
+ description: 'Override major version for canary releases'
+ required: false
+ type: string
+ dry_run:
+ description: 'Perform a dry run'
+ required: true
+ type: boolean
+ default: true
+ first_release:
+ description: 'Whether one or more packages are being released for the first time'
+ required: false
+ type: boolean
+ default: false
+ force_release_without_changes:
+ description: 'Whether to do a release regardless of if there have been changes'
+ required: false
+ type: boolean
+ default: false
+
+# Ensure only one release workflow runs at a time
+concurrency:
+ group: release
+ cancel-in-progress: false
+
+env:
+ PRIMARY_NODE_VERSION: 20
+
+# Minimal permissions by default
+permissions:
+ contents: read
+
+jobs:
+ # Validation job to ensure secure inputs and determine release type
+ validate:
+ name: Validate Release Parameters
+ runs-on: ubuntu-latest
+ # Only run on the official repository to avoid wasted compute and unnecessary errors on forks (also an initial albeit weak first layer of protection against unauthorized releases)
+ if: github.repository == 'typescript-eslint/typescript-eslint'
+ outputs:
+ should_release: ${{ steps.validate.outputs.should_release }}
+ release_type: ${{ steps.validate.outputs.release_type }}
+ is_canary: ${{ steps.validate.outputs.is_canary }}
+ is_stable: ${{ steps.validate.outputs.is_stable }}
+ dry_run: ${{ steps.validate.outputs.dry_run }}
+ force_release_without_changes: ${{ steps.validate.outputs.force_release_without_changes }}
+ first_release: ${{ steps.validate.outputs.first_release }}
+ override_major_version: ${{ steps.validate.outputs.override_major_version }}
+ steps:
+ - name: Validate inputs and determine release type
+ id: validate
+ env:
+ # Ensure user input is treated as data by passing them as environment variables
+ INPUT_RELEASE_TYPE: ${{ inputs.release_type }}
+ INPUT_OVERRIDE_MAJOR: ${{ inputs.override_major_version }}
+ INPUT_DRY_RUN: ${{ inputs.dry_run }}
+ INPUT_FORCE_RELEASE: ${{ inputs.force_release_without_changes }}
+ INPUT_FIRST_RELEASE: ${{ inputs.first_release }}
+ run: |
+ SHOULD_RELEASE="false"
+
+ # Determine release type based on trigger
+ if [[ "${{ github.event_name }}" == "schedule" ]]; then
+ RELEASE_TYPE="stable"
+ SHOULD_RELEASE="true"
+ elif [[ "${{ github.event_name }}" == "workflow_run" ]]; then
+ # Only release canary if the CI workflow succeeded
+ if [[ "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then
+ RELEASE_TYPE="canary"
+ SHOULD_RELEASE="true"
+ else
+ echo "CI workflow did not succeed, skipping canary release"
+ RELEASE_TYPE="canary"
+ SHOULD_RELEASE="false"
+ fi
+ elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ RELEASE_TYPE="$INPUT_RELEASE_TYPE"
+ SHOULD_RELEASE="true"
+ else
+ echo "::error::Unsupported trigger event: ${{ github.event_name }}"
+ exit 1
+ fi
+
+ # Validate release type
+ if [[ "$RELEASE_TYPE" != "canary" && "$RELEASE_TYPE" != "stable" ]]; then
+ echo "::error::Invalid release type: $RELEASE_TYPE. Must be 'canary' or 'stable'"
+ exit 1
+ fi
+
+ # Security: For manual triggers, only allow core maintainers to run releases
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ ALLOWED_ACTORS=("JamesHenry" "bradzacher" "JoshuaKGoldberg")
+ ACTOR="${{ github.actor }}"
+ IS_ALLOWED="false"
+
+ for allowed in "${ALLOWED_ACTORS[@]}"; do
+ if [[ "$ACTOR" == "$allowed" ]]; then
+ IS_ALLOWED="true"
+ break
+ fi
+ done
+
+ if [[ "$IS_ALLOWED" != "true" ]]; then
+ echo "::error::User '$ACTOR' is not authorized to trigger manual releases."
+ echo "::error::Only the following users can trigger manual releases: ${ALLOWED_ACTORS[*]}"
+ exit 1
+ fi
+
+ echo "✅ Authorized user '$ACTOR' triggering manual release"
+ fi
+
+ # Set outputs
+ echo "should_release=$SHOULD_RELEASE" >> $GITHUB_OUTPUT
+ echo "release_type=$RELEASE_TYPE" >> $GITHUB_OUTPUT
+ echo "is_canary=$([[ "$RELEASE_TYPE" == "canary" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT
+ echo "is_stable=$([[ "$RELEASE_TYPE" == "stable" ]] && echo "true" || echo "false")" >> $GITHUB_OUTPUT
+
+ # Handle dry run for manual releases (defaults to true)
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ echo "dry_run=${INPUT_DRY_RUN:-true}" >> $GITHUB_OUTPUT
+ else
+ # Automated releases (schedule, workflow_run) are never dry runs
+ echo "dry_run=false" >> $GITHUB_OUTPUT
+ fi
+
+ # Handle force release without changes for stable releases
+ if [[ "$RELEASE_TYPE" == "stable" && "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ echo "force_release_without_changes=${INPUT_FORCE_RELEASE:-false}" >> $GITHUB_OUTPUT
+ else
+ echo "force_release_without_changes=false" >> $GITHUB_OUTPUT
+ fi
+
+ # Handle first release flag (only for manual releases)
+ if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
+ echo "first_release=${INPUT_FIRST_RELEASE:-false}" >> $GITHUB_OUTPUT
+ else
+ echo "first_release=false" >> $GITHUB_OUTPUT
+ fi
+
+ # Validate and handle override major version for canary releases
+ if [[ "$RELEASE_TYPE" == "canary" && "${{ github.event_name }}" == "workflow_dispatch" && -n "$INPUT_OVERRIDE_MAJOR" ]]; then
+ if [[ ! "$INPUT_OVERRIDE_MAJOR" =~ ^[0-9]+$ ]]; then
+ echo "::error::Invalid override major version format: $INPUT_OVERRIDE_MAJOR. Must be a positive integer."
+ exit 1
+ fi
+ echo "override_major_version=$INPUT_OVERRIDE_MAJOR" >> $GITHUB_OUTPUT
+ else
+ echo "override_major_version=" >> $GITHUB_OUTPUT
+ fi
+
+ echo "Validated release configuration:"
+ echo "- Should release: $SHOULD_RELEASE"
+ echo "- Release type: $RELEASE_TYPE"
+ echo "- Dry run: $INPUT_DRY_RUN"
+ echo "- Force release without changes: $INPUT_FORCE_RELEASE"
+ echo "- First release: $INPUT_FIRST_RELEASE"
+ echo "- Override major version (for canary only): $INPUT_OVERRIDE_MAJOR"
+
+ canary_release:
+ name: Publish Canary Release
+ runs-on: ubuntu-latest
+ environment: npm-registry # This environment is required by the trusted publishing configuration on npm
+ needs: [validate]
+ # Only run on the official repository to avoid wasted compute and unnecessary errors on forks (also an initial albeit weak first layer of protection against unauthorized releases)
+ # Also ensure validation passed and we're releasing a canary version
+ if: github.repository == 'typescript-eslint/typescript-eslint' && needs.validate.outputs.should_release == 'true' && needs.validate.outputs.is_canary == 'true'
+ permissions:
+ contents: read # No need to write to the repository for canary releases
+ id-token: write # Required for trusted publishing
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ # We need the full history for version calculation
+ fetch-depth: 0
+
+ - name: Install dependencies
+ uses: ./.github/actions/prepare-install
+ with:
+ node-version: ${{ env.PRIMARY_NODE_VERSION }}
+ registry-url: 'https://registry.npmjs.org'
+
+ # Use specific npm version required for trusted publishing
+ - name: Use npm 11.5.2
+ run: npm install -g npm@11.5.2
+
+ - name: Build packages
+ uses: ./.github/actions/prepare-build
+
+ - name: Calculate and apply canary version
+ run: yarn tsx tools/release/apply-canary-version.mts
+ env:
+ # Use the validated override major version from the validate job, if set
+ OVERRIDE_MAJOR_VERSION: ${{ needs.validate.outputs.override_major_version }}
+
+ - name: Publish canary packages
+ run: yarn nx release publish --tag canary --verbose --dry-run=${{ needs.validate.outputs.dry_run }} --first-release=${{ needs.validate.outputs.first_release }}
+ env:
+ # Enable npm provenance
+ NPM_CONFIG_PROVENANCE: true
+ # Disable distributed execution here for predictability
+ NX_CLOUD_DISTRIBUTED_EXECUTION: false
+
+ stable_release:
+ name: Publish Stable Release
+ runs-on: ubuntu-latest
+ environment: npm-registry # This environment is required by the trusted publishing configuration on npm
+ needs: [validate]
+ # Only run on the official repository to avoid wasted compute and unnecessary errors on forks (also an initial albeit weak first layer of protection against unauthorized releases)
+ # Also ensure validation passed and we're releasing a stable version
+ if: github.repository == 'typescript-eslint/typescript-eslint' && needs.validate.outputs.should_release == 'true' && needs.validate.outputs.is_stable == 'true'
+ permissions:
+ contents: read
+ id-token: write # Required for trusted publishing
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ # Need full history for changelog generation
+ fetch-depth: 0
+ ref: main
+ # Check out the repo with a specific fine-grained PAT to allow pushing back to the repo
+ token: ${{ secrets.GH_FINE_GRAINED_PAT }}
+
+ - name: Install dependencies
+ uses: ./.github/actions/prepare-install
+ with:
+ node-version: ${{ env.PRIMARY_NODE_VERSION }}
+ registry-url: 'https://registry.npmjs.org'
+
+ # Use specific npm version required for trusted publishing
+ - name: Use npm 11.5.2
+ run: npm install -g npm@11.5.2
+
+ - name: Build packages
+ uses: ./.github/actions/prepare-build
+
+ - name: Configure git user for automated commits
+ run: |
+ git config --global user.email "typescript-eslint[bot]@users.noreply.github.com"
+ git config --global user.name "typescript-eslint[bot]"
+
+ - name: Run stable release
+ run: yarn release --dry-run=${{ needs.validate.outputs.dry_run }} --force-release-without-changes=${{ needs.validate.outputs.force_release_without_changes }} --first-release=${{ needs.validate.outputs.first_release }} --verbose
+ env:
+ # Enable npm provenance
+ NPM_CONFIG_PROVENANCE: true
+ # Disable distributed execution here for predictability
+ NX_CLOUD_DISTRIBUTED_EXECUTION: false
+ # Use the specific fine-grained PAT to allow pushing back to the repo
+ GH_TOKEN: ${{ secrets.GH_FINE_GRAINED_PAT }}
+
+ - name: Force update the website branch to match the latest release
+ # Only update the website branch if we're not doing a dry run
+ if: needs.validate.outputs.dry_run == 'false'
+ run: |
+ git branch -f website
+ git push -f origin website
diff --git a/.github/workflows/semantic-breaking-change-pr.yml b/.github/workflows/semantic-breaking-change-pr.yml
deleted file mode 100644
index dcae58270de1..000000000000
--- a/.github/workflows/semantic-breaking-change-pr.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-name: Semantic Breaking Change PR
-
-on:
- pull_request_target:
- types:
- - opened
- - edited
- - synchronize
- - labeled
- - unlabeled
-
-jobs:
- main:
- name: Validate Breaking Change PR
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v4
- - uses: ./.github/actions/prepare-install
- - uses: ./.github/actions/breaking-pr-check
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
diff --git a/.gitignore b/.gitignore
index 20ab952ba246..94d644e2544a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,7 @@ docs/packages/*/generated
packages/website/.docusaurus
packages/website/.cache-loader
packages/website/build
+packages/website/data/recent-blog-posts.json
packages/website/static/sandbox
# Runtime data
@@ -95,3 +96,8 @@ packages/**/.yarn
# Vitest type tests
tsconfig*.vitest-temp.json
+
+# Leave these AI agent files up to individual contributors for now
+.cursor/mcp.json
+.cursor/rules/nx-rules.mdc
+.github/instructions/nx.instructions.md
diff --git a/.prettierignore b/.prettierignore
index 500bc3eaf91a..9a14c7180b0b 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -3,7 +3,6 @@
**/.vscode
**/.nyc_output
**/.vs
-CONTRIBUTORS.md
.yarn/plugins
.yarn/releases
@@ -13,21 +12,9 @@ packages/eslint-plugin/tests/fixtures/indent/
# ignore all error fixtures cos they often have intentional syntax errors
packages/ast-spec/src/*/*/fixtures/_error_/*/fixture.ts
-# TS 5.6 -- string literal import/export specifiers
# TODO - remove this once prettier supports it
-packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/fixture.ts
-packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/fixture.ts
-packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/fixture.ts
-packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/fixture.ts
-packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/fixture.ts
-packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/fixture.ts
-packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/fixture.ts
-packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/fixture.ts
-
-# TODO - remove this once prettier supports it
-# https://github.com/prettier/prettier/issues/16072
-packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-assert/fixture.ts
-packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts
+# https://github.com/prettier/prettier/issues/17405
+packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts
# Ignore CHANGELOG.md files to avoid issues with automated release job
CHANGELOG.md
@@ -35,8 +22,5 @@ CHANGELOG.md
packages/website/.docusaurus
packages/website/build
-# see the file header in eslint-base.test.js for more info
-packages/rule-tester/tests/eslint-base
-
/.nx/cache
/.nx/workspace-data
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index d4d111dbe6e4..6b60d5d55159 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -5,8 +5,8 @@
"editorconfig.editorconfig",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker",
- "tlent.jest-snapshot-language-support",
- "mrmlnc.vscode-json5"
+ "mrmlnc.vscode-json5",
+ "vitest.explorer"
],
"unwantedRecommendations": ["hookyqr.beautify", "dbaeumer.jshint"]
}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 896fbaebbb3a..b2472604617c 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -20,18 +20,5 @@
"javascript.preferences.quoteStyle": "single",
"typescript.preferences.quoteStyle": "single",
"editor.defaultFormatter": "esbenp.prettier-vscode",
-
- // make the .shot files from jest-specific-snapshot act like normal snapshots
- "files.associations": {
- "*.shot": "jest-snapshot"
- },
- "vsicons.associations.files": [
- {
- "icon": "jest_snapshot",
- "extensions": [
- ".shot",
- ],
- "extends": "jest_snapshot"
- },
- ],
+ "nxConsole.generateAiAgentRules": true,
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6c2483a9c2c3..36df7d48a5b3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,433 @@
+## 8.46.4 (2025-11-10)
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [no-deprecated] fix double-report on computed literal identifiers ([#11006](https://github.com/typescript-eslint/typescript-eslint/pull/11006), [#10958](https://github.com/typescript-eslint/typescript-eslint/issues/10958))
+- **eslint-plugin:** handle override modifier in promise-function-async fixer ([#11730](https://github.com/typescript-eslint/typescript-eslint/pull/11730))
+- **parser:** error when both `projectService` and `project` are set ([#11333](https://github.com/typescript-eslint/typescript-eslint/pull/11333))
+
+### ❤️ Thank You
+
+- Evgeny Stepanovych @undsoft
+- Kentaro Suzuki @sushichan044
+- Maria Solano @MariaSolOs
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.3 (2025-11-03)
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [no-misused-promises] expand union type to retrieve target property ([#11706](https://github.com/typescript-eslint/typescript-eslint/pull/11706))
+- **eslint-plugin:** [no-duplicate-enum-values] support signed numbers ([#11722](https://github.com/typescript-eslint/typescript-eslint/pull/11722), [#11723](https://github.com/typescript-eslint/typescript-eslint/pull/11723))
+
+### ❤️ Thank You
+
+- Evgeny Stepanovych @undsoft
+- tao
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.2 (2025-10-20)
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [prefer-optional-chain] skip optional chaining when it could change the result ([#11702](https://github.com/typescript-eslint/typescript-eslint/pull/11702))
+- **typescript-estree:** forbid invalid modifiers in object methods ([#11689](https://github.com/typescript-eslint/typescript-eslint/pull/11689))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- mdm317
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.1 (2025-10-13)
+
+### 🩹 Fixes
+
+- **ast-spec:** cleanup `TSLiteralType` ([#11624](https://github.com/typescript-eslint/typescript-eslint/pull/11624))
+- **eslint-plugin:** [prefer-optional-chain] include mixed "nullish comparison style" chains in checks ([#11533](https://github.com/typescript-eslint/typescript-eslint/pull/11533))
+- **eslint-plugin:** [no-misused-promises] special-case `.finally` not to report when a promise returning function is provided as an argument ([#11667](https://github.com/typescript-eslint/typescript-eslint/pull/11667))
+
+### ❤️ Thank You
+
+- Abraham Guo
+- mdm317
+- Ronen Amiel
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.0 (2025-10-06)
+
+### 🚀 Features
+
+- **eslint-plugin:** [no-unsafe-member-access] add allowOptionalChaining option ([#11659](https://github.com/typescript-eslint/typescript-eslint/pull/11659))
+- **eslint-plugin-internal:** [no-dynamic-tests] new internal Lint rule to ban dynamic syntax in generating tests ([#11323](https://github.com/typescript-eslint/typescript-eslint/pull/11323))
+- **rule-schema-to-typescript-types:** clean up and make public ([#11633](https://github.com/typescript-eslint/typescript-eslint/pull/11633))
+- **typescript-eslint:** export util types ([#10848](https://github.com/typescript-eslint/typescript-eslint/pull/10848), [#10849](https://github.com/typescript-eslint/typescript-eslint/pull/10849))
+- **typescript-estree:** mention file specifics in project service allowDefaultProject error ([#11635](https://github.com/typescript-eslint/typescript-eslint/pull/11635))
+- **typescript-estree:** private identifiers can only appear on LHS of in expressions ([#9232](https://github.com/typescript-eslint/typescript-eslint/pull/9232))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [no-floating-promises] remove excess parentheses in suggestions ([#11487](https://github.com/typescript-eslint/typescript-eslint/pull/11487))
+- **eslint-plugin:** [unbound-method] improve wording around `this: void` and binding ([#11634](https://github.com/typescript-eslint/typescript-eslint/pull/11634))
+- **eslint-plugin:** [no-deprecated] ignore deprecated `export import`s ([#11603](https://github.com/typescript-eslint/typescript-eslint/pull/11603))
+- **eslint-plugin:** removed error type previously deprecated ([#11674](https://github.com/typescript-eslint/typescript-eslint/pull/11674))
+- **eslint-plugin:** [prefer-readonly-parameter-types] ignore tagged primitives ([#11660](https://github.com/typescript-eslint/typescript-eslint/pull/11660))
+- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](https://github.com/typescript-eslint/typescript-eslint/pull/11628))
+- **typescript-estree:** forbid `abstract` modifier in object methods ([#11656](https://github.com/typescript-eslint/typescript-eslint/pull/11656))
+- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- Josh Goldberg ✨
+- Joshua Chen
+- Kirk Waiblinger @kirkwaiblinger
+- Mark de Dios @peanutenthusiast
+- Mister-Hope @Mister-Hope
+- Richard Torres @richardtorres314
+- Victor Genaev @mainframev
+- Younsang Na @nayounsang
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.45.0 (2025-09-29)
+
+### 🚀 Features
+
+- **eslint-plugin:** expose rule name via RuleModule interface ([#11616](https://github.com/typescript-eslint/typescript-eslint/pull/11616))
+
+### 🩹 Fixes
+
+- disable generating declaration maps ([#11627](https://github.com/typescript-eslint/typescript-eslint/pull/11627))
+- **ast-spec:** narrow ArrowFunctionExpression.generator to false ([#11636](https://github.com/typescript-eslint/typescript-eslint/pull/11636))
+- **eslint-plugin:** [no-base-to-string] check if superclass is ignored ([#11617](https://github.com/typescript-eslint/typescript-eslint/pull/11617))
+- **eslint-plugin:** [prefer-nullish-coalescing] ignoreBooleanCoercion should not apply to top-level ternary expressions ([#11614](https://github.com/typescript-eslint/typescript-eslint/pull/11614))
+
+### ❤️ Thank You
+
+- Bjorn Lu
+- Josh Goldberg ✨
+- mdm317
+- Moses Odutusin @thebolarin
+- Yukihiro Hasegawa @y-hsgw
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.44.1 (2025-09-22)
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [no-base-to-string] make ignoredTypeNames match type names without generics ([#11597](https://github.com/typescript-eslint/typescript-eslint/pull/11597))
+- **eslint-plugin:** [no-unsafe-enum-comparison] support unions of literals ([#11599](https://github.com/typescript-eslint/typescript-eslint/pull/11599))
+- **eslint-plugin:** [await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal ([#11611](https://github.com/typescript-eslint/typescript-eslint/pull/11611))
+- **typescript-estree:** forbid class property with name `constructor` ([#11590](https://github.com/typescript-eslint/typescript-eslint/pull/11590))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- Kirk Waiblinger @kirkwaiblinger
+- mdm317
+- Ronen Amiel
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.44.0 (2025-09-15)
+
+### 🚀 Features
+
+- **eslint-plugin:** [await-thenable] report invalid (non-promise) values passed to promise aggregator methods ([#11267](https://github.com/typescript-eslint/typescript-eslint/pull/11267))
+
+### 🩹 Fixes
+
+- **deps:** update dependency @eslint-community/eslint-utils to v4.8.0 ([#11589](https://github.com/typescript-eslint/typescript-eslint/pull/11589))
+- **eslint-plugin:** [no-unnecessary-type-conversion] ignore enum members ([#11490](https://github.com/typescript-eslint/typescript-eslint/pull/11490))
+
+### ❤️ Thank You
+
+- Moses Odutusin @thebolarin
+- Ronen Amiel
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.43.0 (2025-09-08)
+
+### 🚀 Features
+
+- **typescript-estree:** disallow empty type parameter/argument lists ([#11563](https://github.com/typescript-eslint/typescript-eslint/pull/11563))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [no-non-null-assertion] do not suggest optional chain on LHS of assignment ([#11489](https://github.com/typescript-eslint/typescript-eslint/pull/11489))
+- **eslint-plugin:** [no-unnecessary-type-conversion] only report ~~ on integer literal types ([#11517](https://github.com/typescript-eslint/typescript-eslint/pull/11517))
+- **eslint-plugin:** [consistent-type-exports] fix declaration shadowing ([#11457](https://github.com/typescript-eslint/typescript-eslint/pull/11457))
+- **eslint-plugin:** [no-floating-promises] allowForKnownSafeCalls now supports function names ([#11423](https://github.com/typescript-eslint/typescript-eslint/pull/11423), [#11430](https://github.com/typescript-eslint/typescript-eslint/pull/11430))
+- **eslint-plugin:** [no-deprecated] should report deprecated exports and reexports ([#11359](https://github.com/typescript-eslint/typescript-eslint/pull/11359))
+- **eslint-plugin:** [prefer-return-this-type] don't report an error when returning a union type that includes a classType ([#11432](https://github.com/typescript-eslint/typescript-eslint/pull/11432))
+- **rule-tester:** normalize paths before checking if they escape cwd ([#11525](https://github.com/typescript-eslint/typescript-eslint/pull/11525))
+- **scope-manager:** exclude Program from DefinitionBase node types ([#11469](https://github.com/typescript-eslint/typescript-eslint/pull/11469))
+- **type-utils:** add union type support to TypeOrValueSpecifier ([#11526](https://github.com/typescript-eslint/typescript-eslint/pull/11526))
+- **typescript-estree:** match filenames starting with a period when using glob in allowDefaultProject / ([#11537](https://github.com/typescript-eslint/typescript-eslint/pull/11537))
+
+### ❤️ Thank You
+
+- Dima @dbarabashh
+- Kirk Waiblinger @kirkwaiblinger
+- mdm317
+- Nicolas Le Cam
+- tao
+- Victor Genaev @mainframev
+- Yukihiro Hasegawa @y-hsgw
+- 민감자(Minji Kim) @mouse0429
+- 송재욱
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.42.0 (2025-09-02)
+
+### 🚀 Features
+
+- deprecate tseslint.config() ([#11531](https://github.com/typescript-eslint/typescript-eslint/pull/11531))
+
+### 🩹 Fixes
+
+- **deps:** update eslint monorepo to v9.33.0 ([#11482](https://github.com/typescript-eslint/typescript-eslint/pull/11482))
+- **typescript-eslint:** handle non-normalized windows paths produced by jiti ([#11546](https://github.com/typescript-eslint/typescript-eslint/pull/11546))
+
+### ❤️ Thank You
+
+- Kirk Waiblinger @kirkwaiblinger
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.41.0 (2025-08-25)
+
+### 🚀 Features
+
+- tighten `tsconfigRootDir` validation ([#11463](https://github.com/typescript-eslint/typescript-eslint/pull/11463))
+
+### 🩹 Fixes
+
+- resolve type error in eslint config ([#11500](https://github.com/typescript-eslint/typescript-eslint/pull/11500))
+- **deps:** update babel monorepo ([#11174](https://github.com/typescript-eslint/typescript-eslint/pull/11174))
+- **deps:** update dependency prettier to v3.6.2 ([#11496](https://github.com/typescript-eslint/typescript-eslint/pull/11496))
+
+### ❤️ Thank You
+
+- Kirk Waiblinger @kirkwaiblinger
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.40.0 (2025-08-18)
+
+### 🚀 Features
+
+- **typescript-estree:** forbid invalid keys in `EnumMember` ([#11232](https://github.com/typescript-eslint/typescript-eslint/pull/11232))
+
+### 🩹 Fixes
+
+- **typescript-eslint:** export `plugin`, `parser`, and `configs` that are compatible with both `defineConfig()` and `tseslint.config()` ([#11475](https://github.com/typescript-eslint/typescript-eslint/pull/11475))
+- **typescript-estree:** correct range of import assertion with trailing comma ([#11478](https://github.com/typescript-eslint/typescript-eslint/pull/11478))
+- **utils:** correct `calculateConfigForFile` return type ([#11451](https://github.com/typescript-eslint/typescript-eslint/pull/11451))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- Kirk Waiblinger @kirkwaiblinger
+- Nolan Gajdascz @Gajdascz
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.39.1 (2025-08-11)
+
+### 🩹 Fixes
+
+- **typescript-eslint:** handle `file://` urls in stack trace when inferring `tsconfigRootDir` ([#11464](https://github.com/typescript-eslint/typescript-eslint/pull/11464))
+
+### ❤️ Thank You
+
+- Kirk Waiblinger @kirkwaiblinger
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.39.0 (2025-08-04)
+
+### 🚀 Features
+
+- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445))
+- **eslint-plugin:** [naming-convention] add enumMember PascalCase default option ([#11127](https://github.com/typescript-eslint/typescript-eslint/pull/11127))
+- **eslint-plugin:** add no-unnecessary-type-conversion to strict-type-checked ruleset ([#11427](https://github.com/typescript-eslint/typescript-eslint/pull/11427))
+- **eslint-plugin:** [only-throw-error] support yield/await expressions ([#11417](https://github.com/typescript-eslint/typescript-eslint/pull/11417))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [prefer-optional-chain] ignore `check` option for most RHS of a chain ([#11272](https://github.com/typescript-eslint/typescript-eslint/pull/11272))
+- **eslint-plugin:** [no-unsafe-assignment] add an `unsafeObjectPattern` message ([#11403](https://github.com/typescript-eslint/typescript-eslint/pull/11403))
+
+### ❤️ Thank You
+
+- Brad Zacher @bradzacher
+- James Garbutt @43081j
+- Kim Sang Du @developer-bandi
+- Sasha Kondrashov
+- tao
+- Younsang Na @nayounsang
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.38.0 (2025-07-21)
+
+### 🚀 Features
+
+- **typescript-estree:** forbid optional chain in `TemplateTaggedLiteral` ([#11391](https://github.com/typescript-eslint/typescript-eslint/pull/11391))
+
+### 🩹 Fixes
+
+- disallow extra properties in rule options ([#11397](https://github.com/typescript-eslint/typescript-eslint/pull/11397))
+- **eslint-plugin:** [consistent-generic-constructors] resolve conflict with `isolatedDeclarations` if enabled in `constructor` option ([#11351](https://github.com/typescript-eslint/typescript-eslint/pull/11351))
+- **typescript-eslint:** infer tsconfigRootDir with v8 API ([#11412](https://github.com/typescript-eslint/typescript-eslint/pull/11412))
+- **typescript-eslint:** error on nested `extends` in `tseslint.config()` ([#11361](https://github.com/typescript-eslint/typescript-eslint/pull/11361))
+- **typescript-estree:** ensure the token type of the property name is Identifier ([#11329](https://github.com/typescript-eslint/typescript-eslint/pull/11329))
+
+### ❤️ Thank You
+
+- Andrew Kazakov @andreww2012
+- Kirk Waiblinger @kirkwaiblinger
+- MK @asdf93074
+- tao
+- Younsang Na @nayounsang
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.37.0 (2025-07-14)
+
+### 🚀 Features
+
+- **typescript-estree:** infer tsconfigRootDir from call stack ([#11370](https://github.com/typescript-eslint/typescript-eslint/pull/11370))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [unified-signatures] fix false positives for ignoreOverloadsWithDifferentJSDoc option ([#11381](https://github.com/typescript-eslint/typescript-eslint/pull/11381))
+- **type-utils:** add missing 'types' dependency to 'type-utils' ([#11383](https://github.com/typescript-eslint/typescript-eslint/pull/11383))
+- **type-utils:** handle namespaced exports in specifier matching ([#11380](https://github.com/typescript-eslint/typescript-eslint/pull/11380))
+
+### ❤️ Thank You
+
+- Bill Collins
+- Josh Goldberg ✨
+- René @Renegade334
+- Yukihiro Hasegawa @y-hsgw
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.36.0 (2025-07-07)
+
+### 🚀 Features
+
+- **typescript-eslint:** support `basePath` in `tseslint.config()` ([#11357](https://github.com/typescript-eslint/typescript-eslint/pull/11357))
+
+### ❤️ Thank You
+
+- Kirk Waiblinger @kirkwaiblinger
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.35.1 (2025-06-30)
+
+### 🩹 Fixes
+
+- remove prettier from eslint-plugin ([#11339](https://github.com/typescript-eslint/typescript-eslint/pull/11339))
+- **website:** did not find a source file error if url hash doesn't contain fileType ([#11350](https://github.com/typescript-eslint/typescript-eslint/pull/11350))
+
+### ❤️ Thank You
+
+- Abhijeet Singh @cseas
+- mdm317
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.35.0 (2025-06-23)
+
+### 🚀 Features
+
+- **eslint-plugin:** [no-base-to-string] add checkUnknown Option ([#11128](https://github.com/typescript-eslint/typescript-eslint/pull/11128))
+
+### 🩹 Fixes
+
+- **website:** acquired types are shown in the editor but not reflected in linting ([#11198](https://github.com/typescript-eslint/typescript-eslint/pull/11198))
+
+### ❤️ Thank You
+
+- Kim Sang Du @developer-bandi
+- mdm317
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.34.1 (2025-06-16)
+
+### 🩹 Fixes
+
+- **types:** add 2026/17 to EcmaVersion ([#11304](https://github.com/typescript-eslint/typescript-eslint/pull/11304))
+- **typescript-estree:** emit a Literal instead of Identifier for constructor when the identifier is a string ([#11299](https://github.com/typescript-eslint/typescript-eslint/pull/11299))
+- **visitor-keys:** bump `eslint-visitor-keys` dependency ([#11294](https://github.com/typescript-eslint/typescript-eslint/pull/11294))
+
+### ❤️ Thank You
+
+- David Archibald
+- overlookmotel
+- Tao
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.34.0 (2025-06-09)
+
+### 🚀 Features
+
+- **type-utils:** deprecated getSourceFileOfNode function ([#11284](https://github.com/typescript-eslint/typescript-eslint/pull/11284))
+
+### 🩹 Fixes
+
+- **typescript-estree:** change the token type of `null` from `Keyword` to `Null` ([#11283](https://github.com/typescript-eslint/typescript-eslint/pull/11283))
+- **typescript-estree:** add validation to interface extends ([#11271](https://github.com/typescript-eslint/typescript-eslint/pull/11271))
+- **visitor-keys:** fix visitor keys order ([#11279](https://github.com/typescript-eslint/typescript-eslint/pull/11279))
+
+### ❤️ Thank You
+
+- Kim Sang Du @developer-bandi
+- overlookmotel
+- Tao
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.33.1 (2025-06-02)
+
+### 🩹 Fixes
+
+- exclude docs/ directory from eslint-plugin package ([#11251](https://github.com/typescript-eslint/typescript-eslint/pull/11251))
+- **project-service:** add missing `typescript` peer dependency ([#11265](https://github.com/typescript-eslint/typescript-eslint/pull/11265))
+
+### ❤️ Thank You
+
+- JounQin
+- roottool
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.33.0 (2025-05-26)
+
+### 🚀 Features
+
+- create standalone project-service, tsconfig-utils packages ([#11182](https://github.com/typescript-eslint/typescript-eslint/pull/11182))
+
+### ❤️ Thank You
+
+- Josh Goldberg ✨
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
## 8.32.1 (2025-05-12)
### 🩹 Fixes
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
deleted file mode 100644
index 7c60ad27e4ce..000000000000
--- a/CONTRIBUTORS.md
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
-# Contributors
-
-Thanks goes to these wonderful people:
-
-
-
-
-
-
-
-
-This list is auto-generated using `yarn generate-contributors`. It shows the top 100 contributors with > 3 contributions.
diff --git a/README.md b/README.md
index 1656a4bc2c6d..fde6040f8c7e 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
typescript-eslint
-Monorepo for the tooling that enables ESLint and Prettier to support TypeScript
+Monorepo for typescript-eslint: powerful static analysis for JavaScript and TypeScript
@@ -32,7 +32,7 @@ This project exists thanks to the awesome people who contribute code and documen
-🙏 An extra special thanks goes out to the wonderful people listed in [`CONTRIBUTORS.md`](./CONTRIBUTORS.md)
+🙏 An extra special thanks goes out to the wonderful people listed in .
## Financial Contributors
diff --git a/docs/contributing/Issues.mdx b/docs/contributing/Issues.mdx
index 5a1945127d0f..9735fccbfd94 100644
--- a/docs/contributing/Issues.mdx
+++ b/docs/contributing/Issues.mdx
@@ -41,6 +41,24 @@ Consider searching through:
1. [Unassigned user-facing marked as `accepting prs` and `good first issue`](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22+label%3A%22accepting+prs%22+-label%3A%22repo+maintenance%22+no%3Aassignee): to find issues marked as good for a first-timer
2. [Unassigned user-facing marked as `accepting prs` without `good first issue`](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22+-label%3A%22good+first+issue%22+-label%3A%22repo+maintenance%22+no%3Aassignee): once you've finished a few issues, to find more intermediate-level issues
+## "Evaluating Community Engagement"
+
+The typescript-eslint project has limited maintenance bandwidth and cannot commit to every potentially valid issue.
+It can be difficult to tell if some issues' impacts would be worth taking bandwidth away from other, higher-impact issues.
+For those issues, we will:
+
+1. Add an `evaluating community engagement` label to indicate the issue is under review
+2. Wait at least 3-6 months
+3. Either accept or decline the issue, depending on how much engagement the issue receives
+
+If your issue is marked as `evaluating community engagement`, we encourage you to:
+
+- Socialize the issue online to find other users who are in favor of it
+- Try out the proposed changes in your own projects
+ - If the issue is for a new lint rule, consider using our [Building ESLint Plugins documentation](https://typescript-eslint.io/developers/eslint-plugins) to create a standalone plugin users can try
+
+See [Maintenance > Issues > Community Engagement Evaluation](https://typescript-eslint.io/maintenance/issues/#community-engagement-evaluation) for documentation on our corresponding maintenance practices.
+
## Questions and Support Requests
The issue tracker is not an appropriate place for questions or support requests.
diff --git a/docs/contributing/Local_Development.mdx b/docs/contributing/Local_Development.mdx
index 19b883286fab..705c95f8b2bf 100644
--- a/docs/contributing/Local_Development.mdx
+++ b/docs/contributing/Local_Development.mdx
@@ -59,7 +59,9 @@ Changes must pass two linters for documentation and naming, the commands for whi
All code changes should ideally be unit tested if possible.
You can run `yarn test` in any package to run its tests.
-> [VS Code launch tasks](https://code.visualstudio.com/docs/editor/tasks) tasks are provided that allow [visual debugging](https://code.visualstudio.com/docs/editor/debugging) tests.
+Oftentimes, you will only want to run one specific test related to the bug you are fixing or the feature you are implementing. To do this, you can add `only: true` to the test object definition. (Doing this will cause a new lint error for `eslint-plugin/no-only-tests`, but just ignore it while you work. The lint rule is only there so that you remember to delete the `only: true` once it comes time to make a pull request.)
+
+> The repository has [Visual Studio Code launch tasks](https://code.visualstudio.com/docs/editor/tasks) that allow for [visually debugging tests](https://code.visualstudio.com/docs/editor/debugging).
### Type Checking
diff --git a/docs/contributing/Pull_Requests.mdx b/docs/contributing/Pull_Requests.mdx
index ae2626cfcdfd..e1aa475654b7 100644
--- a/docs/contributing/Pull_Requests.mdx
+++ b/docs/contributing/Pull_Requests.mdx
@@ -48,16 +48,6 @@ For rule tests we recommend, when reasonable:
AST tests belong in the `ast-spec` package, within `fixtures/` subfolders alongside the AST declarations. Each test has its own `/` folder, containing a `fixture.ts` file defining the test, and a `snapshots/` subfolder. Happy-path test folders are stored directly under `fixtures/`; error-path test folders go under `fixtures/_errors/`. You can check out the [`ClassDeclaration` fixtures folder](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/ast-spec/src/declaration/ClassDeclaration/fixtures) for an example of both happy-path and unhappy-path test folders.
-### Updating Snapshots
-
-[Jest snapshots](https://jestjs.io/docs/snapshot-testing) are generated for use in some tests, e.g. for [rule schemas](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/tests/schema-snapshots) and [code examples in rule docs](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin/tests/docs-eslint-output-snapshots). You may need to re-generate these snapshots after adjusting a rule and/or its documentation, by running the relevant test suite(s) with the `-u` flag:
-
-```bash
-cd packages/eslint-plugin
-yarn test docs -u
-yarn test schemas -u
-```
-
## Raising the PR
Once your changes are ready, you can raise a PR! 🙌
diff --git a/docs/getting-started/Quickstart.mdx b/docs/getting-started/Quickstart.mdx
index 79e65c2b9915..c362a5978ffd 100644
--- a/docs/getting-started/Quickstart.mdx
+++ b/docs/getting-started/Quickstart.mdx
@@ -35,9 +35,10 @@ Next, create an `eslint.config.mjs` config file in the root of your project, and
// @ts-check
import eslint from '@eslint/js';
+import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommended,
);
@@ -45,6 +46,12 @@ export default tseslint.config(
This code will enable our [recommended configuration](../users/Shared_Configurations.mdx) for linting.
+#### Details
+
+- `defineConfig(...)` is an optional helper function built in to current versions of ESLint. See [the ESLint configuration docs](https://eslint.org/docs/latest/use/configure/configuration-files) for more detail.
+- `'@eslint/js'` / `eslint.configs.recommended` turns on [eslint's recommended config](https://www.npmjs.com/package/@eslint/js).
+- `tseslint.configs.recommended` turns on [our recommended config](../users/Shared_Configurations.mdx#recommended).
+
Aside on file extensions
@@ -52,12 +59,6 @@ The `.mjs` extension makes the file use the [ES modules (ESM)](https://developer
-#### Details
-
-- `tseslint.config(...)` is an **_optional_** helper function — see [`typescript-eslint`'s `config(...)`](../packages/TypeScript_ESLint.mdx#config).
-- `'@eslint/js'` / `eslint.configs.recommended` turns on [eslint's recommended config](https://www.npmjs.com/package/@eslint/js).
-- `tseslint.configs.recommended` turns on [our recommended config](../users/Shared_Configurations.mdx#recommended).
-
### Step 3: Running ESLint
Open a terminal to the root of your project and run the following command:
@@ -100,7 +101,7 @@ We recommend you consider enabling the following two configs:
- [`stylistic`](../users/Shared_Configurations.mdx#stylistic): additional rules that enforce consistent styling without significantly catching bugs or changing logic.
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
// Remove this line
tseslint.configs.recommended,
diff --git a/docs/getting-started/Typed_Linting.mdx b/docs/getting-started/Typed_Linting.mdx
index 3459ce890d42..066774382586 100644
--- a/docs/getting-started/Typed_Linting.mdx
+++ b/docs/getting-started/Typed_Linting.mdx
@@ -20,9 +20,10 @@ To enable typed linting, there are two small changes you need to make to your co
```js title="eslint.config.mjs"
import eslint from '@eslint/js';
+import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
// Remove this line
tseslint.configs.recommended,
@@ -32,7 +33,6 @@ export default tseslint.config(
languageOptions: {
parserOptions: {
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
},
@@ -40,11 +40,6 @@ export default tseslint.config(
);
```
-:::note
-[`import.meta.dirname`](https://nodejs.org/api/esm.html#importmetadirname) is only present for ESM files in Node.js >=20.11.0 / >= 21.2.0.
-For CommonJS modules and/or older versions of Node.js, [use `__dirname` or an alternative](https://stackoverflow.com/questions/46745014/alternative-for-dirname-in-node-js-when-using-es6-modules).
-:::
-
In more detail:
- `tseslint.configs.recommendedTypeChecked` is a [shared configuration](../users/Shared_Configurations.mdx). It contains recommended rules that additionally require type information.
@@ -82,7 +77,7 @@ module.exports = {
In more detail:
- `plugin:@typescript-eslint/recommended-type-checked` is a [shared configuration](../users/Shared_Configurations.mdx). It contains recommended rules that additionally require type information.
-- `parserOptions.projectService: true` indicates to ask TypeScript's type checking service for each source file's type information (see [Parser > `projectService`](../packages/Parser.mdx#projectService)).
+- `parserOptions.projectService: true` indicates to ask TypeScript's type checking service for each source file's type information (see [Parser > `projectService`](../packages/Parser.mdx#projectservice)).
- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser > `tsconfigRootDir`](../packages/Parser.mdx#tsconfigrootdir)).
@@ -104,7 +99,7 @@ If you enabled the [`strict` shared config](../users/Shared_Configurations.mdx#s
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
// Removed lines start
tseslint.configs.strict,
@@ -163,5 +158,5 @@ If you're having problems with typed linting, please see our [Troubleshooting FA
For details on the parser options that enable typed linting, see:
-- [Parser > `projectService`](../packages/Parser.mdx#projectService): our recommended option, with settings to customize TypeScript project information
-- [Parser > `project`](../packages/Parser.mdx#projectService): an older option that can be used as an alternative
+- [Parser > `projectService`](../packages/Parser.mdx#projectservice): our recommended option, with settings to customize TypeScript project information
+- [Parser > `project`](../packages/Parser.mdx#project): an older option that can be used as an alternative
diff --git a/docs/maintenance/Branding.mdx b/docs/maintenance/Branding.mdx
index d4e84d90deae..5ab5af30f691 100644
--- a/docs/maintenance/Branding.mdx
+++ b/docs/maintenance/Branding.mdx
@@ -22,7 +22,7 @@ Combining lowercase with a dash helps differentiate us.
### Slogan
-> The tooling that enables ESLint and Prettier to support TypeScript.
+> Powerful static analysis for JavaScript and TypeScript.
## Visuals
diff --git a/docs/maintenance/Contributor_Tiers.mdx b/docs/maintenance/Contributor_Tiers.mdx
index 769d523b8e18..ada16278379b 100644
--- a/docs/maintenance/Contributor_Tiers.mdx
+++ b/docs/maintenance/Contributor_Tiers.mdx
@@ -76,6 +76,21 @@ We treat everything here as approximate numbers.
We're a small enough team to informally discuss changes ad hoc and allow off-by-one-or-two months.
:::
+## Advancement
+
+Are you looking to graduate from _contributor_ to _committer_?
+Great!
+
+Roughly speaking, we're looking for folks who are interested in growing towards:
+
+- Being able to contribute to docs & ideation discussions, not just chores + rule fixes & features
+- Being able to empathetically understand the needs of lint rule users (i.e. not just their own personal preferences)
+- Consistently sending high-quality issues and PRs
+ - It's expected that some will have long rounds of discussion; we're more looking to avoid making "common" mistakes repeatedly (requesting review with failing builds, clear large gaps in logic, etc.)
+
+If you've been sending issues and pull requests to typescript-eslint for a few months and want to get more involved, please reach out to one of the maintainers over Discord or email.
+We'd love to support you in joining the team.
+
## Pointing
Although it's impossible to accurately estimate software projects, we want to roughly establish expectations of effort+time spent on the tiers.
diff --git a/docs/maintenance/Pull_Requests.mdx b/docs/maintenance/Pull_Requests.mdx
index 04c1547f0cb7..ec1cfa24d2c4 100644
--- a/docs/maintenance/Pull_Requests.mdx
+++ b/docs/maintenance/Pull_Requests.mdx
@@ -80,7 +80,6 @@ If there's no backing issue:
- Parenthesis and whitespace (see: `getWrappingFixer`).
- Unions and intersections (see: `unionConstituents` and `intersectionConstituents`).
- Unit tests:
- - All lines are covered per the Codecov / `yarn jest path/to/impacted/file --coverage` report.
- Both "positive" and "negative" ("valid" and "invalid") cases exist, if reasonably possible to test for.
- Fixes and suggestions, if present, don't remove `//` or `/*` comments
- `invalid` lint rule errors include line and column information
diff --git a/docs/maintenance/Releases.mdx b/docs/maintenance/Releases.mdx
index 4e8eb84a4876..5473869cf388 100644
--- a/docs/maintenance/Releases.mdx
+++ b/docs/maintenance/Releases.mdx
@@ -34,6 +34,7 @@ Per [Users > Releases > Major Releases](../users/Releases.mdx#major-releases), w
- Its publish command should be `npx nx release publish --tag rc-v${major} --verbose`.
- `README.md`:
- Add a link to a `v${major}--typescript-eslint.netlify.app` preview deploy environment on Netlify that you create for the branch.
+ - `docusaurus.config.mts`: updating the `supportedMajorVersion` variable
- Merge this into `main` once reviewed and rebase the `v${major}` branch.
#### 1a. Shared Config Changes
@@ -77,6 +78,7 @@ These should only be done for feedback that consistently comes up in community t
- It is important to note that when merged the commit message must also include `BREAKING CHANGE:` as the first line in order for `nx release` to recognize it as a breaking change in the release notes. If you miss this it just means more manual work when writing the release documentation.
1. Write and share out a blog post announcing the new beta [example: [Docs: Blog post describing changes & migration strategy for v5->v6](https://github.com/typescript-eslint/typescript-eslint/issues/6466)].
- Keep this post up-to-date as changes land in the `v${major}` branch.
+1. Send a PR to the `v${major}` branch that adds the old major version to [Users > Releases > Old Release Documentation](../users/Releases.mdx#old-release-documentation)
1. Wait until all required PRs have been merged
1. Write a blog post announcing the new release [example: [Docs: Release blog post for v6](https://github.com/typescript-eslint/typescript-eslint/issues/7153)], and land it in the `v${major}` branch.
1. Let the release wait for **at least 1 week** to allow time for early adopters to help test it and discuss the changes.
@@ -93,6 +95,9 @@ They don't need any special treatment.
1. Discuss with the maintainers to be ready for an [out-of-band](#out-of-band-releases) release. Doing this manually helps ensure someone is on-hand to action any issues that might arise from the major release.
1. Prepare the release notes. `nx release` will automatically generate the release notes on GitHub, however this will be disorganized and unhelpful for users. We need to reorganize the release notes so that breaking changes are placed at the top to make them most visible. If any migrations are required, we must list the steps to make it easy for users.
- Example release notes: [`v6.0.0`](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v6.0.0), [`v5.0.0`](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v5.0.0)
+1. Update Netlify deploys for old sites:
+ 1. Update the `CURRENT_MAJOR_VERSION` environment variable to the new major version integer, such as `9`
+ 2. Re-deploy the `v${major}` branches listed in [Users > Releases > Old Release Documentation](../users/Releases.mdx#old-release-documentation)
1. Finally, post the release on social media with a link to the GitHub release. Make sure you include additional information about the highlights of the release!
## Out-of-Band Releases
diff --git a/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx b/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx
index 596c7ea0611e..a009e10aaa4b 100644
--- a/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx
+++ b/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx
@@ -112,7 +112,6 @@ See [feat: drop support for node v12](https://github.com/typescript-eslint/types
We generally start the process of supporting a new TypeScript version just after the first beta release for that version is made available.
1. Create and pin an issue with a title like _TypeScript X.Y Support_, `accepting prs`, `AST`, `dependencies`, and `New TypeScript Version` labels, and the following contents:
-
1. A link to the _TypeScript X.Y Iteration Plan_ issue from the Microsoft issue tracker
2. The following text:
diff --git a/docs/packages/ESLint_Plugin.mdx b/docs/packages/ESLint_Plugin.mdx
index 263d7e4123a5..d02afc4be7b0 100644
--- a/docs/packages/ESLint_Plugin.mdx
+++ b/docs/packages/ESLint_Plugin.mdx
@@ -11,6 +11,7 @@ sidebar_label: eslint-plugin
:::info
See [Getting Started](../getting-started/Quickstart.mdx) for documentation on how to lint your TypeScript code with ESLint.
+If you're using ESLint's flat config (`eslint.config.*`), you don't need to install this package or `@typescript-eslint/parser` explicitly.
:::
`@typescript-eslint/eslint-plugin` is an ESLint plugin used to load in custom rules and rule configurations lists from typescript-eslint.
diff --git a/docs/packages/Parser.mdx b/docs/packages/Parser.mdx
index cd2ecaa19cc0..28f5c7bee463 100644
--- a/docs/packages/Parser.mdx
+++ b/docs/packages/Parser.mdx
@@ -63,7 +63,7 @@ interface ParserOptions {
### `disallowAutomaticSingleRunInference`
-> Default `process.env.TSESTREE_SINGLE_RUN` or `true`.
+> Default: `process.env.TSESTREE_SINGLE_RUN` or `true`.
Whether to stop using common heuristics to infer whether ESLint is being used as part of a single run (as opposed to `--fix` mode or in a persistent session such as an editor extension).
In other words, typescript-eslint is faster by default, and this option disables an automatic performance optimization.
@@ -94,7 +94,7 @@ Optional additional options to describe how to parse the raw syntax.
#### `jsx`
-> Default `false`.
+> Default: `false`.
Enable parsing JSX when `true`.
More details can be found in the [TypeScript handbook's JSX docs](https://www.typescriptlang.org/docs/handbook/jsx.html).
@@ -115,13 +115,13 @@ The exact behavior is as follows:
#### `globalReturn`
-> Default `false`.
+> Default: `false`.
This options allows you to tell the parser if you want to allow global `return` statements in your codebase.
### `ecmaVersion`
-> Default `2018`.
+> Default: `2018`.
Accepts any valid ECMAScript version number or `'latest'`:
@@ -135,19 +135,19 @@ Specifies the version of ECMAScript syntax you want to use. This is used by the
### `emitDecoratorMetadata`
-> Default `undefined`.
+> Default: `undefined`.
This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](../getting-started/Typed_Linting.mdx). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster.
### `experimentalDecorators`
-> Default `undefined`.
+> Default: `undefined`.
This option allow you to tell parser to act as if `experimentalDecorators: true` is set in `tsconfig.json`, but without [type-aware linting](../getting-started/Typed_Linting.mdx). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster.
### `extraFileExtensions`
-> Default `undefined`.
+> Default: `undefined`.
This option allows you to provide one or more additional file extensions which should be considered in the TypeScript Program compilation.
The default extensions are `['.js', '.mjs', '.cjs', '.jsx', '.ts', '.mts', '.cts', '.tsx']`.
@@ -159,7 +159,7 @@ See [Changes to `extraFileExtensions` with `projectService`](../troubleshooting/
### `isolatedDeclarations`
-> Default `undefined`.
+> Default: `undefined`.
This option allow you to tell parser to act as if `isolatedDeclarations: true` is set in `tsconfig.json`, but without [type-aware linting](../getting-started/Typed_Linting.mdx).
In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster.
@@ -181,7 +181,7 @@ If you do not use lint rules like `eslint-plugin-deprecation` that rely on TS's
### `jsxFragmentName`
-> Default `null`
+> Default: `null`
The identifier that's used for JSX fragment elements (after transpilation).
If `null`, assumes transpilation will always use a member of the configured `jsxPragma`.
@@ -191,7 +191,7 @@ If you provide `parserOptions.project`, you do not need to set this, as it will
### `jsxPragma`
-> Default `'React'`
+> Default: `'React'`
The identifier that's used for JSX Elements creation (after transpilation).
If you're using a library other than React (like `preact`), then you should change this value. If you are using the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) you can set this to `null`.
@@ -202,7 +202,7 @@ If you provide `parserOptions.project`, you do not need to set this, as it will
### `lib`
-> Default `['es2018']`
+> Default: `['es2018']`
For valid options, see the [TypeScript compiler options](https://www.typescriptlang.org/tsconfig#lib).
@@ -212,7 +212,7 @@ If you provide `parserOptions.project`, you do not need to set this, as it will
### `programs`
-> Default `undefined`.
+> Default: `undefined`.
This option allows you to programmatically provide an instance of a TypeScript Program object that will provide type information to rules.
This will override any programs that would have been computed from `parserOptions.project`.
@@ -226,7 +226,7 @@ All linted files must be part of the provided program(s).
We now recommend using [`projectService`](#projectservice) instead of `project` for easier configuration and faster linting.
:::
-> Default `undefined`.
+> Default: `undefined`.
A path to your project's TSConfig. **This setting or [`projectService`](#projectservice) are required to use [rules which require type information](../getting-started/Typed_Linting.mdx)**.
@@ -251,7 +251,6 @@ project: null;
```
- If `true`, each source file's parse will find the nearest `tsconfig.json` file to that source file.
-
- This is done by checking that source file's directory tree for the nearest `tsconfig.json`.
- If you use project references, TypeScript will **not** automatically use project references to resolve files. This means that you will have to add each referenced tsconfig to the `project` field either separately, or via a glob.
@@ -282,18 +281,20 @@ If this setting is specified, you must only lint files that are included in the
}
```
-For an option that allows linting files outside of your TSConfig file(s), see [`projectService`](#projectService).
+For an option that allows linting files outside of your TSConfig file(s), see [`projectService`](#projectservice).
### `projectService`
-> Default `false`.
+> Default: `false`.
Specifies using TypeScript APIs to generate type information for rules.
It will automatically use the nearest `tsconfig.json` for each file (like `project: true`).
It can also be configured to also allow type information to be computed for JavaScript files without the `allowJs` compiler option (unlike `project: true`).
+See [Typed Linting with `parserOptions.projectService`](/blog/project-service) for more context.
+
@@ -354,7 +355,7 @@ See [Troubleshooting & FAQs > Typed Linting > Project Service Issues](../trouble
##### `allowDefaultProject`
-> Default `[]` _(none)_
+> Default: `[]` _(none)_
Globs of files to allow running with the default project compiler options despite not being matched by the project service.
It takes in an array of string paths that will be resolved relative to the [`tsconfigRootDir`](#tsconfigrootdir).
@@ -370,7 +371,7 @@ There are several restrictions on this option to prevent it from being overused:
##### `defaultProject`
-> Default `'tsconfig.json'`
+> Default: `'tsconfig.json'`
Path to a TSConfig to use instead of TypeScript's default project configuration.
It takes in a string path that will be resolved relative to the [`tsconfigRootDir`](#tsconfigrootdir).
@@ -379,7 +380,7 @@ It takes in a string path that will be resolved relative to the [`tsconfigRootDi
##### `loadTypeScriptPlugins`
-> Default `false`
+> Default: `false`
Whether the project service should be allowed to load [TypeScript plugins](https://www.typescriptlang.org/tsconfig/plugins.html).
This is `false` by default to prevent plugins from registering persistent file watchers or other operations that might prevent ESLint processes from exiting when run on the command-line.
@@ -404,7 +405,7 @@ Each file match slows down linting, so if you do need to use this, please file a
### `projectFolderIgnoreList`
-> Default `["**/node_modules/**"]`.
+> Default: `["**/node_modules/**"]`.
This option allows you to ignore folders from being included in your provided list of `project`s.
This is useful if you have configured glob patterns, but want to make sure you ignore certain folders.
@@ -415,14 +416,25 @@ For example, by default it will ensure that a glob like `./**/tsconfig.json` wil
### `tsconfigRootDir`
-> Default `undefined`.
+> Default: the directory of the ESLint config file.
This option allows you to provide the root directory for relative TSConfig paths specified in the `project` option above.
Doing so ensures running ESLint from a directory other than the root will still be able to find your TSConfig.
+`tsconfigRootDir` uses the call stack to determine the closest `eslint.config.*` ESLint config file.
+In rare edge cases, that detection logic may be tricked by unusual paths and resolve to an incorrect value.
+Manually specifying `tsconfigRootDir` to the directory of your ESLint config file will work around those issues:
+
+```js
+parserOptions: {
+ tsconfigRootDir: import.meta.dirname,
+ // or, in CommonJS, __dirname
+}
+```
+
### `warnOnUnsupportedTypeScriptVersion`
-> Default `true`.
+> Default: `true`.
This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported. The warning message would look like this:
diff --git a/docs/packages/Project_Service.mdx b/docs/packages/Project_Service.mdx
new file mode 100644
index 000000000000..7cfe65b67d93
--- /dev/null
+++ b/docs/packages/Project_Service.mdx
@@ -0,0 +1,39 @@
+---
+id: project-service
+sidebar_label: project-service
+toc_max_heading_level: 3
+---
+
+import GeneratedDocs from './project-service/generated/index.md';
+
+# `@typescript-eslint/project-service`
+
+
+
+> Standalone TypeScript project service wrapper for linting ✨
+
+The typescript-eslint Project Service is a wrapper around TypeScript's "project service" APIs.
+These APIs are what editors such as VS Code use to programmatically "open" files and generate TypeScript programs for type information.
+
+:::note
+See [Blog > Typed Linting with Project Service](/blog/project-service) for more details on how lint users interact with the Project Service.
+:::
+
+```ts
+import { createProjectService } from '@typescript-eslint/project-service';
+
+const filePathAbsolute = '/path/to/your/project/index.ts';
+const { service } = createProjectService();
+
+service.openClientFile(filePathAbsolute);
+
+const scriptInfo = service.getScriptInfo(filePathAbsolute)!;
+const program = service
+ .getDefaultProjectForFile(scriptInfo.fileName, true)!
+ .getLanguageService(true)
+ .getProgram()!;
+```
+
+The following documentation is auto-generated from source code.
+
+
diff --git a/docs/packages/RuleSchemaToTypeScriptTypes.mdx b/docs/packages/RuleSchemaToTypeScriptTypes.mdx
new file mode 100644
index 000000000000..c684c357c5f6
--- /dev/null
+++ b/docs/packages/RuleSchemaToTypeScriptTypes.mdx
@@ -0,0 +1,36 @@
+---
+id: rule-schema-to-typescript-types
+sidebar_label: rule-schema-to-typescript-types
+toc_max_heading_level: 3
+---
+
+import GeneratedDocs from './rule-schema-to-typescript-types/generated/index.md';
+
+# `@typescript-eslint/rule-schema-to-typescript-types`
+
+
+
+> Converts ESLint rule schemas to equivalent TypeScript type strings ✨
+
+```ts
+import { schemaToTypes } from '@typescript-eslint/rule-schema-to-typescript-types';
+
+// "
+// type Options = [
+// /** My great option! */
+// string[]
+// ];
+// "
+schemaToTypes({
+ description: 'My great option!',
+ items: { type: 'string' },
+ type: 'array',
+});
+```
+
+The following documentation is auto-generated from source code.
+
+
diff --git a/docs/packages/TSConfig_Utils.mdx b/docs/packages/TSConfig_Utils.mdx
new file mode 100644
index 000000000000..1ce3361c7fa4
--- /dev/null
+++ b/docs/packages/TSConfig_Utils.mdx
@@ -0,0 +1,17 @@
+---
+id: tsconfig-utils
+sidebar_label: tsconfig-utils
+toc_max_heading_level: 3
+---
+
+import GeneratedDocs from './tsconfig-utils/generated/index.md';
+
+# `@typescript-eslint/tsconfig-utils`
+
+
+
+> Utilities for collecting TSConfigs for linting scenarios ✨
+
+The following documentation is auto-generated from source code.
+
+
diff --git a/docs/packages/TypeScript_ESLint.mdx b/docs/packages/TypeScript_ESLint.mdx
index f4e7106bf9ac..9533048caf83 100644
--- a/docs/packages/TypeScript_ESLint.mdx
+++ b/docs/packages/TypeScript_ESLint.mdx
@@ -16,12 +16,13 @@ This package is the main entrypoint that you can use to consume our tooling with
This package exports the following:
-| Name | Description |
-| --------- | -------------------------------------------------------------------------------------- |
-| `config` | A utility function for creating type-safe flat configs -- see [`config(...)`](#config) |
-| `configs` | [Shared ESLint (flat) configs](../users/Shared_Configurations.mdx) |
-| `parser` | A re-export of [`@typescript-eslint/parser`](./Parser.mdx) |
-| `plugin` | A re-export of [`@typescript-eslint/eslint-plugin`](./ESLint_Plugin.mdx) |
+| Name | Description |
+| --------------------- | ------------------------------------------------------------------------------------------------- |
+| `config` (deprecated) | A utility function for creating type-safe flat configs -- see [`config(...)`](#config-deprecated) |
+| `configs` | [Shared ESLint (flat) configs](../users/Shared_Configurations.mdx) |
+| `parser` | A re-export of [`@typescript-eslint/parser`](./Parser.mdx) |
+| `plugin` | A re-export of [`@typescript-eslint/eslint-plugin`](./ESLint_Plugin.mdx) |
+| `FlatConfig` | A re-export of the type from [`@typescript-eslint/utils`](./Utils.mdx) |
## Installation
@@ -31,15 +32,16 @@ npm i typescript-eslint
## Usage
-We recommend getting started by using `tseslint.config` helper function in your ESLint config:
+We recommend getting started by using the default ESLint setup with our shared configs.
```js title="eslint.config.mjs"
// @ts-check
import eslint from '@eslint/js';
+import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommended,
);
@@ -47,7 +49,16 @@ export default tseslint.config(
This config file exports a flat config that enables both the [core ESLint recommended config](https://www.npmjs.com/package/@eslint/js) and [our recommended config](../users/Shared_Configurations.mdx#recommended).
-### `config(...)`
+### `config(...)` (deprecated)
+
+:::danger
+
+The `config(...)` utility function was deprecated in favor of ESLint core's [`defineConfig(...)`]() in [#10935](https://github.com/typescript-eslint/typescript-eslint/issues/10935).
+See [the `defineConfig` migration guide later](#migrating-to-defineconfig) for more details.
+
+The documentation here is preserved for historical reference and migration purposes.
+
+:::
`tseslint.config(...)` takes in any number of ESLint config objects, each of which may additionally include an `extends` array of configs to extend.
`tseslint.config(...)` returns the equivalent ESLint config of applying the rest of the settings for each extension.
@@ -105,7 +116,7 @@ Otherwise it _will not_ impact your ability to use our tooling.
#### Flat config `extends`
-The `tseslint.config` utility function also adds handling for the `extends` property on flat config objects.
+The `tseslint.config(...)` utility function also adds handling for the `extends` property on flat config objects.
This allows you to more easily extend shared configs for specific file patterns whilst also overriding rules/options provided by those configs:
```js
@@ -159,9 +170,82 @@ export default tseslint.config({
});
```
+#### Migrating to `defineConfig(...)`
+
+The core `defineConfig(...)` helper is a nearly exact clone of `tseslint.config(...)` that was [first released in ESLint v9.22.0](https://eslint.org/blog/2025/03/eslint-v9.22.0-released/).
+See [the ESLint blog post](https://eslint.org/blog/2025/03/flat-config-extends-define-config-global-ignores/#support-for-older-eslint-versions) for info on how to use `defineConfig(...)` with older versions of ESLint.
+
+At the time of writing there are a small number of known edge cases in which the two have different functionality.
+
+{/* https://github.com/prettier/prettier/issues/17816 -- prettier has trouble with the code fences in the custom elements */}
+
+{/* prettier-ignore */}
+1. Overriding `files` in `extends`.
+ When `files` is provided in both a base object and an extension, `tseslint.config(...)` _overrides_ the `files` property in the extension, whereas `defineConfig(...)` semantically intersects the two provided `files` specifiers.
+
+
+
+ ```ts title="eslint.config.mjs"
+ import tseslint from 'typescript-eslint';
+
+ export default tseslint.config({
+ files: ['a.ts'],
+ extends: [
+ {
+ files: ['b.ts'],
+ rules: {
+ 'some-rule': 'error',
+ },
+ },
+ ],
+ });
+
+ // is equivalent to
+
+ export default {
+ files: ['a.ts'],
+ rules: { 'some-rule': 'error' },
+ };
+ ```
+
+
+
+
+ ```ts title="eslint.config.mjs"
+ import { defineConfig } from 'eslint/config';
+
+ export default defineConfig({
+ files: ['a.ts'],
+ extends: [
+ {
+ files: ['b.ts'],
+ rules: {
+ 'some-rule': 'error',
+ },
+ },
+ ],
+ });
+
+ // is equivalent to
+
+ // The base config technically ensures that 'a.ts' is still included in
+ // the lint run, but otherwise the config has no effect, due to the
+ // intersection of 'a.ts' and 'b.ts' being empty.
+ export default {
+ files: ['a.ts'],
+ };
+ ```
+
+
+
+
+2. Type declarations (only applies to users who typecheck their eslint configs).
+ There are slight differences in the way types are declared between the two functions, which may cause typechecking errors when you switch from `tseslint.config(...)` to `defineConfig(...)` in some cases (see [#10899](https://github.com/typescript-eslint/typescript-eslint/issues/10899) for an example that used to impact typescript-eslint's own configs).
+ Type errors such as these do not indicate a runtime problem and can safely be ignored.
+
### Manual usage
-[typescript-eslint's recommended and stylistic configurations](../users/configs) specify typescript-eslint `parser` and `plugin` options for you, so there is no need to manually provide those.
+[typescript-eslint's recommended and stylistic configurations](../users/Shared_Configurations.mdx) specify typescript-eslint `parser` and `plugin` options for you, so there is no need to manually provide those.
However, in complex ESLint configurations, you may find yourself manually specifying those options yourself.
#### Manually configuring our plugin and parser
@@ -172,10 +256,11 @@ You can declare our plugin and parser in your config via this package, for examp
// @ts-check
import eslint from '@eslint/js';
+import { defineConfig } from 'eslint/config';
import jestPlugin from 'eslint-plugin-jest';
import tseslint from 'typescript-eslint';
-export default tseslint.config({
+export default defineConfig({
plugins: {
// highlight-next-line
'@typescript-eslint': tseslint.plugin,
@@ -185,7 +270,6 @@ export default tseslint.config({
parser: tseslint.parser,
parserOptions: {
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
rules: {
@@ -217,10 +301,11 @@ This config:
// @ts-check
import eslint from '@eslint/js';
+import { defineConfig } from 'eslint/config';
import jestPlugin from 'eslint-plugin-jest';
import tseslint from 'typescript-eslint';
-export default tseslint.config(
+export default defineConfig(
{
// config with just ignores is the replacement for `.eslintignore`
ignores: ['**/build/**', '**/dist/**', 'src/some/file/to/ignore.ts'],
diff --git a/docs/packages/type-utils/TypeOrValueSpecifier.mdx b/docs/packages/type-utils/TypeOrValueSpecifier.mdx
index 7a21d16cf26d..fd04f70cb3bc 100644
--- a/docs/packages/type-utils/TypeOrValueSpecifier.mdx
+++ b/docs/packages/type-utils/TypeOrValueSpecifier.mdx
@@ -76,6 +76,12 @@ Lib types include `lib.dom.d.ts` globals such as `Window` and `lib.es*.ts` globa
### LibSpecifier Examples
+Matching all strings:
+
+```json
+{ "from": "lib", "name": "string" }
+```
+
Matching all array-typed values:
```json
diff --git a/docs/troubleshooting/faqs/ESLint.mdx b/docs/troubleshooting/faqs/ESLint.mdx
index d1a5cdf0d809..a07e16a2f798 100644
--- a/docs/troubleshooting/faqs/ESLint.mdx
+++ b/docs/troubleshooting/faqs/ESLint.mdx
@@ -49,9 +49,9 @@ Note, that for a mixed project including JavaScript and TypeScript, the `no-unde
```js title="eslint.config.mjs"
-import tseslint from 'typescript-eslint';
+import { defineConfig } from 'eslint/config';
-export default tseslint.config(
+export default defineConfig(
// ... the rest of your config ...
{
files: ['**/*.{ts,tsx,mts,cts}'],
diff --git a/docs/troubleshooting/faqs/Frameworks.mdx b/docs/troubleshooting/faqs/Frameworks.mdx
index fc0e559b56fa..15de567c5533 100644
--- a/docs/troubleshooting/faqs/Frameworks.mdx
+++ b/docs/troubleshooting/faqs/Frameworks.mdx
@@ -19,7 +19,7 @@ See [Changes to `extraFileExtensions` with `projectService`](../typed-linting/Pe
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
// ... the rest of your config ...
{
languageOptions: {
@@ -27,7 +27,6 @@ export default tseslint.config(
// Add this line
extraFileExtensions: ['.vue'],
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
},
@@ -61,10 +60,11 @@ If you are running into issues parsing .vue files, it might be because parsers l
```js title="eslint.config.mjs"
import tseslint from 'typescript-eslint';
+import { defineConfig } from 'eslint/config';
// Add this line
import vueParser from 'vue-eslint-parser';
-export default tseslint.config(
+export default defineConfig(
// ... the rest of your config ...
{
languageOptions: {
diff --git a/docs/troubleshooting/faqs/General.mdx b/docs/troubleshooting/faqs/General.mdx
index 53b752ab9b80..bf42e64c3ce9 100644
--- a/docs/troubleshooting/faqs/General.mdx
+++ b/docs/troubleshooting/faqs/General.mdx
@@ -36,7 +36,7 @@ Some examples
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
// ... the rest of your config ...
{
rules: {
@@ -242,15 +242,15 @@ For example, the following config enables only the recommended config's type-che
{/* prettier-ignore */}
```js title="eslint.config.mjs"
import eslint from '@eslint/js';
+import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
-export default tseslint.config(
+export default defineConfig(
tseslint.configs.recommendedTypeCheckedOnly,
{
languageOptions: {
parserOptions: {
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
},
diff --git a/docs/troubleshooting/faqs/JavaScript.mdx b/docs/troubleshooting/faqs/JavaScript.mdx
index ac445281df3f..00e4acaf726c 100644
--- a/docs/troubleshooting/faqs/JavaScript.mdx
+++ b/docs/troubleshooting/faqs/JavaScript.mdx
@@ -11,7 +11,10 @@ import TabItem from '@theme/TabItem';
This is to be expected - ESLint rules do not check file extensions on purpose, as it causes issues in environments that use non-standard extensions (for example, a `.vue` and a `.md` file can both contain TypeScript code to be linted).
-If you have some pure JavaScript code that you do not want to apply certain lint rules to, then you can use [ESLint's `overrides` configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) to turn off certain rules, or even change the parser based on glob patterns.
+If you have some pure JavaScript code that you do not want to apply certain lint rules to, then you can use [ESLint's `files` configuration](https://eslint.org/docs/latest/use/configure/configuration-files#specifying-files-and-ignores) to either:
+
+- (recommended) only enable TypeScript-specific rules on TypeScript file extensions
+- turn off TypeScript-specific rules on JavaScript-only file extensions
## Should I run ESLint on transpiled output JavaScript files?
diff --git a/docs/troubleshooting/typed-linting/Monorepos.mdx b/docs/troubleshooting/typed-linting/Monorepos.mdx
index 85cc6ef264db..49e118408adb 100644
--- a/docs/troubleshooting/typed-linting/Monorepos.mdx
+++ b/docs/troubleshooting/typed-linting/Monorepos.mdx
@@ -56,7 +56,7 @@ For each file being linted, the first matching project path will be used as its
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
{
@@ -66,7 +66,6 @@ export default tseslint.config(
project: true,
// Add this line
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
- tsconfigRootDir: import.meta.dirname,
},
},
},
@@ -89,7 +88,6 @@ module.exports = {
project: true,
// Add this line
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
- tsconfigRootDir: import.meta.dirname,
},
plugins: ['@typescript-eslint'],
root: true,
@@ -108,7 +106,7 @@ Instead of globs that use `**` to recursively check all folders, prefer paths th
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
{
@@ -118,7 +116,6 @@ export default tseslint.config(
project: ['./tsconfig.eslint.json', './**/tsconfig.json'],
// Add this line
project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'],
- tsconfigRootDir: import.meta.dirname,
},
},
},
diff --git a/docs/troubleshooting/typed-linting/Performance.mdx b/docs/troubleshooting/typed-linting/Performance.mdx
index f81eaaca22a5..9a3e0a3fbcc4 100644
--- a/docs/troubleshooting/typed-linting/Performance.mdx
+++ b/docs/troubleshooting/typed-linting/Performance.mdx
@@ -38,6 +38,14 @@ In particular for typed linting:
- [Performance Tracing](https://github.com/microsoft/TypeScript/wiki/Performance#performance-tracing) can spotlight specific slow types within your project.
- [Using Project References](https://github.com/microsoft/TypeScript/wiki/Performance#using-project-references) -which requires enabling the [new "project service" (`parserOptions.projectService`) in v8](/blog/announcing-typescript-eslint-v8-beta#project-service)- can be helpful to speed up type checking on larger projects.
+If none of the above work, you can try adjusting the `--max-semi-space-size` of Node. Increasing the max size of a semi-space can improve performance at the cost of more memory consumption. You can [read more about setting space size in Node.js here](https://nodejs.org/api/cli.html#--max-semi-space-sizesize-in-mib).
+
+You can enable the setting by prepending your ESLint command like:
+
+```bash
+NODE_OPTIONS=--max-semi-space-size=256 eslint
+```
+
## Wide includes in your `tsconfig`
When using type-aware linting, you provide us with one or more tsconfigs.
@@ -172,13 +180,12 @@ Instead of globs that use `**` to recursively check all folders, prefer paths th
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommendedRequiringTypeChecking,
{
languageOptions: {
parserOptions: {
- tsconfigRootDir: import.meta.dirname,
// Remove this line
project: ['./**/tsconfig.json'],
// Add this line
@@ -218,7 +225,7 @@ See [Glob pattern in parser's option "project" slows down linting](https://githu
## Third-Party Plugins
-### `@stylistic/ts/indent` and other stylistic rules rules
+### `@stylistic/ts/indent` and other stylistic rules
The [`@stylisic/ts/indent` rule](https://eslint.style/rules/ts/indent#ts-indent) helps ensure your codebase follows a consistent indentation pattern.
However this involves a _lot_ of computations across every single token in a file.
diff --git a/docs/troubleshooting/typed-linting/index.mdx b/docs/troubleshooting/typed-linting/index.mdx
index 6681b1069b5d..c43b96d118a4 100644
--- a/docs/troubleshooting/typed-linting/index.mdx
+++ b/docs/troubleshooting/typed-linting/index.mdx
@@ -30,9 +30,10 @@ For example, to disable type-checked linting on all `.js` files:
```js title="eslint.config.mjs"
+import defineConfig from 'eslint/config';
import tseslint from 'typescript-eslint';
-export default tseslint.config(
+export default defineConfig(
// ... the rest of your config ...
{
files: ['**/*.js'],
@@ -69,7 +70,7 @@ You can combine ESLint's [overrides](https://eslint.org/docs/latest/use/configur
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
tseslint.configs.stylisticTypeChecked,
@@ -77,7 +78,6 @@ export default tseslint.config(
languageOptions: {
parserOptions: {
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
},
@@ -297,12 +297,11 @@ For example, if you use a specific `tsconfig.eslint.json` for linting, you'd spe
```js title="eslint.config.mjs"
-export default tseslint.config({
+export default defineConfig({
// ...
languageOptions: {
parserOptions: {
project: './tsconfig.eslint.json',
- tsconfigRootDir: import.meta.dirname,
},
},
// ...
diff --git a/docs/users/Releases.mdx b/docs/users/Releases.mdx
index ad5625f70f33..58a4e5c6175d 100644
--- a/docs/users/Releases.mdx
+++ b/docs/users/Releases.mdx
@@ -8,13 +8,44 @@ import useIsBrowser from '@docusaurus/useIsBrowser';
export function LocalTimeOfRelease() {
const isBrowser = useIsBrowser();
- // An arbitrary Monday at 17:00 UTC.
- const date = new Date('1970-01-05T17:00Z');
- const formatted = date.toLocaleTimeString('en-US', {
+ if (!isBrowser) {
+ // An arbitrary Monday at 17:00 UTC.
+ const arbitraryMonday = new Date('1970-01-05T17:00Z');
+ return arbitraryMonday.toLocaleTimeString('en-US', {
+ hour: 'numeric',
+ minute: '2-digit',
+ timeZoneName: 'short',
+ timeZone: 'UTC',
+ });
+ }
+ const now = new Date();
+ const daysAgoToMonday = (now.getUTCDay() + 6) % 7;
+ // Calculate the previous Monday at 17:00 UTC.
+ const previousReleaseDate = new Date(
+ Date.UTC(
+ now.getUTCFullYear(),
+ now.getUTCMonth(),
+ now.getUTCDate() - daysAgoToMonday,
+ 17,
+ ),
+ );
+ // This will happen if the current time is before 17:00 UTC on Monday.
+ if (previousReleaseDate > now) {
+ previousReleaseDate.setUTCDate(previousReleaseDate.getUTCDate() - 7);
+ }
+ // Next release is 7 days later.
+ const nextReleaseDate = new Date(previousReleaseDate.getTime());
+ nextReleaseDate.setUTCDate(previousReleaseDate.getUTCDate() + 7);
+ // If we're near a DST time change, we want to display the time of the release that has the same UTC offset as now.
+ // If, for some reason, neither does, just display the local time of the next release.
+ const releaseWithSameUtcOffset =
+ [nextReleaseDate, previousReleaseDate].find(
+ date => date.getTimezoneOffset() === now.getTimezoneOffset(),
+ ) ?? nextReleaseDate;
+ const formatted = releaseWithSameUtcOffset.toLocaleTimeString('en-US', {
hour: 'numeric',
minute: '2-digit',
timeZoneName: 'short',
- timeZone: isBrowser ? undefined : 'UTC',
});
// Specify the day of week if it's not a Monday.
const dayNames = [
@@ -26,8 +57,10 @@ export function LocalTimeOfRelease() {
'Friday',
'Saturday',
];
- if (date.getDay() !== date.getUTCDay()) {
- return `${dayNames[date.getDay()]}s at ${formatted}`;
+ if (
+ releaseWithSameUtcOffset.getDay() !== releaseWithSameUtcOffset.getUTCDay()
+ ) {
+ return `${dayNames[releaseWithSameUtcOffset.getDay()]}s at ${formatted}`;
}
return formatted;
}
@@ -98,7 +131,23 @@ We assess need on a case-by-case basis though generally an emergency is defined
These releases are done manually by a maintainer with the required access privileges.
-## Back-Porting Releases
+## Older Versions
+
+Older major versions of typescript-eslint are never maintained or supported.
+They may crash with the latest versions of TypeScript.
+Using the latest version of typescript-eslint is strongly recommended for getting the latest rule features and fixes, supporting the latest TypeScript features and syntax, and continuous performance and stability improvements.
+
+### Back-Porting Releases
We **_do not_** back port releases to previously released major/minor versions.
We only ever release forward.
+
+### Old Release Documentation
+
+You can find the last version of some older major versions under their dedicated branch deploys:
+
+- v7: [v7--typescript-eslint.netlify.app](https://v7--typescript-eslint.netlify.app)
+- v6: [v6--typescript-eslint.netlify.app](https://v6--typescript-eslint.netlify.app)
+
+Note that older documentation pages may contain outdated information and links.
+We strongly recommend using the latest version of typescript-eslint and its documentation.
diff --git a/docs/users/Shared_Configurations.mdx b/docs/users/Shared_Configurations.mdx
index 5071a67d08fe..5d8cd232cc1a 100644
--- a/docs/users/Shared_Configurations.mdx
+++ b/docs/users/Shared_Configurations.mdx
@@ -21,9 +21,10 @@ See [Getting Started > Quickstart](../getting-started/Quickstart.mdx) first to s
// @ts-check
import eslint from '@eslint/js';
+import { defineConfig } from 'eslint/config';
import tseslint from 'typescript-eslint';
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommended,
);
@@ -37,7 +38,7 @@ If your project does not enable [typed linting](../getting-started/Typed_Linting
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommended,
tseslint.configs.stylistic,
@@ -66,14 +67,21 @@ module.exports = {
If your project enables [typed linting](../getting-started/Typed_Linting.mdx), we suggest enabling the [`recommended-type-checked`](#recommended-type-checked) and [`stylistic-type-checked`](#stylistic-type-checked) configurations to start:
+:::note
+To use type-checking, you also need to configure `languageOptions.parserOptions` as shown in [typed linting docs](../getting-started/Typed_Linting.mdx).
+:::
+
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
+ // Added lines start
tseslint.configs.recommendedTypeChecked,
tseslint.configs.stylisticTypeChecked,
+ // Added lines end
+ // Other configuration...
);
```
@@ -84,9 +92,12 @@ export default tseslint.config(
module.exports = {
extends: [
'eslint:recommended',
+ // Added lines start
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
+ // Added lines end
],
+ // Other configuration...
};
```
@@ -127,7 +138,7 @@ These rules are those whose reports are almost always for a bad practice and/or
{/* prettier-ignore */}
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
tseslint.configs.recommended,
);
```
@@ -144,7 +155,7 @@ module.exports = {
-See [`configs/recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended.ts) for the exact contents of this config.
+See [the source code for the `recommended` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended.ts) for the exact contents.
### `recommended-type-checked`
@@ -156,7 +167,7 @@ Rules newly added in this configuration are similarly useful to those in `recomm
{/* prettier-ignore */}
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
tseslint.configs.recommendedTypeChecked,
);
```
@@ -173,7 +184,7 @@ module.exports = {
-See [`configs/recommended-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts) for the exact contents of this config.
+See [the source code for the `recommended-type-checked` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts) for the exact contents.
### `strict`
@@ -185,7 +196,7 @@ Rules added in `strict` are more opinionated than recommended rules and might no
{/* prettier-ignore */}
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
tseslint.configs.strict,
);
```
@@ -203,7 +214,7 @@ module.exports = {
Some rules also enabled in `recommended` default to more strict settings in this configuration.
-See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict.ts) for the exact contents of this config.
+See [the source code for the `strict` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict.ts) for the exact contents.
:::tip
We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict` only if a nontrivial percentage of its developers are highly proficient in TypeScript.
@@ -224,7 +235,7 @@ Rules newly added in this configuration are similarly useful (and opinionated) t
{/* prettier-ignore */}
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
tseslint.configs.strictTypeChecked,
);
```
@@ -242,7 +253,7 @@ module.exports = {
Some rules also enabled in `recommended-type-checked` default to more strict settings in this configuration.
-See [`configs/strict-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts) for the exact contents of this config.
+See [the source code for the `strict-type-checked` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts) for the exact contents.
:::tip
We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict-type-checked` only if a nontrivial percentage of its developers are highly proficient in TypeScript.
@@ -263,7 +274,7 @@ These rules are generally opinionated about enforcing simpler code patterns.
{/* prettier-ignore */}
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
tseslint.configs.stylistic,
);
```
@@ -283,7 +294,7 @@ module.exports = {
Note that `stylistic` does not replace `recommended` or `strict`.
`stylistic` adds additional rules.
-See [`configs/stylistic.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts) for the exact contents of this config.
+See [the source code for the `stylistic` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts) for the exact contents.
### `stylistic-type-checked`
@@ -295,7 +306,7 @@ Rules newly added in this configuration are similarly opinionated to those in `s
{/* prettier-ignore */}
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
tseslint.configs.stylisticTypeChecked,
);
```
@@ -315,7 +326,7 @@ module.exports = {
Note that `stylistic-type-checked` does not replace `recommended-type-checked` or `strict-type-checked`.
`stylistic-type-checked` adds additional rules.
-See [`configs/stylistic-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts) for the exact contents of this config.
+See [the source code for the `stylistic-type-checked` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts) for the exact contents.
## Other Configurations
@@ -326,7 +337,7 @@ typescript-eslint includes a few utility configurations.
Enables each the rules provided as a part of typescript-eslint.
Note that many rules are not applicable in all codebases, or are meant to be configured.
-See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/all.ts) for the exact contents of this config.
+See [the source code for the `all` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/all.ts) for the exact contents.
:::warning
We do not recommend TypeScript projects extend from `plugin:@typescript-eslint/all`.
@@ -345,14 +356,14 @@ We don't recommend using this directly; instead, extend from an earlier recommen
This config is automatically included if you use any of the recommended configurations.
-See [`configs/base.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/base.ts) for the exact contents of this config.
+See [the source code for the `base` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/base.ts) for the exact contents.
### `disable-type-checked`
A utility ruleset that will disable type-aware linting and all type-aware rules available in our project.
This config is useful if you'd like to have your base config concerned with type-aware linting, and then conditionally use [overrides](https://eslint.org/docs/latest/use/configure/configuration-files#configuration-based-on-glob-patterns) to disable type-aware linting on specific subsets of your codebase.
-See [`configs/disable-type-checked.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts) for the exact contents of this config.
+See [the source code for the `disable-type-checked` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts) for the exact contents.
:::info
If you use type-aware rules from other plugins, you will need to manually disable these rules or use a premade config they provide to disable them.
@@ -362,14 +373,13 @@ If you use type-aware rules from other plugins, you will need to manually disabl
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
- tsconfigRootDir: import.meta.dirname,
},
},
},
@@ -426,7 +436,7 @@ Additionally, it enables rules that promote using the more modern constructs Typ
```js title="eslint.config.mjs"
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.eslintRecommended,
);
@@ -449,7 +459,7 @@ module.exports = {
This config is automatically included if you use any of the recommended configurations.
-See [`configs/eslint-recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/eslint-recommended.ts) for the exact contents of this config.
+See [the source code for the `eslint-recommended` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended-raw.ts) for the exact contents.
### `recommended-type-checked-only`
@@ -462,7 +472,7 @@ module.exports = {
};
```
-See [`configs/recommended-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts) for the exact contents of this config.
+See [the source code for the `recommended-type-checked-only` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts) for the exact contents.
### `strict-type-checked-only`
@@ -475,7 +485,7 @@ module.exports = {
};
```
-See [`configs/strict-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts) for the exact contents of this config.
+See [the source code for the `strict-type-checked-only` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts) for the exact contents.
:::warning
This configuration is not considered "stable" under Semantic Versioning (semver).
@@ -493,7 +503,7 @@ module.exports = {
};
```
-See [`configs/stylistic-type-checked-only.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts) for the exact contents of this config.
+See [the source code for the `stylistic-type-checked-only` config](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts) for the exact contents.
## Suggesting Configuration Changes
diff --git a/docs/users/What_About_Formatting.mdx b/docs/users/What_About_Formatting.mdx
index a070fdfccfb2..ace2aa4ebd97 100644
--- a/docs/users/What_About_Formatting.mdx
+++ b/docs/users/What_About_Formatting.mdx
@@ -50,11 +50,12 @@ Using this config by adding it to the end of your `extends`:
// @ts-check
import eslint from '@eslint/js';
+import { defineConfig } from 'eslint/config';
import someOtherConfig from 'eslint-config-other-configuration-that-enables-formatting-rules';
import prettierConfig from 'eslint-config-prettier';
import tseslint from 'typescript-eslint';
-export default tseslint.config(
+export default defineConfig(
eslint.configs.recommended,
tseslint.configs.recommended,
someOtherConfig,
diff --git a/eslint-suppressions.json b/eslint-suppressions.json
new file mode 100644
index 000000000000..eddbd9cba3f6
--- /dev/null
+++ b/eslint-suppressions.json
@@ -0,0 +1,97 @@
+{
+ "packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 26
+ }
+ },
+ "packages/eslint-plugin/tests/rules/dot-notation.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 1
+ }
+ },
+ "packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-case-insensitive-order.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 4
+ }
+ },
+ "packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-order.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 4
+ }
+ },
+ "packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 12
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 12
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-invalid-this.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 43
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-loop-func.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 2
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-this-alias.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 14
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 44
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-unnecessary-template-expression.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 1
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-unsafe-enum-comparison.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 2
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 154
+ }
+ },
+ "packages/eslint-plugin/tests/rules/no-useless-empty-export.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 9
+ }
+ },
+ "packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 42
+ }
+ },
+ "packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 17
+ }
+ },
+ "packages/eslint-plugin/tests/rules/return-await.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 1
+ }
+ },
+ "packages/eslint-plugin/tests/rules/sort-type-constituents.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 4
+ }
+ },
+ "packages/eslint-plugin/tests/rules/unbound-method.test.ts": {
+ "@typescript-eslint/internal/no-dynamic-tests": {
+ "count": 3
+ }
+ }
+}
diff --git a/eslint.config.mjs b/eslint.config.mjs
index 6ffdaa9831a3..f4c3143af22e 100644
--- a/eslint.config.mjs
+++ b/eslint.config.mjs
@@ -1,9 +1,9 @@
// @ts-check
+import eslintCommentsPlugin from '@eslint-community/eslint-plugin-eslint-comments/configs';
import { fixupConfigRules, fixupPluginRules } from '@eslint/compat';
import { FlatCompat } from '@eslint/eslintrc';
import eslint from '@eslint/js';
-import eslintCommentsPlugin from '@eslint-community/eslint-plugin-eslint-comments/configs';
import tseslintInternalPlugin from '@typescript-eslint/eslint-plugin-internal';
import vitestPlugin from '@vitest/eslint-plugin';
import eslintPluginPlugin from 'eslint-plugin-eslint-plugin';
@@ -15,6 +15,7 @@ import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import regexpPlugin from 'eslint-plugin-regexp';
import unicornPlugin from 'eslint-plugin-unicorn';
+import { defineConfig } from 'eslint/config';
import globals from 'globals';
import url from 'node:url';
import tseslint from 'typescript-eslint';
@@ -28,9 +29,10 @@ const restrictNamedDeclarations = {
selector: 'ExportNamedDeclaration[declaration=null][source=null]',
};
-export default tseslint.config(
+export default defineConfig(
// register all of the plugins up-front
{
+ name: 'register-all-plugins',
// note - intentionally uses computed syntax to make it easy to sort the keys
/* eslint-disable no-useless-computed-key */
plugins: {
@@ -82,14 +84,13 @@ export default tseslint.config(
'packages/types/src/generated/**/*.ts',
// Playground types downloaded from the web
'packages/website/src/vendor/',
- // see the file header in eslint-base.test.js for more info
- 'packages/rule-tester/tests/eslint-base/',
],
+ name: 'global-ignores',
},
// extends ...
eslintCommentsPlugin.recommended,
- eslint.configs.recommended,
+ { name: `${eslint.meta.name}/recommended`, ...eslint.configs.recommended },
tseslint.configs.strictTypeChecked,
tseslint.configs.stylisticTypeChecked,
jsdocPlugin.configs['flat/recommended-typescript-error'],
@@ -108,6 +109,7 @@ export default tseslint.config(
},
},
linterOptions: { reportUnusedDisableDirectives: 'error' },
+ name: 'base-config',
rules: {
//
// our plugin :D
@@ -233,10 +235,13 @@ export default tseslint.config(
'no-lonely-if': 'error',
'no-mixed-operators': 'error',
'no-process-exit': 'error',
+ 'no-unassigned-vars': 'error',
'no-unreachable-loop': 'error',
+ 'no-useless-assignment': 'error',
'no-useless-call': 'error',
'no-useless-computed-key': 'error',
'no-useless-concat': 'error',
+ 'no-useless-rename': 'error',
'no-var': 'error',
'no-void': ['error', { allowAsStatement: true }],
'object-shorthand': 'error',
@@ -316,6 +321,7 @@ export default tseslint.config(
'jsdoc/tag-lines': 'off',
'regexp/no-dupe-disjunctions': 'error',
+ 'regexp/no-missing-g-flag': 'error',
'regexp/no-useless-character-class': 'error',
'regexp/no-useless-flag': 'error',
'regexp/no-useless-lazy': 'error',
@@ -345,6 +351,7 @@ export default tseslint.config(
{
extends: [tseslint.configs.disableTypeChecked],
files: ['**/*.js'],
+ name: 'js-files-only',
rules: {
// turn off other type-aware rules
'@typescript-eslint/internal/no-poorly-typed-ts-props': 'off',
@@ -360,37 +367,44 @@ export default tseslint.config(
// test file specific configuration
{
+ extends: [
+ vitestPlugin.configs.env,
+ {
+ rules: {
+ '@typescript-eslint/no-empty-function': [
+ 'error',
+ { allow: ['arrowFunctions'] },
+ ],
+ '@typescript-eslint/no-non-null-assertion': 'off',
+ '@typescript-eslint/no-unsafe-assignment': 'off',
+ '@typescript-eslint/no-unsafe-call': 'off',
+ '@typescript-eslint/no-unsafe-member-access': 'off',
+ '@typescript-eslint/no-unsafe-return': 'off',
+ 'vitest/hoisted-apis-on-top': 'error',
+ 'vitest/no-alias-methods': 'error',
+ 'vitest/no-disabled-tests': 'error',
+ 'vitest/no-focused-tests': 'error',
+ 'vitest/no-identical-title': 'error',
+ 'vitest/no-test-prefixes': 'error',
+ 'vitest/no-test-return-statement': 'error',
+ 'vitest/prefer-describe-function-title': 'error',
+ 'vitest/prefer-each': 'error',
+ 'vitest/prefer-spy-on': 'error',
+ 'vitest/prefer-to-be': 'error',
+ 'vitest/prefer-to-contain': 'error',
+ 'vitest/prefer-to-have-length': 'error',
+ 'vitest/valid-expect': 'error',
+ },
+ settings: { vitest: { typecheck: true } },
+ },
+ ],
+
files: [
- 'packages/*/tests/**/*.{ts,tsx,cts,mts}',
+ 'packages/*/tests/**/*.?(m|c)ts?(x)',
'packages/integration-tests/tools/**/*.ts',
],
- ...vitestPlugin.configs.env,
- rules: {
- '@typescript-eslint/no-empty-function': [
- 'error',
- { allow: ['arrowFunctions'] },
- ],
- '@typescript-eslint/no-non-null-assertion': 'off',
- '@typescript-eslint/no-unsafe-assignment': 'off',
- '@typescript-eslint/no-unsafe-call': 'off',
- '@typescript-eslint/no-unsafe-member-access': 'off',
- '@typescript-eslint/no-unsafe-return': 'off',
- 'vitest/no-alias-methods': 'error',
- 'vitest/no-disabled-tests': 'error',
- 'vitest/no-focused-tests': 'error',
- 'vitest/no-identical-title': 'error',
- 'vitest/no-test-prefixes': 'error',
- 'vitest/no-test-return-statement': 'error',
- 'vitest/prefer-describe-function-title': 'error',
- 'vitest/prefer-each': 'error',
- 'vitest/prefer-spy-on': 'error',
- 'vitest/prefer-to-be': 'error',
- 'vitest/prefer-to-contain': 'error',
- 'vitest/prefer-to-have-length': 'error',
- 'vitest/valid-expect': 'error',
- },
- settings: { vitest: { typecheck: true } },
},
+
{
files: ['packages/*/tests/**/vitest-custom-matchers.d.ts'],
name: 'vitest-custom-matchers-declaration-files',
@@ -403,15 +417,17 @@ export default tseslint.config(
'@typescript-eslint/no-explicit-any': 'off',
},
},
+
// plugin rule tests
{
files: [
- 'packages/eslint-plugin-internal/tests/rules/**/*.test.{ts,tsx,cts,mts}',
- 'packages/eslint-plugin-tslint/tests/rules/**/*.test.{ts,tsx,cts,mts}',
- 'packages/eslint-plugin/tests/rules/**/*.test.{ts,tsx,cts,mts}',
- 'packages/eslint-plugin/tests/eslint-rules/**/*.test.{ts,tsx,cts,mts}',
+ 'packages/eslint-plugin-internal/tests/rules/**/*.test.?(m|c)ts?(x)',
+ 'packages/eslint-plugin/tests/rules/**/*.test.?(m|c)ts?(x)',
+ 'packages/eslint-plugin/tests/eslint-rules/**/*.test.?(m|c)ts?(x)',
],
+ name: 'eslint-plugin-and-eslint-plugin-internal/test-files/rules',
rules: {
+ '@typescript-eslint/internal/no-dynamic-tests': 'error',
'@typescript-eslint/internal/plugin-test-formatting': 'error',
},
},
@@ -421,10 +437,11 @@ export default tseslint.config(
//
{
files: [
- '**/tools/**/*.{ts,tsx,cts,mts}',
- '**/tests/**/*.{ts,tsx,cts,mts}',
- 'packages/integration-tests/**/*.{ts,tsx,cts,mts}',
+ '**/tools/**/*.?(m|c)ts?(x)',
+ '**/tests/**/*.?(m|c)ts?(x)',
+ 'packages/integration-tests/**/*.?(m|c)ts?(x)',
],
+ name: 'tools-and-test-files',
rules: {
// allow console logs in tools and tests
'no-console': 'off',
@@ -432,12 +449,13 @@ export default tseslint.config(
},
{
files: [
- 'eslint.config.{js,cjs,mjs}',
+ 'eslint.config.mjs',
'knip.ts',
'packages/*/src/index.ts',
'vitest.config.mts',
'packages/*/vitest.config.mts',
],
+ name: 'no-default-export',
rules: {
// requirement
'import/no-default-export': 'off',
@@ -449,26 +467,28 @@ export default tseslint.config(
//
{
- extends: [eslintPluginPlugin.configs['flat/recommended']],
+ extends: [eslintPluginPlugin.configs.recommended],
files: [
- 'packages/eslint-plugin-internal/**/*.{ts,tsx,cts,mts}',
- 'packages/eslint-plugin-tslint/**/*.{ts,tsx,cts,mts}',
- 'packages/eslint-plugin/**/*.{ts,tsx,cts,mts}',
+ 'packages/eslint-plugin-internal/**/*.?(m|c)ts?(x)',
+ 'packages/eslint-plugin/**/*.?(m|c)ts?(x)',
],
+ name: 'eslint-plugin-and-eslint-plugin-internal',
rules: {
'@typescript-eslint/internal/no-typescript-estree-import': 'error',
+ // TODO (43081j): maybe enable these one day?
+ 'eslint-plugin/no-meta-replaced-by': 'off',
+ 'eslint-plugin/require-meta-default-options': 'off',
},
},
{
files: [
- 'packages/eslint-plugin-internal/src/rules/**/*.{ts,tsx,cts,mts}',
- 'packages/eslint-plugin-tslint/src/rules/**/*.{ts,tsx,cts,mts}',
- 'packages/eslint-plugin/src/configs/**/*.{ts,tsx,cts,mts}',
- 'packages/typescript-eslint/src/configs/**/*.{ts,tsx,cts,mts}',
- 'packages/core/src/configs/**/*.{ts,tsx,cts,mts}',
- 'packages/eslint-plugin/src/rules/**/*.{ts,tsx,cts,mts}',
+ 'packages/eslint-plugin-internal/src/rules/**/*.?(m|c)ts?(x)',
+ 'packages/eslint-plugin/src/configs/**/*.?(m|c)ts?(x)',
+ 'packages/typescript-eslint/src/configs/**/*.?(m|c)ts?(x)',
+ 'packages/eslint-plugin/src/rules/**/*.?(m|c)ts?(x)',
],
+ name: 'configs-and-rules',
rules: {
'eslint-plugin/no-property-in-node': [
'error',
@@ -500,6 +520,7 @@ export default tseslint.config(
},
{
files: ['packages/eslint-plugin/src/rules/index.ts'],
+ name: 'eslint-plugin/source-files/rules-index-file',
rules: {
// enforce alphabetical ordering
'import/order': ['error', { alphabetize: { order: 'asc' } }],
@@ -513,10 +534,10 @@ export default tseslint.config(
{
files: [
- 'packages/scope-manager/src/lib/*.{ts,tsx,cts,mts}',
- 'packages/eslint-plugin/src/configs/*.{ts,tsx,cts,mts}',
- 'packages/core/src/configs/*.{ts,tsx,cts,mts}',
+ 'packages/scope-manager/src/lib/*.?(m|c)ts?(x)',
+ 'packages/eslint-plugin/src/configs/*.?(m|c)ts?(x)',
],
+ name: 'generated-files',
rules: {
'@typescript-eslint/internal/no-poorly-typed-ts-props': 'off',
'@typescript-eslint/internal/no-typescript-default-import': 'off',
@@ -529,15 +550,27 @@ export default tseslint.config(
//
{
- files: ['packages/ast-spec/src/**/*.{ts,tsx,cts,mts}'],
+ files: ['packages/ast-spec/src/**/*.?(m|c)ts?(x)'],
+ name: 'ast-spec/source-files',
rules: {
// disallow ALL unused vars
'@typescript-eslint/no-unused-vars': ['error', { caughtErrors: 'all' }],
'@typescript-eslint/sort-type-constituents': 'error',
+
+ 'perfectionist/sort-interfaces': [
+ 'error',
+ {
+ customGroups: {
+ first: ['type'],
+ },
+ groups: ['first', 'unknown'],
+ },
+ ],
},
},
{
- files: ['packages/ast-spec/**/*.{ts,tsx,cts,mts}'],
+ files: ['packages/ast-spec/**/*.?(m|c)ts?(x)'],
+ name: 'ast-spec',
rules: {
'no-restricted-imports': [
'error',
@@ -559,19 +592,25 @@ export default tseslint.config(
jsxA11yPlugin.flatConfigs.recommended,
// https://github.com/facebook/react/pull/30774
// @ts-expect-error -- Temporary types incompatibility pending flat config support
- reactPlugin.configs.flat.recommended,
- // https://github.com/facebook/react/pull/30774
- // @ts-expect-error -- Temporary types incompatibility pending flat config support
- fixupConfigRules(compat.config(reactHooksPlugin.configs.recommended)),
+ { name: 'react/recommended', ...reactPlugin.configs.flat.recommended },
+ fixupConfigRules([
+ {
+ name: 'react-hooks/recommended',
+ // https://github.com/facebook/react/pull/30774
+ // @ts-expect-error -- Temporary types incompatibility pending flat config support
+ ...compat.config(reactHooksPlugin.configs.recommended)[0],
+ },
+ ]),
],
- files: ['packages/website/**/*.{ts,tsx,mts,cts,js,jsx}'],
+ files: ['packages/website/**/*.?(c|m)[tj]s?(x)'],
+ name: 'website',
rules: {
'@typescript-eslint/internal/prefer-ast-types-enum': 'off',
'import/no-default-export': 'off',
+ 'react-hooks/exhaustive-deps': 'warn', // TODO: enable it later
'react/jsx-no-target-blank': 'off',
'react/no-unescaped-entities': 'off',
'react/prop-types': 'off',
- 'react-hooks/exhaustive-deps': 'warn', // TODO: enable it later
},
settings: {
react: {
@@ -580,7 +619,8 @@ export default tseslint.config(
},
},
{
- files: ['packages/website/src/**/*.{ts,tsx,cts,mts}'],
+ files: ['packages/website/src/**/*.?(m|c)ts?(x)'],
+ name: 'website/source-files',
rules: {
'import/no-default-export': 'off',
// allow console logs in the website to help with debugging things in production
@@ -588,10 +628,8 @@ export default tseslint.config(
},
},
{
- files: [
- 'packages/website-eslint/src/mock/**/*.js',
- '**/*.d.{ts,tsx,cts,mts}',
- ],
+ files: ['packages/website-eslint/src/mock/**/*.js', '**/*.d.?(m|c)ts?(x)'],
+ name: 'website/source-files/mocks-and-declaration-files',
rules: {
// mocks and declaration files have to mirror their original package
'import/no-default-export': 'off',
@@ -604,9 +642,29 @@ export default tseslint.config(
'packages/eslint-plugin/src/configs/flat/*',
'packages/scope-manager/src/configs/*',
],
+ name: 'all-files',
rules: {
'@typescript-eslint/sort-type-constituents': 'off',
- 'perfectionist/sort-classes': 'error',
+ 'perfectionist/sort-classes': [
+ 'error',
+ {
+ groups: [
+ 'index-signature',
+ 'static-property',
+ 'static-block',
+ ['protected-property', 'protected-accessor-property'],
+ ['private-property', 'private-accessor-property'],
+ ['property', 'accessor-property'],
+ 'constructor',
+ 'static-method',
+ 'protected-method',
+ 'private-method',
+ 'method',
+ ['get-method', 'set-method'],
+ 'unknown',
+ ],
+ },
+ ],
'perfectionist/sort-enums': 'off',
'perfectionist/sort-objects': 'error',
'perfectionist/sort-union-types': [
@@ -625,7 +683,7 @@ export default tseslint.config(
'error',
{
customGroups: {
- first: ['type'],
+ first: ['^type$'],
},
groups: ['first', 'unknown'],
},
@@ -637,15 +695,16 @@ export default tseslint.config(
'packages/eslint-plugin/src/rules/*.ts',
'packages/eslint-plugin-internal/src/rules/*.ts',
],
+ name: 'eslint-plugin-and-eslint-plugin-internal/source-files/rules',
rules: {
'perfectionist/sort-objects': [
'error',
{
customGroups: {
- first: ['loc', 'name', 'node', 'type'],
- fourth: ['fix'],
- second: ['meta', 'messageId', 'start'],
- third: ['defaultOptions', 'data', 'end'],
+ first: ['^loc$', '^name$', '^node$', '^type$'],
+ fourth: ['^fix$'],
+ second: ['^meta$', '^messageId$', '^start$'],
+ third: ['^defaultOptions$', '^data$', '^end$'],
},
groups: ['first', 'second', 'third', 'fourth', 'unknown'],
},
@@ -654,25 +713,27 @@ export default tseslint.config(
},
{
files: ['packages/eslint-plugin/tests/rules/*.test.ts'],
+ name: 'eslint-plugin-rules-test-files',
rules: {
'perfectionist/sort-objects': [
'error',
{
- customGroups: { top: ['valid'] },
- groups: ['top', 'unknown'],
+ customGroups: { skip: ['^skip$'], top: ['^valid$'] },
+ groups: ['top', 'skip', 'unknown'],
},
],
},
},
{
files: ['packages/typescript-estree/src/**/*.ts'],
+ name: 'typescript-estree/source-files',
rules: {
'perfectionist/sort-objects': [
'error',
{
customGroups: {
- first: ['type'],
- second: ['loc', 'range'],
+ first: ['^type$'],
+ second: ['^loc$', '^range$'],
},
groups: ['first', 'second'],
},
diff --git a/knip.ts b/knip.ts
index 4ab6787999d8..517eedc8bd68 100644
--- a/knip.ts
+++ b/knip.ts
@@ -2,6 +2,7 @@ import type { KnipConfig } from 'knip' with { 'resolution-mode': 'import' };
export default {
rules: {
+ binaries: 'off',
classMembers: 'off',
duplicates: 'off',
enumMembers: 'off',
@@ -22,14 +23,17 @@ export default {
workspaces: {
'.': {
entry: ['tools/release/changelog-renderer.js', 'tools/scripts/**/*.mts'],
- ignore: ['tools/scripts/typings/typescript.d.ts', 'typings/*.d.ts'],
ignoreDependencies: [
- '@nx/js',
'@nx/workspace',
- 'make-dir',
// imported for type purposes only
'website',
],
+
+ project: [
+ 'tools/scripts/**/*.mts',
+ '!tools/scripts/typings/typescript.d.ts',
+ '!typings/*.d.ts',
+ ],
},
'packages/ast-spec': {
ignore: [
@@ -50,33 +54,40 @@ export default {
],
},
},
+
'packages/eslint-plugin': {
- ignore: [
- 'tests/fixtures/**',
- 'typings/eslint-rules.d.ts',
- 'typings/typescript.d.ts',
- ],
+ ignore: ['typings/eslint-rules.d.ts', 'typings/typescript.d.ts'],
+
+ project: ['src/**/*.ts!', 'tools/**/*.mts'],
+
+ vitest: {
+ config: ['vitest.config.mts'],
+ entry: ['tests/**/*.{bench,test,test-d}.?(c|m)ts?(x)'],
+ project: ['tests/**', '!tests/fixtures/**'],
+ },
},
+
'packages/eslint-plugin-internal': {
ignore: ['tests/fixtures/**'],
},
'packages/integration-tests': {
ignore: ['fixtures/**'],
},
- 'packages/parser': {
- ignore: ['tests/fixtures/**'],
+ 'packages/parser': {
vitest: {
config: ['vitest.config.mts'],
- entry: ['tests/lib/**/*.{bench,test,test-d}.?(c|m)ts?(x)'],
+ entry: [
+ 'tests/lib/**/*.{bench,test,test-d}.?(c|m)ts?(x)',
+ 'tests/test-utils/test-utils.ts',
+ 'tests/test-utils/ts-error-serializer.ts',
+ ],
+ project: ['tests/**', '!tests/fixtures/**'],
},
},
+
'packages/rule-tester': {
ignore: ['typings/eslint.d.ts'],
-
- mocha: {
- entry: ['tests/eslint-base/eslint-base.test.js'],
- },
},
'packages/scope-manager': {
ignore: ['tests/fixtures/**'],
@@ -103,6 +114,11 @@ export default {
],
},
},
+
+ 'packages/types': {
+ project: ['src/**/*.ts!', '!src/generated/**/*.ts'],
+ },
+
'packages/typescript-estree': {
entry: ['src/use-at-your-own-risk.ts'],
ignore: ['tests/fixtures/**', 'typings/typescript.d.ts'],
@@ -131,6 +147,7 @@ export default {
'src/components/**/*.tsx',
// used by Docusaurus
+ 'plugins/recent-blog-posts/index.ts',
'src/theme/**/*.tsx',
'src/theme/prism-include-languages.js',
],
@@ -158,7 +175,6 @@ export default {
'@docusaurus/useDocusaurusContext',
'@docusaurus/useBaseUrl',
'@docusaurus/BrowserOnly',
- '@docusaurus/module-type-aliases',
'@generated/docusaurus.config',
'^@site/.*',
'^@theme/.*',
@@ -182,7 +198,7 @@ export default {
],
ignoreDependencies: [
// virtual module
- 'vt',
+ 'vt:*',
],
},
'tools/dummypkg': {},
diff --git a/nx.json b/nx.json
index af3c7dc74658..b0ac6867484c 100644
--- a/nx.json
+++ b/nx.json
@@ -1,10 +1,9 @@
{
"$schema": "./node_modules/nx/schemas/nx-schema.json",
- "nxCloudAccessToken": "YjIzMmMxMWItMjhiMS00NWY2LTk1NWYtYWU3YWQ0YjE4YjBlfHJlYWQ=",
"plugins": [
{
"plugin": "@nx/js/typescript",
- "exclude": [".", "packages/integration-tests/fixtures/**"],
+ "exclude": ["packages/integration-tests/fixtures/**"],
"options": {
"typecheck": {
"targetName": "typecheck"
@@ -17,17 +16,10 @@
},
{
"plugin": "@nx/vite/plugin",
- "include": ["packages/*"],
+ "exclude": ["*"],
"options": {
- "buildTargetName": "vite:build",
"testTargetName": "test",
- "serveTargetName": "serve",
- "devTargetName": "dev",
- "previewTargetName": "preview",
- "serveStaticTargetName": "serve-static",
- "typecheckTargetName": "vite:typecheck",
- "buildDepsTargetName": "vite:build-deps",
- "watchDepsTargetName": "vite:watch-deps"
+ "typecheckTargetName": "vite:typecheck"
}
}
],
@@ -52,59 +44,21 @@
}
},
"targetDefaults": {
- "build": {
- "dependsOn": ["^build"],
- "inputs": ["production", "^production"],
- "outputs": ["{projectRoot}/dist"],
+ "lint": {
+ "cache": false,
+ "dependsOn": ["eslint-plugin-internal:build", "typescript-eslint:build"],
"options": {
- "cwd": "{projectRoot}"
- },
- "cache": true
+ "cwd": "{workspaceRoot}",
+ "config": "{workspaceRoot}/eslint.config.mjs",
+ "args": ["{projectRoot}"]
+ }
},
"test": {
"dependsOn": ["^build"],
- "outputs": ["{projectRoot}/coverage"],
- "cache": true
- },
- "@nx/vite:test": {
- "dependsOn": ["^build"],
- "inputs": [
- "default",
- "^production",
- "{workspaceRoot}/vitest.config.mts",
- "{workspaceRoot}/vitest.config.base.mts",
- "{projectRoot}/vitest.config.mts"
- ],
- "outputs": ["{projectRoot}/coverage"],
- "cache": true,
"options": {
- "config": "{projectRoot}/vitest.config.mts",
- "watch": false
- }
- },
- "lint": {
- "executor": "@nx/eslint:lint",
- "dependsOn": [
- "eslint-plugin:build",
- "eslint-plugin-internal:build",
- "typescript-eslint:build"
- ],
- "inputs": [
- "default",
- "{workspaceRoot}/eslint.config.js",
- "{workspaceRoot}/eslint.config.mjs",
- {
- "dependentTasksOutputFiles": "**/*.js",
- "transitive": false
- }
- ],
- "outputs": ["{options.outputFile}"],
- "cache": true
- },
- "typecheck": {
- "dependsOn": ["types:copy-ast-spec"],
- "outputs": ["{workspaceRoot}/dist"],
- "cache": true
+ "config": "vitest.config.mts"
+ },
+ "outputs": ["{projectRoot}/coverage"]
}
},
"namedInputs": {
@@ -114,20 +68,21 @@
{
"runtime": "node -v"
},
- {
- "runtime": "echo $NETLIFY"
- },
{
"runtime": "yarn -v"
},
- "{workspaceRoot}/yarn.lock"
+ {
+ "runtime": "echo $NETLIFY"
+ }
],
"production": [
"default",
- "!{projectRoot}/**/?(*.)+(test).[jt]s?(x)?(.snap)",
+ "!{projectRoot}/**/?(*.)+(test).?(m|c)[jt]s?(x)?(.snap|.shot)",
+ "!{projectRoot}/tests",
+ "!{projectRoot}/tools",
"!{projectRoot}/tsconfig.spec.json",
- "!{projectRoot}/vitest.config.m[jt]s",
- "!{projectRoot}/src/test-setup.[jt]s"
+ "!{projectRoot}/vitest.config.mts"
]
- }
+ },
+ "nxCloudId": "60b38765e74d975e3faae5ad"
}
diff --git a/package.json b/package.json
index 2bbb81ccdede..fc18c47878f6 100644
--- a/package.json
+++ b/package.json
@@ -22,45 +22,44 @@
},
"homepage": "https://typescript-eslint.io",
"scripts": {
- "build": "npx nx run-many --target=build --exclude website --exclude website-eslint",
+ "build": "nx run-many -t build --exclude website website-eslint",
"check-clean-workspace-after-install": "git diff --quiet --exit-code",
"check-format": "prettier --check .",
"check-spelling": "cspell --config=.cspell.json \"**/*.{md,mdx,ts,mts,cts,js,cjs,mjs,tsx,jsx}\" --no-progress --show-context --show-suggestions",
- "clean": "npx nx run-many --target=clean",
- "format": "prettier --write .",
- "generate-breaking-changes": "npx nx run eslint-plugin:generate-breaking-changes",
- "generate-configs": "npx nx generate-configs",
- "generate-contributors": "npx nx generate-contributors",
- "generate-lib": "npx nx generate-lib",
- "generate-sponsors": "npx nx generate-sponsors",
- "generate-website-dts": "npx nx run website:generate-website-dts",
+ "clean": "nx run-many -t clean --parallel=20",
+ "deduplicate": "yarn-berry-deduplicate",
+ "format": "prettier --ignore-path=$PROJECT_CWD/.prettierignore --config=$PROJECT_CWD/.prettierrc.json --write $INIT_CWD",
+ "generate-breaking-changes": "nx run eslint-plugin:generate-breaking-changes",
+ "generate-configs": "tsx tools/scripts/generate-configs.mts",
+ "generate-lib": "tsx tools/scripts/generate-lib.mts",
+ "generate-sponsors": "tsx tools/scripts/generate-sponsors.mts",
+ "generate-website-dts": "nx run website:generate-website-dts",
"lint-fix": "yarn lint --fix",
"lint-markdown-fix": "yarn lint-markdown --fix",
"lint-markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore",
- "lint-stylelint": "npx nx lint website stylelint",
- "lint": "npx nx lint eslint-plugin --skip-nx-cache && npx nx run-many --target=lint --exclude eslint-plugin",
+ "lint-stylelint": "nx lint website stylelint",
+ "lint-prune-suppressions": "nx run-many -t lint --projects=eslint-plugin-internal,eslint-plugin --prune-suppressions",
+ "lint": "nx run-many -t lint",
"postinstall": "tsx tools/scripts/postinstall.mts",
- "pre-commit": "yarn lint-staged",
+ "pre-commit": "lint-staged",
"release": "tsx tools/release/release.mts",
- "start": "npx nx run website:start",
- "test": "npx nx run-many --target=test --exclude integration-tests --exclude website --exclude website-eslint",
- "test-integration": "npx nx run integration-tests:test",
- "typecheck": "npx nx run-many --target=typecheck"
+ "start": "nx run website:start",
+ "test": "nx run-many -t test --exclude integration-tests website website-eslint",
+ "test-integration": "nx run integration-tests:test",
+ "typecheck": "nx run-many -t typecheck"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"devDependencies": {
- "@actions/core": "^1.10.1",
- "@actions/github": "^6.0.0",
"@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
"@eslint/compat": "^1.2.4",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.26.0",
- "@nx/devkit": "20.7.2",
- "@nx/eslint": "20.7.2",
- "@nx/vite": "20.7.2",
- "@nx/workspace": "20.7.2",
+ "@nx/devkit": "21.4.1",
+ "@nx/js": "21.4.1",
+ "@nx/vite": "21.4.1",
+ "@nx/workspace": "21.4.1",
"@swc/core": "^1.4.12",
"@types/debug": "^4.1.12",
"@types/eslint-plugin-jsx-a11y": "^6.10.0",
@@ -70,21 +69,22 @@
"@types/yargs": "^17.0.32",
"@typescript-eslint/eslint-plugin": "workspace:^",
"@typescript-eslint/eslint-plugin-internal": "workspace:^",
+ "@typescript-eslint/parser": "workspace:^",
"@typescript-eslint/scope-manager": "workspace:^",
"@typescript-eslint/types": "workspace:^",
"@typescript-eslint/typescript-estree": "workspace:^",
"@typescript-eslint/utils": "workspace:^",
"@vitest/coverage-v8": "^3.1.3",
- "@vitest/eslint-plugin": "^1.1.44",
+ "@vitest/eslint-plugin": "^1.3.9",
"console-fail-test": "^0.5.0",
"cross-fetch": "^4.0.0",
"cspell": "^9.0.0",
"eslint": "^9.26.0",
- "eslint-plugin-eslint-plugin": "^6.3.1",
- "eslint-plugin-import": "^2.31.0",
+ "eslint-plugin-eslint-plugin": "^7.0.0",
+ "eslint-plugin-import": "^2.32.0",
"eslint-plugin-jsdoc": "^50.5.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
- "eslint-plugin-perfectionist": "^3.9.1",
+ "eslint-plugin-perfectionist": "^4.12.3",
"eslint-plugin-react": "^7.37.3",
"eslint-plugin-react-hooks": "^5.0.0",
"eslint-plugin-regexp": "^2.7.0",
@@ -92,22 +92,20 @@
"execa": "7.2.0",
"globals": "^16.0.0",
"husky": "^9.1.4",
- "jiti": "2.4.2",
"knip": "^5.41.1",
"lint-staged": "^15.2.2",
- "make-dir": "^4.0.0",
- "markdownlint-cli": "^0.44.0",
- "nx": "20.7.2",
- "prettier": "3.5.0",
- "pretty-format": "^29.7.0",
+ "markdownlint-cli": "^0.45.0",
+ "nx": "21.4.1",
+ "prettier": "3.6.2",
"rimraf": "^5.0.5",
"semver": "7.7.0",
"tsx": "*",
- "typescript": ">=4.8.4 <5.9.0",
+ "typescript": ">=4.8.4 <6.0.0",
"typescript-eslint": "workspace:^",
"vite": "^6.3.5",
"vitest": "^3.1.3",
- "yargs": "17.7.2"
+ "yargs": "17.7.2",
+ "yarn-berry-deduplicate": "^6.1.3"
},
"resolutions": {
"@types/eslint-scope": "link:./tools/dummypkg",
@@ -116,15 +114,52 @@
"@types/node": "^22.0.0",
"@types/react": "^18.2.14",
"eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch",
- "prettier": "3.5.0",
- "pretty-format": "^29",
"react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch",
- "tmp": "0.2.1",
"tsx": "^4.7.2",
- "typescript": "5.8.2"
+ "typescript": "5.9.2"
},
"packageManager": "yarn@3.8.2",
"nx": {
- "includedScripts": []
+ "name": "repo",
+ "includedScripts": [
+ "generate-configs",
+ "generate-lib",
+ "generate-sponsors"
+ ],
+ "targets": {
+ "generate-configs": {
+ "dependsOn": [
+ "eslint-plugin:build"
+ ]
+ },
+ "generate-lib": {
+ "dependsOn": [
+ "typescript-eslint:build",
+ "eslint-plugin-internal:build"
+ ]
+ },
+ "// These targets are used for repo level utils and checking repo files which do not belong to specific published packages": {},
+ "typecheck": {
+ "command": "tsc -b tsconfig.repo-config-files.json",
+ "dependsOn": [
+ "types:copy-ast-spec"
+ ],
+ "outputs": [
+ "{workspaceRoot}/dist"
+ ],
+ "cache": true
+ },
+ "lint": {
+ "command": "eslint",
+ "options": {
+ "cache": true,
+ "ignore-pattern": "packages"
+ },
+ "cache": false
+ },
+ "clean": {
+ "command": "rimraf dist/ coverage/ .eslintcache"
+ }
+ }
}
}
diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md
index 8ed2bd1083df..057df049c10e 100644
--- a/packages/ast-spec/CHANGELOG.md
+++ b/packages/ast-spec/CHANGELOG.md
@@ -1,3 +1,222 @@
+## 8.46.4 (2025-11-10)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.3 (2025-11-03)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.2 (2025-10-20)
+
+### 🩹 Fixes
+
+- **typescript-estree:** forbid invalid modifiers in object methods ([#11689](https://github.com/typescript-eslint/typescript-eslint/pull/11689))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.1 (2025-10-13)
+
+### 🩹 Fixes
+
+- **ast-spec:** cleanup `TSLiteralType` ([#11624](https://github.com/typescript-eslint/typescript-eslint/pull/11624))
+
+### ❤️ Thank You
+
+- Abraham Guo
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.0 (2025-10-06)
+
+### 🚀 Features
+
+- **typescript-estree:** private identifiers can only appear on LHS of in expressions ([#9232](https://github.com/typescript-eslint/typescript-eslint/pull/9232))
+
+### 🩹 Fixes
+
+- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657))
+- **typescript-estree:** forbid `abstract` modifier in object methods ([#11656](https://github.com/typescript-eslint/typescript-eslint/pull/11656))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- Joshua Chen
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.45.0 (2025-09-29)
+
+### 🩹 Fixes
+
+- **ast-spec:** narrow ArrowFunctionExpression.generator to false ([#11636](https://github.com/typescript-eslint/typescript-eslint/pull/11636))
+
+### ❤️ Thank You
+
+- Josh Goldberg ✨
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.44.1 (2025-09-22)
+
+### 🩹 Fixes
+
+- **typescript-estree:** forbid class property with name `constructor` ([#11590](https://github.com/typescript-eslint/typescript-eslint/pull/11590))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.44.0 (2025-09-15)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.43.0 (2025-09-08)
+
+### 🚀 Features
+
+- **typescript-estree:** disallow empty type parameter/argument lists ([#11563](https://github.com/typescript-eslint/typescript-eslint/pull/11563))
+
+### ❤️ Thank You
+
+- Kirk Waiblinger @kirkwaiblinger
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.42.0 (2025-09-02)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.41.0 (2025-08-25)
+
+### 🩹 Fixes
+
+- **deps:** update dependency prettier to v3.6.2 ([#11496](https://github.com/typescript-eslint/typescript-eslint/pull/11496))
+- **deps:** update babel monorepo ([#11174](https://github.com/typescript-eslint/typescript-eslint/pull/11174))
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.40.0 (2025-08-18)
+
+### 🚀 Features
+
+- **typescript-estree:** forbid invalid keys in `EnumMember` ([#11232](https://github.com/typescript-eslint/typescript-eslint/pull/11232))
+
+### 🩹 Fixes
+
+- **typescript-estree:** correct range of import assertion with trailing comma ([#11478](https://github.com/typescript-eslint/typescript-eslint/pull/11478))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- Kirk Waiblinger @kirkwaiblinger
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.39.1 (2025-08-11)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.39.0 (2025-08-04)
+
+### 🚀 Features
+
+- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445))
+
+### ❤️ Thank You
+
+- Brad Zacher @bradzacher
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.38.0 (2025-07-21)
+
+### 🚀 Features
+
+- **typescript-estree:** forbid optional chain in `TemplateTaggedLiteral` ([#11391](https://github.com/typescript-eslint/typescript-eslint/pull/11391))
+
+### ❤️ Thank You
+
+- MK @asdf93074
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.37.0 (2025-07-14)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.36.0 (2025-07-07)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.35.1 (2025-06-30)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.35.0 (2025-06-23)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.34.1 (2025-06-16)
+
+### 🩹 Fixes
+
+- **typescript-estree:** emit a Literal instead of Identifier for constructor when the identifier is a string ([#11299](https://github.com/typescript-eslint/typescript-eslint/pull/11299))
+
+### ❤️ Thank You
+
+- Tao
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.34.0 (2025-06-09)
+
+### 🩹 Fixes
+
+- **typescript-estree:** add validation to interface extends ([#11271](https://github.com/typescript-eslint/typescript-eslint/pull/11271))
+- **typescript-estree:** change the token type of `null` from `Keyword` to `Null` ([#11283](https://github.com/typescript-eslint/typescript-eslint/pull/11283))
+
+### ❤️ Thank You
+
+- Tao
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.33.1 (2025-06-02)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.33.0 (2025-05-26)
+
+This was a version bump only for ast-spec to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
## 8.32.1 (2025-05-12)
This was a version bump only for ast-spec to align it with other projects, there were no code changes.
diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json
index a2c017d52f42..98f50fdac96c 100644
--- a/packages/ast-spec/package.json
+++ b/packages/ast-spec/package.json
@@ -1,6 +1,6 @@
{
"name": "@typescript-eslint/ast-spec",
- "version": "8.32.1",
+ "version": "8.46.4",
"description": "Complete specification for the TypeScript-ESTree AST",
"private": true,
"keywords": [
@@ -31,13 +31,13 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
- "build": "tsc -b tsconfig.build.json && api-extractor run --local --config=$INIT_CWD/api-extractor.json",
+ "build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
"clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"",
- "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
- "lint": "npx nx lint",
- "test": "vitest --run --config=$INIT_CWD/vitest.config.mts",
- "check-types": "npx nx typecheck"
+ "format": "yarn run -T format",
+ "lint": "yarn run -BT nx lint",
+ "test": "yarn run -BT nx test",
+ "typecheck": "yarn run -BT nx typecheck"
},
"funding": {
"type": "opencollective",
@@ -47,6 +47,7 @@
"@babel/code-frame": "^7.24.2",
"@babel/core": "^7.24.4",
"@babel/eslint-parser": "^7.24.1",
+ "@babel/parser": "^7.24.1",
"@microsoft/api-extractor": "^7.47.11",
"@types/babel__code-frame": "^7.0.6",
"@types/babel__core": "^7.20.5",
@@ -56,9 +57,47 @@
"@vitest/utils": "^3.1.3",
"eslint": "*",
"glob": "*",
- "prettier": "^3.2.5",
"rimraf": "*",
"typescript": "*",
"vitest": "^3.1.3"
+ },
+ "nx": {
+ "name": "ast-spec",
+ "implicitDependencies": [
+ "!typescript-estree"
+ ],
+ "includedScripts": [
+ "clean",
+ "clean-fixtures"
+ ],
+ "targets": {
+ "build": {
+ "command": "tsc -b tsconfig.build.json && api-extractor run --local --config=api-extractor.json",
+ "options": {
+ "cwd": "{projectRoot}"
+ },
+ "outputs": [
+ "{projectRoot}/dist/**/*.ts"
+ ],
+ "cache": true
+ },
+ "lint": {
+ "command": "eslint"
+ },
+ "typecheck": {
+ "outputs": [
+ "{workspaceRoot}/dist",
+ "{projectRoot}/dist"
+ ],
+ "dependsOn": [
+ "typescript-estree:build"
+ ]
+ },
+ "test": {
+ "dependsOn": [
+ "typecheck"
+ ]
+ }
+ }
}
}
diff --git a/packages/ast-spec/project.json b/packages/ast-spec/project.json
deleted file mode 100644
index 5e0432b40f39..000000000000
--- a/packages/ast-spec/project.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "ast-spec",
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
- "projectType": "library",
- "implicitDependencies": ["!typescript-estree"],
- "root": "packages/ast-spec",
- "sourceRoot": "packages/ast-spec/src",
- "targets": {
- "build": {
- "outputs": ["{projectRoot}/dist/**/*.ts"]
- },
- "lint": {
- "executor": "@nx/eslint:lint",
- "outputs": ["{options.outputFile}"]
- },
- "test": {
- "executor": "@nx/vite:test",
- "dependsOn": ["typecheck"]
- },
- "typecheck": {
- "dependsOn": ["typescript-estree:build"]
- }
- }
-}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/fixture.ts
new file mode 100644
index 000000000000..bd45e0a8a625
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ abstract constructor() { }
+}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..8a67121b79c1
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-constructor > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | abstract constructor() { }
+ | ^^^^^^^^ 'abstract' modifier can only appear on a class, method, or property declaration.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..b78e289f0c55
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-constructor > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | abstract constructor() { }
+ | ^ Method 'constructor' cannot have an implementation because it is marked abstract. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..dbd705849820
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-constructor/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-constructor > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/fixture.ts
new file mode 100644
index 000000000000..0ac2bfca1dfd
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ abstract get getter() { }
+}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..d7c0c1bcc98a
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-getter-with-implementation > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | abstract get getter() { }
+ | ^^^^^^ An abstract accessor cannot have an implementation.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..fe0fe6660cf0
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-getter-with-implementation > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | abstract get getter() { }
+ | ^ Method 'getter' cannot have an implementation because it is marked abstract. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..748024e02a80
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-getter-with-implementation/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-getter-with-implementation > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/fixture.ts
new file mode 100644
index 000000000000..80fe821c5d29
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ abstract method() { }
+}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..a65c609416d4
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-method-with-implementation > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | abstract method() { }
+ | ^^^^^^ Method 'method' cannot have an implementation because it is marked abstract.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..c345ce0399ec
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-method-with-implementation > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | abstract method() { }
+ | ^ Method 'method' cannot have an implementation because it is marked abstract. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..fff6cbc7c6ce
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-method-with-implementation/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-method-with-implementation > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/fixture.ts
new file mode 100644
index 000000000000..fa7888c34cc9
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ abstract set setter(v) { }
+}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..febb4fe5dcde
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-setter-with-implementation > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | abstract set setter(v) { }
+ | ^^^^^^ An abstract accessor cannot have an implementation.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..c45ee034b7c3
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-setter-with-implementation > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | abstract set setter(v) { }
+ | ^ Method 'setter' cannot have an implementation because it is marked abstract. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..1e222f7febc0
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/abstract-setter-with-implementation/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > abstract-setter-with-implementation > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot
index 0e64270303c2..ac409fa55ba0 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/export-missing-name/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > export-missing-name > Babel - Error`]
-SyntaxError: A class name is required. (1:13)
+BabelError
+> 1 | export class { }
+ | ^ A class name is required. (1:13)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot
index 56fdd942ce87..c5774c25f7ed 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > implements-non-identifier > Babel - Error`]
-SyntaxError: Unexpected token (1:21)
+BabelError
+> 1 | class Foo implements 'thing' {}
+ | ^ Unexpected token (1:21)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot
index 2dec9742a619..cc16e7c77a49 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-body > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:9)
+BabelError
+> 1 | class Foo;
+ | ^ Unexpected token, expected "{" (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-TSESTree-Error.shot
index 697d82b45d5b..1d0cd5a24a14 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-extends-type-param > TSESTree - Error`]
-NO ERROR
+TSError
+> 1 | class C extends D<> {}
+ | ^^ Type argument list cannot be empty.
+ 2 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot
index a61921db5773..e3f5ef8b8219 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-extends-type-param > Babel - Error`]
-SyntaxError: Type argument list cannot be empty. (1:17)
+BabelError
+> 1 | class C extends D<> {}
+ | ^ Type argument list cannot be empty. (1:17)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/3-Alignment-Error.shot
index 5797ee061aed..773b51b14128 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-extends-type-param > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/fixture.ts b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/fixture.ts
new file mode 100644
index 000000000000..14098aa86e59
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/fixture.ts
@@ -0,0 +1 @@
+class C< /* empty */ > {}
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..a14c3c54cac7
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ missing-type-param Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (1:7)]`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..25404a5d9562
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param-with-comment > TSESTree - Error`]
+TSError
+> 1 | class C< /* empty */ > {}
+ | ^^^^^^^^^^^^^^^ Type parameter list cannot be empty.
+ 2 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..49567ea7a7b5
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures declaration ClassDeclaration _error_ missing-type-param Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..d50c7992d392
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param-with-comment > Babel - Error`]
+BabelError
+> 1 | class C< /* empty */ > {}
+ | ^ Type parameter list cannot be empty. (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..0d5857532795
--- /dev/null
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param-with-comment/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param-with-comment > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
index 656005eda876..241ee319116c 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param > TSESTree - Error`]
-NO ERROR
+TSError
+> 1 | class C<> {}
+ | ^^ Type parameter list cannot be empty.
+ 2 |
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
index 2c265df14f59..c2f76a98fb66 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (1:7)
+BabelError
+> 1 | class C<> {}
+ | ^ Type parameter list cannot be empty. (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
index 1a694a67920e..9d29521b804d 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > missing-type-param > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
index dca1aa8e5e3c..c5b89c0e5107 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > non-identifier-name > Babel - Error`]
-SyntaxError: A class name is required. (1:6)
+BabelError
+> 1 | class 'Foo' {}
+ | ^ A class name is required. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
index 2909d642ff49..2b75e5f4601f 100644
--- a/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ClassDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ClassDeclaration > _error_ > non-identifier-type-param > Babel - Error`]
-SyntaxError: Unexpected token (1:8)
+BabelError
+> 1 | class C<1> {}
+ | ^ Unexpected token (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot
index 6efe9b3b7d81..3ec3216dc914 100644
--- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/missing-source/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportAllDeclaration > _error_ > missing-source > Babel - Error`]
-SyntaxError: Unexpected token (1:13)
+BabelError
+> 1 | export * from;
+ | ^ Unexpected token (1:13)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot
index f0134190e9c9..00afdab72fba 100644
--- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportAllDeclaration > _error_ > non-string-source > Babel - Error`]
-SyntaxError: Unexpected token (1:14)
+BabelError
+> 1 | export * from module;
+ | ^ Unexpected token (1:14)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot
index 47bab5896cfe..491a0644ae9d 100644
--- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/enum/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > enum > Babel - Error`]
-SyntaxError: Unexpected reserved word 'enum'. (1:15)
+BabelError
+> 1 | export default enum Foo {}
+ | ^ Unexpected reserved word 'enum'. (1:15)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot
index 835d3e6b6496..c66fdce48dd5 100644
--- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/namespace/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > namespace > Babel - Error`]
-SyntaxError: Missing semicolon. (1:24)
+BabelError
+> 1 | export default namespace Foo {}
+ | ^ Missing semicolon. (1:24)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot
index e9a8f373d0e6..ed1501e269f3 100644
--- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/type-alias/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > type-alias > Babel - Error`]
-SyntaxError: Missing semicolon. (1:19)
+BabelError
+> 1 | export default type Foo = 1;
+ | ^ Missing semicolon. (1:19)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot
index be123c950dde..3b031210e7bc 100644
--- a/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportDefaultDeclaration/fixtures/_error_/variable-declaration/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportDefaultDeclaration > _error_ > variable-declaration > Babel - Error`]
-SyntaxError: Only expressions, functions or classes are allowed as the `default` export. (1:15)
+BabelError
+> 1 | export default const x = 1;
+ | ^ Only expressions, functions or classes are allowed as the `default` export. (1:15)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot
index 30b0ef777673..c2035556e868 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > anonymous-class > Babel - Error`]
-SyntaxError: A class name is required. (1:13)
+BabelError
+> 1 | export class {}
+ | ^ A class name is required. (1:13)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot
index ff3be5f420c9..1a9032ea5498 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-function-expression/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > anonymous-function-expression > Babel - Error`]
-SyntaxError: Unexpected token (1:16)
+BabelError
+> 1 | export function () {}
+ | ^ Unexpected token (1:16)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot
index f8f9efcc5de6..e475f632d493 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/arrow-function/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > arrow-function > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:7)
+BabelError
+> 1 | export () => {};
+ | ^ Unexpected token, expected "{" (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot
index 89b0658efc67..75d9c00ff13a 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > assertion > Babel - Error`]
-SyntaxError: A JSON module can only be imported with `default`. (1:9)
+BabelError
+> 1 | export { foo } from 'mod' assert { type: 'json' };
+ | ^ A JSON module can only be imported with `default`. (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot
index d87d58c885c7..11121f10d40c 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-identifier-aliased-to-number-literal-with-source > Babel - Error`]
-SyntaxError: Unexpected token (1:14)
+BabelError
+> 1 | export { a as 1 } from 'mod';
+ | ^ Unexpected token (1:14)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot
index 17bc155f8d2d..6d266bf43205 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-identifier-aliased-to-number-literal-without-source > Babel - Error`]
-SyntaxError: Unexpected token (1:14)
+BabelError
+> 1 | export { a as 1 };
+ | ^ Unexpected token (1:14)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot
index c654860eb328..e749b5d25fe9 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-number-literal-with-source > Babel - Error`]
-SyntaxError: Unexpected token (1:9)
+BabelError
+> 1 | export { 1 } from 'mod';
+ | ^ Unexpected token (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot
index 27316defb9b0..e81fcdad7e08 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-number-literal-without-source > Babel - Error`]
-SyntaxError: Unexpected token (1:9)
+BabelError
+> 1 | export { 1 };
+ | ^ Unexpected token (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot
index eb3e40a2aa15..f201320ca0db 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot
@@ -1,5 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-aliased-to-identifier-without-source > Babel - Error`]
-SyntaxError: A string literal cannot be used as an exported binding without `from`.
+BabelError
+> 1 | export { 'a a' as b };
+ | ^ A string literal cannot be used as an exported binding without `from`.
- Did you mean `export { 'a a' as 'b' } from 'some-module'`? (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot
index e91248efe601..8ab798e5cbab 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-aliased-to-number-literal-without-source > Babel - Error`]
-SyntaxError: Unexpected token (1:18)
+BabelError
+> 1 | export { 'a a' as 1 };
+ | ^ Unexpected token (1:18)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot
index 4ca061f40171..c8830b8a6fd3 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot
@@ -1,5 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-aliased-to-string-literal-without-source > Babel - Error`]
-SyntaxError: A string literal cannot be used as an exported binding without `from`.
+BabelError
+> 1 | export { 'a a' as 'b b' };
+ | ^ A string literal cannot be used as an exported binding without `from`.
- Did you mean `export { 'a a' as 'b b' } from 'some-module'`? (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot
index 0a53b6d2d4df..6d73afe3c0f4 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot
@@ -1,5 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-many-without-source > Babel - Error`]
-SyntaxError: A string literal cannot be used as an exported binding without `from`.
+BabelError
+> 1 | export { 'a a', 'b b' };
+ | ^ A string literal cannot be used as an exported binding without `from`.
- Did you mean `export { 'a a' as 'a a' } from 'some-module'`? (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot
index b494c222dfda..648bcec8e693 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot
@@ -1,5 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > braced-string-literal-without-source > Babel - Error`]
-SyntaxError: A string literal cannot be used as an exported binding without `from`.
+BabelError
+> 1 | export { 'a a' };
+ | ^ A string literal cannot be used as an exported binding without `from`.
- Did you mean `export { 'a a' as 'a a' } from 'some-module'`? (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot
index 3859e1338fb1..7f9ff6798317 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/class-expression/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > class-expression > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:7)
+BabelError
+> 1 | export (class Foo {});
+ | ^ Unexpected token, expected "{" (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot
index f25331d54178..38ab33ea3608 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/identifier-direct/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > identifier-direct > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:7)
+BabelError
+> 1 | export a;
+ | ^ Unexpected token, expected "{" (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot
index 1fd7baadc861..3d38c4f9e70e 100644
--- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-direct/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ExportNamedDeclaration > _error_ > literal-direct > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:7)
+BabelError
+> 1 | export 'a';
+ | ^ Unexpected token, expected "{" (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot
index 8a3517755f4f..ce11286822a7 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > missing-id-and-not-exported > Babel - Error`]
-SyntaxError: Unexpected token (1:9)
+BabelError
+> 1 | function () {}
+ | ^ Unexpected token (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
index febea1b1603a..0e4268f529cf 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > missing-type-param > TSESTree - Error`]
-NO ERROR
+TSError
+> 1 | function foo<>() {}
+ | ^^ Type parameter list cannot be empty.
+ 2 |
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
index 559cc556fbd3..6e7c4870ff8b 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > missing-type-param > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (1:12)
+BabelError
+> 1 | function foo<>() {}
+ | ^ Type parameter list cannot be empty. (1:12)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
index 190ac10d0bdd..046a008ac8ee 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > missing-type-param > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
index 907fe7ab23ae..b172c076d322 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > non-identifier-name > Babel - Error`]
-SyntaxError: Unexpected token (1:9)
+BabelError
+> 1 | function 1() {}
+ | ^ Unexpected token (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
index 270e3399f309..700ebba3a301 100644
--- a/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/FunctionDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > FunctionDeclaration > _error_ > non-identifier-type-param > Babel - Error`]
-SyntaxError: Unexpected token (1:13)
+BabelError
+> 1 | function foo<1>() {}
+ | ^ Unexpected token (1:13)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot
index 7f8ffa9ce43d..0e3a25550420 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > default-and-named-and-namespace > Babel - Error`]
-SyntaxError: Unexpected token, expected "from" (1:16)
+BabelError
+> 1 | import a, * as b, { c } from 'mod';
+ | ^ Unexpected token, expected "from" (1:16)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot
index b2062a8fd6c9..43ab6d6cbb6e 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > default-number-literal > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:7)
+BabelError
+> 1 | import 1 from 'mod';
+ | ^ Unexpected token, expected "{" (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot
index 6ef5744a9a28..6ac746b3158d 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > default-string-literal > Babel - Error`]
-SyntaxError: Missing semicolon. (1:12)
+BabelError
+> 1 | import 'a a' from 'mod';
+ | ^ Missing semicolon. (1:12)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot
index acec1a57dfca..f0b67f5c7abb 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-and-namespace > Babel - Error`]
-SyntaxError: Unexpected token, expected "from" (1:12)
+BabelError
+> 1 | import { b }, * as a from 'a';
+ | ^ Unexpected token, expected "from" (1:12)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot
index aaff744edc32..28b4fb532bbe 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-identifier-aliased-to-number-literal > Babel - Error`]
-SyntaxError: Unexpected token (1:14)
+BabelError
+> 1 | import { X as 1 } from 'mod';
+ | ^ Unexpected token (1:14)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot
index 14d274da0ea3..f13d1ad86b72 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-identifier-aliased-to-string-literal > Babel - Error`]
-SyntaxError: Unexpected token (1:14)
+BabelError
+> 1 | import { X as 'a a' } from 'mod';
+ | ^ Unexpected token (1:14)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot
index 6e9cc05e0006..cbce80d6b85d 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal-aliased-to-identifier > Babel - Error`]
-SyntaxError: Unexpected token (1:9)
+BabelError
+> 1 | import { 1 as X } from 'mod';
+ | ^ Unexpected token (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot
index 1ce70d79982d..0dcbc46684f9 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal-aliased-to-number-literal > Babel - Error`]
-SyntaxError: Unexpected token (1:9)
+BabelError
+> 1 | import { 1 as 1 } from 'mod';
+ | ^ Unexpected token (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot
index 5d0ee5c06f74..0346b41d38d4 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal-aliased-to-string-literal > Babel - Error`]
-SyntaxError: Unexpected token (1:9)
+BabelError
+> 1 | import { 1 as 'a a' } from 'mod';
+ | ^ Unexpected token (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot
index 3ab2880006e0..b3307fa4f464 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-number-literal > Babel - Error`]
-SyntaxError: Unexpected token (1:9)
+BabelError
+> 1 | import { 1 } from 'mod';
+ | ^ Unexpected token (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot
index ba56e25400c6..db49d74cedaa 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-string-literal-aliased-to-number-literal > Babel - Error`]
-SyntaxError: Unexpected token (1:17)
+BabelError
+> 1 | import { "😭" as 1 } from 'mod';
+ | ^ Unexpected token (1:17)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot
index ef0d81834f4e..9294a60a3d0e 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-string-literal-aliased-to-string-literal > Babel - Error`]
-SyntaxError: Unexpected token (1:17)
+BabelError
+> 1 | import { "😭" as 'a a' } from 'mod';
+ | ^ Unexpected token (1:17)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot
index 811ae5af3b35..d40da4301b86 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot
@@ -1,5 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > named-string-literal > Babel - Error`]
-SyntaxError: A string literal cannot be used as an imported binding.
+BabelError
+> 1 | import { "😭" } from 'mod';
+ | ^ A string literal cannot be used as an imported binding.
- Did you mean `import { "😭" as foo }`? (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot
index 370a42b15d95..bfbfc646d0d0 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-and-default > Babel - Error`]
-SyntaxError: Unexpected token, expected "from" (1:13)
+BabelError
+> 1 | import * as b, a from 'mod';
+ | ^ Unexpected token, expected "from" (1:13)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot
index 2bfe0c35942c..c966103d9606 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-and-named > Babel - Error`]
-SyntaxError: Unexpected token, expected "from" (1:13)
+BabelError
+> 1 | import * as a, { b } from 'a';
+ | ^ Unexpected token, expected "from" (1:13)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot
index 7020792b5fc4..84285d1c9a9a 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-and-namespace > Babel - Error`]
-SyntaxError: Unexpected token, expected "from" (1:13)
+BabelError
+> 1 | import * as a, * as b from 'a';
+ | ^ Unexpected token, expected "from" (1:13)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot
index 4b27d2236cfa..444773331adc 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > namespace-non-identifier > Babel - Error`]
-SyntaxError: Unexpected token (1:12)
+BabelError
+> 1 | import * as 1 from 'mod';
+ | ^ Unexpected token (1:12)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot
index b1be30149fd4..a4ab23c8f836 100644
--- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > ImportDeclaration > _error_ > non-string-source > Babel - Error`]
-SyntaxError: Unexpected token (1:19)
+BabelError
+> 1 | import * as x from module;
+ | ^ Unexpected token (1:19)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot
index b5d9b98f7eb0..ccb57192de34 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > async > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare async function foo();
+ | ^ Missing semicolon. (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot
index e7d1600ede23..8bd1dcb842a0 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > declare-with-body > Babel - Error`]
-SyntaxError: An implementation cannot be declared in ambient contexts. (1:0)
+BabelError
+> 1 | declare function foo(): void {};
+ | ^ An implementation cannot be declared in ambient contexts. (1:0)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot
index b0f108c8f608..0ba263f88f09 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-id-and-not-exported/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > missing-id-and-not-exported > Babel - Error`]
-SyntaxError: Unexpected token (1:17)
+BabelError
+> 1 | declare function ();
+ | ^ Unexpected token (1:17)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
index 86e87930550c..1ce9f3a6510a 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > missing-type-param > TSESTree - Error`]
-NO ERROR
+TSError
+> 1 | declare function foo<>(): void;
+ | ^^ Type parameter list cannot be empty.
+ 2 |
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
index f940ce76c084..541b20502249 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > missing-type-param > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (1:20)
+BabelError
+> 1 | declare function foo<>(): void;
+ | ^ Type parameter list cannot be empty. (1:20)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
index 2bda9d5029bb..19cdf1fa465f 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > missing-type-param > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
index 835c21eb16a8..4444ecfc395a 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > non-identifier-name > Babel - Error`]
-SyntaxError: Unexpected token (1:17)
+BabelError
+> 1 | declare function 1();
+ | ^ Unexpected token (1:17)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
index 84802a911f35..d7a45581d36a 100644
--- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSDeclareFunction > _error_ > non-identifier-type-param > Babel - Error`]
-SyntaxError: Unexpected token (1:19)
+BabelError
+> 1 | declare function f<1>(): void;
+ | ^ Unexpected token (1:19)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
index 3b8661db0c38..5daf5307227b 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > decorator > Babel - Error`]
-SyntaxError: Leading decorators must be attached to a class declaration. (1:6)
+BabelError
+> 1 | @decl enum Test {}
+ | ^ Leading decorators must be attached to a class declaration. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot
index dd8d595e57ec..a82bf4ed854d 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > missing-body > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:8)
+BabelError
+> 1 | enum Foo;
+ | ^ Unexpected token, expected "{" (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
index 4418c7a1e888..359f07219f1e 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > missing-id > Babel - Error`]
-SyntaxError: Unexpected token (1:5)
+BabelError
+> 1 | enum {}
+ | ^ Unexpected token (1:5)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
index 46552a854f62..cd61634a1671 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSEnumDeclaration > _error_ > non-identifier-name > Babel - Error`]
-SyntaxError: Unexpected token (1:5)
+BabelError
+> 1 | enum 1 {}
+ | ^ Unexpected token (1:5)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
index ddd23006e5d0..9a5146151d36 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,6 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
diff --git a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
index 90fb8dedf846..eeec47153937 100644
--- a/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/declaration/TSEnumDeclaration/fixtures/with-member-one/snapshots/5-AST-Alignment-AST.shot
@@ -15,7 +15,6 @@ Snapshot Diff:
- members: Array [
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot
index 617513c26619..44149a67c407 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/entity-name-invalid/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > entity-name-invalid > Babel - Error`]
-SyntaxError: Unexpected token (1:11)
+BabelError
+> 1 | import F = 1;
+ | ^ Unexpected token (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot
index 8df50b7d4c15..bf2fbca1e9ff 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-2/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > external-module-ref-non-string-2 > Babel - Error`]
-SyntaxError: Unexpected token (1:19)
+BabelError
+> 1 | import F = require(1 + 1);
+ | ^ Unexpected token (1:19)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot
index 9bf1d048bb0e..fa619f841cad 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string-3/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > external-module-ref-non-string-3 > Babel - Error`]
-SyntaxError: Unexpected token (1:19)
+BabelError
+> 1 | import F = require(`1`);
+ | ^ Unexpected token (1:19)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot
index d38a4d68b8cc..936a12f12e14 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/external-module-ref-non-string/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > external-module-ref-non-string > Babel - Error`]
-SyntaxError: Unexpected token (1:19)
+BabelError
+> 1 | import F = require(1);
+ | ^ Unexpected token (1:19)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot
index 9421f645d99f..2423a59ece17 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/snapshots/2-Babel-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > import-kind > Babel - Error`]
-SyntaxError: An import alias can not use 'import type'. (2:16)
+BabelError
+ 1 | type T = 1;
+> 2 | import type F = T;
+ | ^ An import alias can not use 'import type'. (2:16)
+ 3 |
+
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
index 4d8cd7ddc0cd..555339c64c79 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > missing-id > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:7)
+BabelError
+> 1 | import = A.B;
+ | ^ Unexpected token, expected "{" (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot
index 1b7acc81492b..dda3416a1214 100644
--- a/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSImportEqualsDeclaration/fixtures/_error_/missing-reference/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSImportEqualsDeclaration > _error_ > missing-reference > Babel - Error`]
-SyntaxError: Unexpected token, expected "from" (1:8)
+BabelError
+> 1 | import F;
+ | ^ Unexpected token, expected "from" (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
index 9713e325ea24..d628e241dec7 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > decorator > Babel - Error`]
-SyntaxError: Leading decorators must be attached to a class declaration. (1:6)
+BabelError
+> 1 | @decl interface Test {}
+ | ^ Leading decorators must be attached to a class declaration. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot
index e53fa56c6786..eb2cf802539b 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-body > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:11)
+BabelError
+> 1 | interface F;
+ | ^ Unexpected token, expected "{" (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot
index aebcf3e06ed4..d07294c49c41 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-extends > Babel - Error`]
-SyntaxError: 'extends' list cannot be empty. (1:20)
+BabelError
+> 1 | interface F extends {}
+ | ^ 'extends' list cannot be empty. (1:20)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
index d6516a5c585d..311305cc57af 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-id > Babel - Error`]
-SyntaxError: 'interface' declarations must be followed by an identifier. (1:10)
+BabelError
+> 1 | interface {}
+ | ^ 'interface' declarations must be followed by an identifier. (1:10)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
index 894a7a320645..906a02b805dc 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-type-param > TSESTree - Error`]
-NO ERROR
+TSError
+> 1 | interface F<> {}
+ | ^^ Type parameter list cannot be empty.
+ 2 |
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
index 456d9b250c57..22e5cae199c7 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-type-param > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (1:11)
+BabelError
+> 1 | interface F<> {}
+ | ^ Type parameter list cannot be empty. (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
index 79866f6f1284..59f909d1ef4f 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > missing-type-param > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-TSESTree-Error.shot
index 3192c89d0208..70781ef9b372 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-extends > TSESTree - Error`]
-NO ERROR
+TSError
+> 1 | interface F extends 1 {}
+ | ^ Interface declaration can only extend an identifier/qualified name with optional type arguments.
+ 2 |
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot
index b62fbf292fa0..65b6f8b67aed 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-extends > Babel - Error`]
-SyntaxError: Unexpected token (1:20)
+BabelError
+> 1 | interface F extends 1 {}
+ | ^ Unexpected token (1:20)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/3-Alignment-Error.shot
index 8b8a05459c4b..a0844838800f 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-extends > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
index 5daa78ba69de..c9df50bbff86 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-name > Babel - Error`]
-SyntaxError: 'interface' declarations must be followed by an identifier. (1:10)
+BabelError
+> 1 | interface 1 {}
+ | ^ 'interface' declarations must be followed by an identifier. (1:10)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
index 03d74ec17daa..1c7e4398f35a 100644
--- a/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-type-param/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSInterfaceDeclaration > _error_ > non-identifier-type-param > Babel - Error`]
-SyntaxError: Unexpected token (1:12)
+BabelError
+> 1 | interface F<1> {}
+ | ^ Unexpected token (1:12)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot
index 16fe0276b649..9a4e17520361 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-invalid-id/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > module-invalid-id > Babel - Error`]
-SyntaxError: Missing semicolon. (1:6)
+BabelError
+> 1 | module 1 {}
+ | ^ Missing semicolon. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot
index 9a5f13dad8e9..3c09b48c89e4 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/module-missing-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > module-missing-body > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:8)
+BabelError
+> 1 | module F;
+ | ^ Unexpected token, expected "{" (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot
index 38f3cc629b93..44e80efd9d15 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-declare-no-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-declare-no-body > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:19)
+BabelError
+> 1 | declare namespace F;
+ | ^ Unexpected token, expected "{" (1:19)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot
index 542fe6e7fcf6..77e6d42ec05f 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-id-literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-id-literal > Babel - Error`]
-SyntaxError: Missing semicolon. (1:9)
+BabelError
+> 1 | namespace 'a' {}
+ | ^ Missing semicolon. (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot
index 699035689429..f570ef75b13d 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-invalid-id/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-invalid-id > Babel - Error`]
-SyntaxError: Missing semicolon. (1:9)
+BabelError
+> 1 | namespace 1 {}
+ | ^ Missing semicolon. (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot
index 516bca2e2d70..9eaea9131b54 100644
--- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/_error_/namespace-no-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSModuleDeclaration > _error_ > namespace-no-body > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:11)
+BabelError
+> 1 | namespace F;
+ | ^ Unexpected token, expected "{" (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
index 95f461ed4516..af94e2dca261 100644
--- a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/missing-id/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSNamespaceExportDeclaration > _error_ > missing-id > Babel - Error`]
-SyntaxError: Unexpected token (1:19)
+BabelError
+> 1 | export as namespace;
+ | ^ Unexpected token (1:19)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
index ce1d4566a724..2604d4552462 100644
--- a/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSNamespaceExportDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSNamespaceExportDeclaration > _error_ > non-identifier-name > Babel - Error`]
-SyntaxError: Unexpected token (1:20)
+BabelError
+> 1 | export as namespace 1;
+ | ^ Unexpected token (1:20)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
index 726aeb6d7ce3..bd3effe3de20 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > decorator > Babel - Error`]
-SyntaxError: Leading decorators must be attached to a class declaration. (1:6)
+BabelError
+> 1 | @decl type Test = {};
+ | ^ Leading decorators must be attached to a class declaration. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-TSESTree-Error.shot
index aa1e2269c016..c09a3a767483 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > missing-type-parameter > TSESTree - Error`]
-NO ERROR
+TSError
+> 1 | type T<> = 1;
+ | ^^ Type parameter list cannot be empty.
+ 2 |
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot
index 1f660ee4bb9e..0aa1adadcafb 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > missing-type-parameter > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (1:6)
+BabelError
+> 1 | type T<> = 1;
+ | ^ Type parameter list cannot be empty. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/3-Alignment-Error.shot
index a4210c2854d7..513e0d5efdee 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > missing-type-parameter > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
index 4cad91910783..fe78642818bf 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-name/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > non-identifier-name > Babel - Error`]
-SyntaxError: Missing semicolon. (1:4)
+BabelError
+> 1 | type 1 = 2;
+ | ^ Missing semicolon. (1:4)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot
index f0022623ea80..bcf3c74735a2 100644
--- a/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/TSTypeAliasDeclaration/fixtures/_error_/non-identifier-type-parameter/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > TSTypeAliasDeclaration > _error_ > non-identifier-type-parameter > Babel - Error`]
-SyntaxError: Unexpected token (1:7)
+BabelError
+> 1 | type T<1> = 2;
+ | ^ Unexpected token (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot
index 63d96fa8f413..c96b185741e0 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-destructure-no-init > Babel - Error`]
-SyntaxError: Missing initializer in destructuring declaration. (1:13)
+BabelError
+> 1 | const { foo };
+ | ^ Missing initializer in destructuring declaration. (1:13)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot
index f19c9134851b..f6c5fb6e9694 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-destructure-type-no-init > Babel - Error`]
-SyntaxError: Missing initializer in destructuring declaration. (1:18)
+BabelError
+> 1 | const { foo }: any;
+ | ^ Missing initializer in destructuring declaration. (1:18)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot
index fbaf6994db12..0bdc8232084c 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-definite-no-init > Babel - Error`]
-SyntaxError: Missing initializer in const declaration. (1:10)
+BabelError
+> 1 | const foo!;
+ | ^ Missing initializer in const declaration. (1:10)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot
index d6d04284fdb0..3a6191ee1fd1 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-definite-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-definite-type-no-init > Babel - Error`]
-SyntaxError: Missing initializer in const declaration. (1:15)
+BabelError
+> 1 | const foo!: any;
+ | ^ Missing initializer in const declaration. (1:15)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot
index 4778736de1c9..b6caba1e3a80 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-no-init > Babel - Error`]
-SyntaxError: Missing initializer in const declaration. (1:9)
+BabelError
+> 1 | const foo;
+ | ^ Missing initializer in const declaration. (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot
index b114ab299fee..eb6f8b5c4c0c 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/const-id-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > const-id-type-no-init > Babel - Error`]
-SyntaxError: Missing initializer in const declaration. (1:14)
+BabelError
+> 1 | const foo: any;
+ | ^ Missing initializer in const declaration. (1:14)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot
index a4077cb77749..5adb20d1948b 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-destructure-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-const-destructure-type-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:29)
+BabelError
+> 1 | declare const { foo }: any = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:29)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot
index 97938c07e956..714b75ab5786 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-definite-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-const-id-definite-type-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:26)
+BabelError
+> 1 | declare const foo!: any = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:26)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot
index 6527f12080d1..a8c480413692 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-const-id-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-const-id-type-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:25)
+BabelError
+> 1 | declare const foo: any = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:25)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot
index c602f4cb545e..61ea7c4c9b4f 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-destructure-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:22)
+BabelError
+> 1 | declare let { foo } = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:22)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot
index ea40786b38d6..db2c7091e208 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-destructure-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-destructure-type-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:27)
+BabelError
+> 1 | declare let { foo }: any = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:27)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot
index 1a4d52e5efb7..7dcf5ae87a8e 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-definite-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:19)
+BabelError
+> 1 | declare let foo! = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:19)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot
index 2799404577f1..bb42e1891168 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-definite-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-definite-type-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:24)
+BabelError
+> 1 | declare let foo!: any = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:24)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot
index 9d1e1a93cb3c..79d191b1fea9 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:18)
+BabelError
+> 1 | declare let foo = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:18)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot
index 7d3b4dbacd1d..89f962475274 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-let-id-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-let-id-type-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:23)
+BabelError
+> 1 | declare let foo: any = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:23)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot
index 512c30b84f78..929b7944477c 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using { foo } = 1;
+ | ^ Missing semicolon. (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot
index 7b5830248706..4997023f0aa4 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-no-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using { foo };
+ | ^ Missing semicolon. (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot
index ef81adfc0b85..c2cecbb8104d 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-type-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using { foo }: any = 1;
+ | ^ Missing semicolon. (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot
index 2cf637689700..f80c5fc88016 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-destructure-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-destructure-type-no-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using { foo }: any;
+ | ^ Missing semicolon. (1:7)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot
index c95370820204..90a0b63510ca 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using foo! = 1;
+ | ^ 'declare' modifier cannot appear on a using declaration. (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot
index 69bbfebd9e0d..969cf36c0bbf 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-no-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using foo!;
+ | ^ 'declare' modifier cannot appear on a using declaration. (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot
index d109f14d40f9..8260ff32d2ca 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-type-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using foo!: any = 1;
+ | ^ 'declare' modifier cannot appear on a using declaration. (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot
index d41036eea117..02a7a6964314 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-definite-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-definite-type-no-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using foo!: any;
+ | ^ 'declare' modifier cannot appear on a using declaration. (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot
index 9ffd885b9fb3..97094e711350 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using foo = 1;
+ | ^ 'declare' modifier cannot appear on a using declaration. (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot
index 50648d64ba1d..a8442943b6d0 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-no-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using foo;
+ | ^ 'declare' modifier cannot appear on a using declaration. (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot
index ccdb04651388..35ddd9daf071 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-type-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using foo: any = 1;
+ | ^ 'declare' modifier cannot appear on a using declaration. (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot
index a605c534f9f6..420a6845fbf9 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-using-id-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-using-id-type-no-init > Babel - Error`]
-SyntaxError: Missing semicolon. (1:7)
+BabelError
+> 1 | declare using foo: any;
+ | ^ 'declare' modifier cannot appear on a using declaration. (1:8)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot
index b81a030fdae0..6cf7effbdbfb 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-destructure-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:22)
+BabelError
+> 1 | declare var { foo } = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:22)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot
index c716f5ee6e62..c5883210e4e9 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-destructure-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-destructure-type-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:27)
+BabelError
+> 1 | declare var { foo }: any = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:27)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot
index 5599c8a79783..26b7602ac1d5 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-definite-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:19)
+BabelError
+> 1 | declare var foo! = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:19)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot
index 4c73b29511d3..9b0332014fc4 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-definite-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-definite-type-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:24)
+BabelError
+> 1 | declare var foo!: any = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:24)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot
index 7c80c93c3a1d..d23db1eb32cf 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:18)
+BabelError
+> 1 | declare var foo = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:18)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot
index 0eece7d22e74..c50e75b93a0e 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/declare-var-id-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > declare-var-id-type-init > Babel - Error`]
-SyntaxError: Initializers are not allowed in ambient contexts. (1:23)
+BabelError
+> 1 | declare var foo: any = 1;
+ | ^ Initializers are not allowed in ambient contexts. (1:23)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
index ee1c40040dbb..70ea5eb9260e 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/decorator/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > decorator > Babel - Error`]
-SyntaxError: Leading decorators must be attached to a class declaration. (1:6)
+BabelError
+> 1 | @decl type Test = {};
+ | ^ Leading decorators must be attached to a class declaration. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot
index d3dbedec0c5e..1118f9cce9a0 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > let-destructure-no-init > Babel - Error`]
-SyntaxError: Missing initializer in destructuring declaration. (1:11)
+BabelError
+> 1 | let { foo };
+ | ^ Missing initializer in destructuring declaration. (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot
index 90a0241d8eec..eac75eb96185 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/let-destructure-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > let-destructure-type-no-init > Babel - Error`]
-SyntaxError: Missing initializer in destructuring declaration. (1:16)
+BabelError
+> 1 | let { foo }: any;
+ | ^ Missing initializer in destructuring declaration. (1:16)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot
index 2f8edbf36213..6217ca96ac49 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/missing-id-with-value/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > missing-id-with-value > Babel - Error`]
-SyntaxError: Unexpected token (1:6)
+BabelError
+> 1 | const = 1;
+ | ^ Unexpected token (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot
index 7be36c3bbd62..d58c5400eebf 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/no-variables/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > no-variables > Babel - Error`]
-SyntaxError: Unexpected token (1:5)
+BabelError
+> 1 | const;
+ | ^ Unexpected token (1:5)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot
index 3c5579d38485..a557bde70a73 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-init > Babel - Error`]
-SyntaxError: Using declaration cannot have destructuring patterns. (1:6)
+BabelError
+> 1 | using { foo } = 1;
+ | ^ Using declaration cannot have destructuring patterns. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot
index 9c6a4fd029be..8f9f395f5be7 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-no-init > Babel - Error`]
-SyntaxError: Using declaration cannot have destructuring patterns. (1:6)
+BabelError
+> 1 | using { foo };
+ | ^ Using declaration cannot have destructuring patterns. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot
index 11639dfd0961..4bfa641b372d 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-type-init > Babel - Error`]
-SyntaxError: Using declaration cannot have destructuring patterns. (1:6)
+BabelError
+> 1 | using { foo }: any = 1;
+ | ^ Using declaration cannot have destructuring patterns. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot
index 2843f96cd215..5172befcf8ec 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-destructure-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-destructure-type-no-init > Babel - Error`]
-SyntaxError: Using declaration cannot have destructuring patterns. (1:6)
+BabelError
+> 1 | using { foo }: any;
+ | ^ Using declaration cannot have destructuring patterns. (1:6)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot
index 8d285d2c268d..65f7136c6dd4 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-definite-no-init > Babel - Error`]
-SyntaxError: Missing initializer in using declaration. (1:10)
+BabelError
+> 1 | using foo!;
+ | ^ Missing initializer in using declaration. (1:10)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot
index e9809e204145..4abda6a53640 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-definite-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-definite-type-no-init > Babel - Error`]
-SyntaxError: Missing initializer in using declaration. (1:15)
+BabelError
+> 1 | using foo!: any;
+ | ^ Missing initializer in using declaration. (1:15)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot
index 25a73d34c442..491e41264099 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-no-init > Babel - Error`]
-SyntaxError: Missing initializer in using declaration. (1:9)
+BabelError
+> 1 | using foo;
+ | ^ Missing initializer in using declaration. (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot
index 269b21209e25..07af234b3468 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/using-id-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > using-id-type-no-init > Babel - Error`]
-SyntaxError: Missing initializer in using declaration. (1:14)
+BabelError
+> 1 | using foo: any;
+ | ^ Missing initializer in using declaration. (1:14)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot
index e8b80abcf677..00f7eed3ebd2 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > var-destructure-no-init > Babel - Error`]
-SyntaxError: Missing initializer in destructuring declaration. (1:11)
+BabelError
+> 1 | var { foo };
+ | ^ Missing initializer in destructuring declaration. (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot
index 28b00d00ddee..9b74a4b499ec 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > declaration > VariableDeclaration > _error_ > var-destructure-type-no-init > Babel - Error`]
-SyntaxError: Missing initializer in destructuring declaration. (1:16)
+BabelError
+> 1 | var { foo }: any;
+ | ^ Missing initializer in destructuring declaration. (1:16)
+ 2 |
+
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-no-init/snapshots/4-Babel-Tokens.shot
index 1e8aedb5a757..89f263da8a91 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-no-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-no-init/snapshots/4-Babel-Tokens.shot
@@ -9,8 +9,8 @@
end: { column: 7, line: 1 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [8, 11],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-type-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-type-no-init/snapshots/4-Babel-Tokens.shot
index de560945193b..e237405b6f8f 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-type-no-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-destructure-type-no-init/snapshots/4-Babel-Tokens.shot
@@ -9,8 +9,8 @@
end: { column: 7, line: 1 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [8, 11],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-no-init/snapshots/4-Babel-Tokens.shot
index b7868b340a2c..d946b523b795 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-no-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-no-init/snapshots/4-Babel-Tokens.shot
@@ -9,8 +9,8 @@
end: { column: 7, line: 1 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [8, 11],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-type-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-type-no-init/snapshots/4-Babel-Tokens.shot
index f25ebacc499a..802d9e8f933e 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-type-no-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/declare-let-id-type-no-init/snapshots/4-Babel-Tokens.shot
@@ -9,8 +9,8 @@
end: { column: 7, line: 1 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [8, 11],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-init/snapshots/4-Babel-Tokens.shot
index f7b059c3e53e..370c22201c27 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-init/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [0, 3],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-type-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-type-init/snapshots/4-Babel-Tokens.shot
index 8eb9db558757..fb2de915e0e2 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-type-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-destructure-type-init/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [0, 3],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-definite-type-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-definite-type-no-init/snapshots/4-Babel-Tokens.shot
index 04367dd27c4f..858d88120216 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-definite-type-no-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-definite-type-no-init/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [0, 3],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-init/snapshots/4-Babel-Tokens.shot
index ef80cf7131ed..c43ae8ec6cec 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-init/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [0, 3],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-no-init/snapshots/4-Babel-Tokens.shot
index b6a6248914c3..b3be12441d9c 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-no-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-no-init/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [0, 3],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-init/snapshots/4-Babel-Tokens.shot
index 447584b158d1..a7e85c35fe66 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-init/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [0, 3],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-no-init/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-no-init/snapshots/4-Babel-Tokens.shot
index 5c5508c4addd..d978035e4a7c 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-no-init/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/let-id-type-no-init/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [0, 3],
diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/4-Babel-Tokens.shot
index 79072bfc8258..d08e8a6769b2 100644
--- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/multiple-declarations/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [0, 3],
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts
new file mode 100644
index 000000000000..bbf0ef59cee9
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ accessor 'construct\u{6f}r'
+}
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..bb514364efe2
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > TSESTree - Error`]
+TSError
+ 1 | class Foo {
+> 2 | accessor 'construct\u{6f}r'
+ | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..056333536528
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > Babel - Error`]
+BabelError
+ 1 | class Foo {
+> 2 | accessor 'construct\u{6f}r'
+ | ^ Classes may not have a field named 'constructor'. (2:11)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..1b975851c82a
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string-escaped > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts
new file mode 100644
index 000000000000..15b65f9026f1
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ accessor 'constructor'
+}
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..99225f26fe0f
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string > TSESTree - Error`]
+TSError
+ 1 | class Foo {
+> 2 | accessor 'constructor'
+ | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..bb359842fe1e
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string > Babel - Error`]
+BabelError
+ 1 | class Foo {
+> 2 | accessor 'constructor'
+ | ^ Classes may not have a field named 'constructor'. (2:11)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..d6b1cda3e19b
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > AccessorProperty > _error_ > key-constructor-string > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot
index af9f804ebc24..b099dd074fa8 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-abstract-property-with-value/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > element > AccessorProperty > _error_ > modifier-abstract-property-with-value > Babel - Error`]
-SyntaxError: Property 'property' cannot have an initializer because it is marked abstract. (2:20)
+BabelError
+ 1 | abstract class Foo {
+> 2 | abstract property = 1;
+ | ^ Property 'property' cannot have an initializer because it is marked abstract. (2:20)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot
index 9efd284b0d93..848b03e5c5b9 100644
--- a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > element > AccessorProperty > _error_ > modifier-override-with-no-extends > Babel - Error`]
-SyntaxError: This member cannot have an 'override' modifier because its containing class does not extend another class. (2:2)
+BabelError
+ 1 | class Foo {
+> 2 | override accessor foo = 2;
+ | ^ This member cannot have an 'override' modifier because its containing class does not extend another class. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts
new file mode 100644
index 000000000000..176558f7f971
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ accessor [constructor];
+}
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..0bd9d71a1338
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,79 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ AccessorProperty {
+ type: "AccessorProperty",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "constructor",
+ optional: false,
+
+ range: [24, 35],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 23, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [14, 37],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 39],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 39],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 40],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..ced41a5029ae
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "accessor",
+
+ range: [14, 22],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 10, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "constructor",
+
+ range: [24, 35],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 23, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [35, 36],
+ loc: {
+ start: { column: 23, line: 2 },
+ end: { column: 24, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [36, 37],
+ loc: {
+ start: { column: 24, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [38, 39],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..0bd9d71a1338
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot
@@ -0,0 +1,79 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ AccessorProperty {
+ type: "AccessorProperty",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "constructor",
+ optional: false,
+
+ range: [24, 35],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 23, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [14, 37],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 39],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 39],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 40],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..ced41a5029ae
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "accessor",
+
+ range: [14, 22],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 10, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "constructor",
+
+ range: [24, 35],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 23, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [35, 36],
+ loc: {
+ start: { column: 23, line: 2 },
+ end: { column: 24, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [36, 37],
+ loc: {
+ start: { column: 24, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [38, 39],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts
new file mode 100644
index 000000000000..acc5cfe6398a
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ accessor ['constructor'];
+}
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..5b9bbadd0d07
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,78 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ AccessorProperty {
+ type: "AccessorProperty",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Literal {
+ type: "Literal",
+ raw: "'constructor'",
+ value: "constructor",
+
+ range: [24, 37],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [14, 39],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 27, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 41],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 41],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 42],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..30151a9636c9
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "accessor",
+
+ range: [14, 22],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 10, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ String {
+ type: "String",
+ value: "'constructor'",
+
+ range: [24, 37],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [37, 38],
+ loc: {
+ start: { column: 25, line: 2 },
+ end: { column: 26, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [38, 39],
+ loc: {
+ start: { column: 26, line: 2 },
+ end: { column: 27, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [40, 41],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..5b9bbadd0d07
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot
@@ -0,0 +1,78 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ AccessorProperty {
+ type: "AccessorProperty",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Literal {
+ type: "Literal",
+ raw: "'constructor'",
+ value: "constructor",
+
+ range: [24, 37],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [14, 39],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 27, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 41],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 41],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 42],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..30151a9636c9
--- /dev/null
+++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "accessor",
+
+ range: [14, 22],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 10, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ String {
+ type: "String",
+ value: "'constructor'",
+
+ range: [24, 37],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [37, 38],
+ loc: {
+ start: { column: 25, line: 2 },
+ end: { column: 26, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [38, 39],
+ loc: {
+ start: { column: 26, line: 2 },
+ end: { column: 27, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [40, 41],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot
index e191f9064a5c..3243edaa376b 100644
--- a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > element > MethodDefinition > _error_ > duplicated-accessibility-modifiers > Babel - Error`]
-SyntaxError: Accessibility modifier already seen. (2:9)
+BabelError
+ 1 | class Foo {
+> 2 | public public bar() {};
+ | ^ Accessibility modifier already seen: 'public'. (2:9)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot
index a29fa5ab09a0..013fb16531eb 100644
--- a/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > element > MethodDefinition > _error_ > mixed-accessibility-modifiers > Babel - Error`]
-SyntaxError: Accessibility modifier already seen. (2:9)
+BabelError
+ 1 | class Foo {
+> 2 | public protected bar() {};
+ | ^ Accessibility modifier already seen: 'protected'. (2:9)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/fixture.ts b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/fixture.ts
new file mode 100644
index 000000000000..4c180fec4267
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/fixture.ts
@@ -0,0 +1,4 @@
+class Foo {
+ // prettier-ignore
+ "constructor"() {}
+}
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..c67c432e3f4e
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,100 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ MethodDefinition {
+ type: "MethodDefinition",
+ computed: false,
+ decorators: [],
+ key: Literal {
+ type: "Literal",
+ raw: ""constructor"",
+ value: "constructor",
+
+ range: [35, 48],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ kind: "constructor",
+ optional: false,
+ override: false,
+ static: false,
+ value: FunctionExpression {
+ type: "FunctionExpression",
+ async: false,
+ body: BlockStatement {
+ type: "BlockStatement",
+ body: [],
+
+ range: [51, 53],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ declare: false,
+ expression: false,
+ generator: false,
+ id: null,
+ params: [],
+
+ range: [48, 53],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [35, 53],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+
+ range: [10, 55],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 55],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 56],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 5 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..d7b945f9e519
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""constructor"",
+
+ range: [35, 48],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [48, 49],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [49, 50],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [51, 52],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [52, 53],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [54, 55],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 4 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..c67c432e3f4e
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/3-Babel-AST.shot
@@ -0,0 +1,100 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ MethodDefinition {
+ type: "MethodDefinition",
+ computed: false,
+ decorators: [],
+ key: Literal {
+ type: "Literal",
+ raw: ""constructor"",
+ value: "constructor",
+
+ range: [35, 48],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ kind: "constructor",
+ optional: false,
+ override: false,
+ static: false,
+ value: FunctionExpression {
+ type: "FunctionExpression",
+ async: false,
+ body: BlockStatement {
+ type: "BlockStatement",
+ body: [],
+
+ range: [51, 53],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ declare: false,
+ expression: false,
+ generator: false,
+ id: null,
+ params: [],
+
+ range: [48, 53],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+
+ range: [35, 53],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ ],
+
+ range: [10, 55],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 55],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 56],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 5 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..d7b945f9e519
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor-string-literal/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""constructor"",
+
+ range: [35, 48],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 15, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [48, 49],
+ loc: {
+ start: { column: 15, line: 3 },
+ end: { column: 16, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [49, 50],
+ loc: {
+ start: { column: 16, line: 3 },
+ end: { column: 17, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [51, 52],
+ loc: {
+ start: { column: 18, line: 3 },
+ end: { column: 19, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [52, 53],
+ loc: {
+ start: { column: 19, line: 3 },
+ end: { column: 20, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [54, 55],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 4 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/fixture.ts b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/fixture.ts
new file mode 100644
index 000000000000..5e9e3c9272a2
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ constructor() {}
+}
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..3eef72dde2c6
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,101 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ MethodDefinition {
+ type: "MethodDefinition",
+ computed: false,
+ decorators: [],
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "constructor",
+ optional: false,
+
+ range: [14, 25],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 13, line: 2 },
+ },
+ },
+ kind: "constructor",
+ optional: false,
+ override: false,
+ static: false,
+ value: FunctionExpression {
+ type: "FunctionExpression",
+ async: false,
+ body: BlockStatement {
+ type: "BlockStatement",
+ body: [],
+
+ range: [28, 30],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ declare: false,
+ expression: false,
+ generator: false,
+ id: null,
+ params: [],
+
+ range: [25, 30],
+ loc: {
+ start: { column: 13, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+
+ range: [14, 30],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 32],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..dae0e3eb6ca1
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "constructor",
+
+ range: [14, 25],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 13, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [25, 26],
+ loc: {
+ start: { column: 13, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [26, 27],
+ loc: {
+ start: { column: 14, line: 2 },
+ end: { column: 15, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 17, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [31, 32],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..3eef72dde2c6
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/3-Babel-AST.shot
@@ -0,0 +1,101 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ MethodDefinition {
+ type: "MethodDefinition",
+ computed: false,
+ decorators: [],
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "constructor",
+ optional: false,
+
+ range: [14, 25],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 13, line: 2 },
+ },
+ },
+ kind: "constructor",
+ optional: false,
+ override: false,
+ static: false,
+ value: FunctionExpression {
+ type: "FunctionExpression",
+ async: false,
+ body: BlockStatement {
+ type: "BlockStatement",
+ body: [],
+
+ range: [28, 30],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ declare: false,
+ expression: false,
+ generator: false,
+ id: null,
+ params: [],
+
+ range: [25, 30],
+ loc: {
+ start: { column: 13, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+
+ range: [14, 30],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 32],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..dae0e3eb6ca1
--- /dev/null
+++ b/packages/ast-spec/src/element/MethodDefinition/fixtures/constructor/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "constructor",
+
+ range: [14, 25],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 13, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [25, 26],
+ loc: {
+ start: { column: 13, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [26, 27],
+ loc: {
+ start: { column: 14, line: 2 },
+ end: { column: 15, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 17, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [31, 32],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot
index 8493e50d46c6..31592e35fd82 100644
--- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/duplicated-accessibility-modifiers/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > element > PropertyDefinition > _error_ > duplicated-accessibility-modifiers > Babel - Error`]
-SyntaxError: Accessibility modifier already seen. (2:9)
+BabelError
+ 1 | class Foo {
+> 2 | public public bar;
+ | ^ Accessibility modifier already seen: 'public'. (2:9)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts
new file mode 100644
index 000000000000..581943685ffe
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ constructor
+}
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..ed0ae4b78658
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-identifier > TSESTree - Error`]
+TSError
+ 1 | class Foo {
+ 2 | constructor
+> 3 | }
+ | ^ '(' expected.
+ 4 |
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..680ca51c5b1a
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-identifier > Babel - Error`]
+BabelError
+ 1 | class Foo {
+> 2 | constructor
+ | ^ Classes may not have a field named 'constructor'. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..dda789130572
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-identifier > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts
new file mode 100644
index 000000000000..3449ebe932d7
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ 'construct\u{6f}r'
+}
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..e7cc82f40aad
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > TSESTree - Error`]
+TSError
+ 1 | class Foo {
+> 2 | 'construct\u{6f}r'
+ | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..702bec4df14e
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > Babel - Error`]
+BabelError
+ 1 | class Foo {
+> 2 | 'construct\u{6f}r'
+ | ^ Classes may not have a field named 'constructor'. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..b3922ac52bf5
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string-escaped > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts
new file mode 100644
index 000000000000..d29a35ffdbb7
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ 'constructor'
+}
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..46f1efa8ad71
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string > TSESTree - Error`]
+TSError
+ 1 | class Foo {
+> 2 | 'constructor'
+ | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..eaac47437927
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string > Babel - Error`]
+BabelError
+ 1 | class Foo {
+> 2 | 'constructor'
+ | ^ Classes may not have a field named 'constructor'. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..86e611b5b35d
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > PropertyDefinition > _error_ > key-constructor-string > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot
index 2ad65ba9c9fd..f62e3c0547b7 100644
--- a/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/_error_/mixed-accessibility-modifiers/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > element > PropertyDefinition > _error_ > mixed-accessibility-modifiers > Babel - Error`]
-SyntaxError: Accessibility modifier already seen. (2:9)
+BabelError
+ 1 | class Foo {
+> 2 | public protected bar;
+ | ^ Accessibility modifier already seen: 'protected'. (2:9)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts
new file mode 100644
index 000000000000..8846529091d9
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ [constructor];
+}
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..036f1181e9b7
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,79 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "constructor",
+ optional: false,
+
+ range: [15, 26],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [14, 28],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 30],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 30],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 31],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..93100d49782c
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,82 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [14, 15],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "constructor",
+
+ range: [15, 26],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [26, 27],
+ loc: {
+ start: { column: 14, line: 2 },
+ end: { column: 15, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [27, 28],
+ loc: {
+ start: { column: 15, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..036f1181e9b7
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot
@@ -0,0 +1,79 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "constructor",
+ optional: false,
+
+ range: [15, 26],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [14, 28],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 30],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 30],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 31],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..93100d49782c
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,82 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [14, 15],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "constructor",
+
+ range: [15, 26],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [26, 27],
+ loc: {
+ start: { column: 14, line: 2 },
+ end: { column: 15, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [27, 28],
+ loc: {
+ start: { column: 15, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts
new file mode 100644
index 000000000000..955e0ccdd551
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts
@@ -0,0 +1,3 @@
+class Foo {
+ ['constructor'];
+}
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..a35a705153a3
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,78 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Literal {
+ type: "Literal",
+ raw: "'constructor'",
+ value: "constructor",
+
+ range: [15, 28],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [14, 30],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 32],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..d587dd5c180d
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,82 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [14, 15],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 2 },
+ },
+ },
+ String {
+ type: "String",
+ value: "'constructor'",
+
+ range: [15, 28],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 17, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [31, 32],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..a35a705153a3
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot
@@ -0,0 +1,78 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Literal {
+ type: "Literal",
+ raw: "'constructor'",
+ value: "constructor",
+
+ range: [15, 28],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [14, 30],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ ],
+
+ range: [10, 32],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..d587dd5c180d
--- /dev/null
+++ b/packages/ast-spec/src/element/PropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,82 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [6, 9],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [10, 11],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 11, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [14, 15],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 2 },
+ },
+ },
+ String {
+ type: "String",
+ value: "'constructor'",
+
+ range: [15, 28],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 17, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [31, 32],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts
new file mode 100644
index 000000000000..cf5081dbe114
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ accessor 'construct\u{6f}r'
+}
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..c852da13a3fa
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | accessor 'construct\u{6f}r'
+ | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..8b2bdb1d6685
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | accessor 'construct\u{6f}r'
+ | ^ Classes may not have a field named 'constructor'. (2:11)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..f4851859171d
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string-escaped > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts
new file mode 100644
index 000000000000..84fb8c4caa3f
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ accessor 'constructor'
+}
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..97e1650fccca
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | accessor 'constructor'
+ | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..9f0cd2ea63f0
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | accessor 'constructor'
+ | ^ Classes may not have a field named 'constructor'. (2:11)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..c6bb852e8a96
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractAccessorProperty > _error_ > key-constructor-string > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts
new file mode 100644
index 000000000000..e267f66d845d
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ accessor [constructor];
+}
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..82d28f21758a
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,79 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: true,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ AccessorProperty {
+ type: "AccessorProperty",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "constructor",
+ optional: false,
+
+ range: [33, 44],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 23, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [23, 46],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ ],
+
+ range: [19, 48],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 48],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 49],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..4941bcdc220c
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,102 @@
+[
+ Identifier {
+ type: "Identifier",
+ value: "abstract",
+
+ range: [0, 8],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [9, 14],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "accessor",
+
+ range: [23, 31],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 10, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [32, 33],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "constructor",
+
+ range: [33, 44],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 23, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [44, 45],
+ loc: {
+ start: { column: 23, line: 2 },
+ end: { column: 24, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [45, 46],
+ loc: {
+ start: { column: 24, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [47, 48],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..82d28f21758a
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot
@@ -0,0 +1,79 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: true,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ AccessorProperty {
+ type: "AccessorProperty",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "constructor",
+ optional: false,
+
+ range: [33, 44],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 23, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [23, 46],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ ],
+
+ range: [19, 48],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 48],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 49],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..4941bcdc220c
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,102 @@
+[
+ Identifier {
+ type: "Identifier",
+ value: "abstract",
+
+ range: [0, 8],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [9, 14],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "accessor",
+
+ range: [23, 31],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 10, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [32, 33],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "constructor",
+
+ range: [33, 44],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 23, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [44, 45],
+ loc: {
+ start: { column: 23, line: 2 },
+ end: { column: 24, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [45, 46],
+ loc: {
+ start: { column: 24, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [47, 48],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts
new file mode 100644
index 000000000000..dd4af2978b06
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ accessor ['constructor'];
+}
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..c1ef23b02e88
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,78 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: true,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ AccessorProperty {
+ type: "AccessorProperty",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Literal {
+ type: "Literal",
+ raw: "'constructor'",
+ value: "constructor",
+
+ range: [33, 46],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [23, 48],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 27, line: 2 },
+ },
+ },
+ ],
+
+ range: [19, 50],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 50],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 51],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..b3c97ec3fd6c
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,102 @@
+[
+ Identifier {
+ type: "Identifier",
+ value: "abstract",
+
+ range: [0, 8],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [9, 14],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "accessor",
+
+ range: [23, 31],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 10, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [32, 33],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ String {
+ type: "String",
+ value: "'constructor'",
+
+ range: [33, 46],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [46, 47],
+ loc: {
+ start: { column: 25, line: 2 },
+ end: { column: 26, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [47, 48],
+ loc: {
+ start: { column: 26, line: 2 },
+ end: { column: 27, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [49, 50],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..c1ef23b02e88
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot
@@ -0,0 +1,78 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: true,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ AccessorProperty {
+ type: "AccessorProperty",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Literal {
+ type: "Literal",
+ raw: "'constructor'",
+ value: "constructor",
+
+ range: [33, 46],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [23, 48],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 27, line: 2 },
+ },
+ },
+ ],
+
+ range: [19, 50],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 50],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 51],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..b3c97ec3fd6c
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,102 @@
+[
+ Identifier {
+ type: "Identifier",
+ value: "abstract",
+
+ range: [0, 8],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [9, 14],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "accessor",
+
+ range: [23, 31],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 10, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [32, 33],
+ loc: {
+ start: { column: 11, line: 2 },
+ end: { column: 12, line: 2 },
+ },
+ },
+ String {
+ type: "String",
+ value: "'constructor'",
+
+ range: [33, 46],
+ loc: {
+ start: { column: 12, line: 2 },
+ end: { column: 25, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [46, 47],
+ loc: {
+ start: { column: 25, line: 2 },
+ end: { column: 26, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [47, 48],
+ loc: {
+ start: { column: 26, line: 2 },
+ end: { column: 27, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [49, 50],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts
new file mode 100644
index 000000000000..a70cc4d0b84e
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ constructor
+}
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..d4dac96c3819
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-identifier > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+ 2 | constructor
+> 3 | }
+ | ^ '(' expected.
+ 4 |
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..40ef5d1ba178
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-identifier > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | constructor
+ | ^ Classes may not have a field named 'constructor'. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..c03db2425706
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-identifier/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-identifier > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts
new file mode 100644
index 000000000000..59eeeb52941e
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ 'construct\u{6f}r'
+}
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..7db0a089389d
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | 'construct\u{6f}r'
+ | ^^^^^^^^^^^^^^^^^^ Classes may not have a field named 'constructor'.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..3d7fc01c39af
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | 'construct\u{6f}r'
+ | ^ Classes may not have a field named 'constructor'. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..c784e6ef8f7e
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string-escaped/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string-escaped > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts
new file mode 100644
index 000000000000..773be1c59705
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ 'constructor'
+}
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..e70630a8db65
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string > TSESTree - Error`]
+TSError
+ 1 | abstract class Foo {
+> 2 | 'constructor'
+ | ^^^^^^^^^^^^^ Classes may not have a field named 'constructor'.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..0b562418bd7a
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string > Babel - Error`]
+BabelError
+ 1 | abstract class Foo {
+> 2 | 'constructor'
+ | ^ Classes may not have a field named 'constructor'. (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..e72b64ca43be
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/_error_/key-constructor-string/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSAbstractPropertyDefinition > _error_ > key-constructor-string > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts
new file mode 100644
index 000000000000..0035d60f9a3b
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ [constructor];
+}
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..a84556365ffa
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,79 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: true,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "constructor",
+ optional: false,
+
+ range: [24, 35],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [23, 37],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ ],
+
+ range: [19, 39],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 39],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 40],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..f33b1b154313
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Identifier {
+ type: "Identifier",
+ value: "abstract",
+
+ range: [0, 8],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [9, 14],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "constructor",
+
+ range: [24, 35],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [35, 36],
+ loc: {
+ start: { column: 14, line: 2 },
+ end: { column: 15, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [36, 37],
+ loc: {
+ start: { column: 15, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [38, 39],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..a84556365ffa
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/3-Babel-AST.shot
@@ -0,0 +1,79 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: true,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "constructor",
+ optional: false,
+
+ range: [24, 35],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [23, 37],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ ],
+
+ range: [19, 39],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 39],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 40],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..f33b1b154313
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-identifier-computed/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Identifier {
+ type: "Identifier",
+ value: "abstract",
+
+ range: [0, 8],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [9, 14],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "constructor",
+
+ range: [24, 35],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 14, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [35, 36],
+ loc: {
+ start: { column: 14, line: 2 },
+ end: { column: 15, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [36, 37],
+ loc: {
+ start: { column: 15, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [38, 39],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts
new file mode 100644
index 000000000000..d7fa2a53c79b
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/fixture.ts
@@ -0,0 +1,3 @@
+abstract class Foo {
+ ['constructor'];
+}
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..880411e5b0a1
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,78 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: true,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Literal {
+ type: "Literal",
+ raw: "'constructor'",
+ value: "constructor",
+
+ range: [24, 37],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [23, 39],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ ],
+
+ range: [19, 41],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 41],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 42],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..a82ebf95ff87
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Identifier {
+ type: "Identifier",
+ value: "abstract",
+
+ range: [0, 8],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [9, 14],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 2 },
+ },
+ },
+ String {
+ type: "String",
+ value: "'constructor'",
+
+ range: [24, 37],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [37, 38],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [38, 39],
+ loc: {
+ start: { column: 17, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [40, 41],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..880411e5b0a1
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/3-Babel-AST.shot
@@ -0,0 +1,78 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: true,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: true,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Literal {
+ type: "Literal",
+ raw: "'constructor'",
+ value: "constructor",
+
+ range: [24, 37],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [23, 39],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ ],
+
+ range: [19, 41],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "Foo",
+ optional: false,
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 41],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 3 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 42],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 4 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..a82ebf95ff87
--- /dev/null
+++ b/packages/ast-spec/src/element/TSAbstractPropertyDefinition/fixtures/key-constructor-string-computed/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,92 @@
+[
+ Identifier {
+ type: "Identifier",
+ value: "abstract",
+
+ range: [0, 8],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [9, 14],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "Foo",
+
+ range: [15, 18],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "[",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 3, line: 2 },
+ },
+ },
+ String {
+ type: "String",
+ value: "'constructor'",
+
+ range: [24, 37],
+ loc: {
+ start: { column: 3, line: 2 },
+ end: { column: 16, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "]",
+
+ range: [37, 38],
+ loc: {
+ start: { column: 16, line: 2 },
+ end: { column: 17, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [38, 39],
+ loc: {
+ start: { column: 17, line: 2 },
+ end: { column: 18, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [40, 41],
+ loc: {
+ start: { column: 0, line: 3 },
+ end: { column: 1, line: 3 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts
new file mode 100644
index 000000000000..3fcd08d2bc99
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/fixture.ts
@@ -0,0 +1,3 @@
+enum Foo {
+ 1n = 2
+}
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..87ba241f5d40
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > TSESTree - Error`]
+TSError
+ 1 | enum Foo {
+> 2 | 1n = 2
+ | ^^ An enum member cannot have a numeric name.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..b3afe3afc96e
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > Babel - Error`]
+BabelError
+ 1 | enum Foo {
+> 2 | 1n = 2
+ | ^ Unexpected token (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..083d80544d72
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/bigint-name/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSEnumMember > _error_ > bigint-name > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts
new file mode 100644
index 000000000000..2e99a8d3766b
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/fixture.ts
@@ -0,0 +1,3 @@
+enum Foo {
+ ["A"] = 2
+}
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..2079fad90f2e
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > TSESTree - Error`]
+TSError
+ 1 | enum Foo {
+> 2 | ["A"] = 2
+ | ^^^^^ Computed property names are not allowed in enums.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..c68571c79318
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > Babel - Error`]
+BabelError
+ 1 | enum Foo {
+> 2 | ["A"] = 2
+ | ^ Unexpected token (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..1331cf0d18b9
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/computed-string-name/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSEnumMember > _error_ > computed-string-name > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts
new file mode 100644
index 000000000000..174773e65995
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/fixture.ts
@@ -0,0 +1,3 @@
+enum Foo {
+ 1 = 2
+}
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..8dfacb32e5b9
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > TSESTree - Error`]
+TSError
+ 1 | enum Foo {
+> 2 | 1 = 2
+ | ^ An enum member cannot have a numeric name.
+ 3 | }
+ 4 |
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..76b2f2b9c62e
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > Babel - Error`]
+BabelError
+ 1 | enum Foo {
+> 2 | 1 = 2
+ | ^ Unexpected token (2:2)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..34e6cebc91e1
--- /dev/null
+++ b/packages/ast-spec/src/element/TSEnumMember/fixtures/_error_/number-name/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > element > TSEnumMember > _error_ > number-name > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/element/TSEnumMember/spec.ts b/packages/ast-spec/src/element/TSEnumMember/spec.ts
index a80e963ad278..a4d1b836f951 100644
--- a/packages/ast-spec/src/element/TSEnumMember/spec.ts
+++ b/packages/ast-spec/src/element/TSEnumMember/spec.ts
@@ -1,44 +1,15 @@
import type { AST_NODE_TYPES } from '../../ast-node-types';
import type { BaseNode } from '../../base/BaseNode';
+import type { Identifier } from '../../expression/Identifier/spec';
+import type { StringLiteral } from '../../expression/literal/StringLiteral/spec';
import type { Expression } from '../../unions/Expression';
-import type {
- PropertyNameComputed,
- PropertyNameNonComputed,
-} from '../../unions/PropertyName';
-interface TSEnumMemberBase extends BaseNode {
+export interface TSEnumMember extends BaseNode {
type: AST_NODE_TYPES.TSEnumMember;
- computed: boolean;
- id:
- | PropertyNameComputed // this should only happen in semantically invalid code (ts error 1164)
- | PropertyNameNonComputed;
+ id: Identifier | StringLiteral;
initializer: Expression | undefined;
+ /**
+ * @deprecated the enum member is always non-computed.
+ */
+ computed: boolean;
}
-
-/**
- * this should only really happen in semantically invalid code (errors 1164 and 2452)
- *
- * @example
- * ```ts
- * // VALID:
- * enum Foo { ['a'] }
- *
- * // INVALID:
- * const x = 'a';
- * enum Foo { [x] }
- * enum Bar { ['a' + 'b'] }
- * ```
- */
-export interface TSEnumMemberComputedName extends TSEnumMemberBase {
- computed: true;
- id: PropertyNameComputed;
-}
-
-export interface TSEnumMemberNonComputedName extends TSEnumMemberBase {
- computed: false;
- id: PropertyNameNonComputed;
-}
-
-export type TSEnumMember =
- | TSEnumMemberComputedName
- | TSEnumMemberNonComputedName;
diff --git a/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts b/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts
index 271578f8f01f..f160bf5d23d0 100644
--- a/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts
+++ b/packages/ast-spec/src/expression/ArrowFunctionExpression/spec.ts
@@ -11,7 +11,7 @@ export interface ArrowFunctionExpression extends BaseNode {
async: boolean;
body: BlockStatement | Expression;
expression: boolean;
- generator: boolean;
+ generator: false;
id: null;
params: Parameter[];
returnType: TSTypeAnnotation | undefined;
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/fixture.ts b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/fixture.ts
new file mode 100644
index 000000000000..daafa9ccb62f
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/fixture.ts
@@ -0,0 +1,4 @@
+class A {
+ #a;
+ b = #a + 1;
+}
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..ec75deb33cff
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-lhs-not-in > TSESTree - Error`]
+TSError
+ 1 | class A {
+ 2 | #a;
+> 3 | b = #a + 1;
+ | ^^ Private identifiers cannot appear on the right-hand-side of an 'in' expression.
+ 4 | }
+ 5 |
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..453c15f5a66d
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/2-Babel-Error.shot
@@ -0,0 +1,11 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-lhs-not-in > Babel - Error`]
+BabelError
+ 1 | class A {
+ 2 | #a;
+> 3 | b = #a + 1;
+ | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:6)
+ 4 | }
+ 5 |
+
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..c95813948827
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-lhs-not-in/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-lhs-not-in > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/fixture.ts b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/fixture.ts
new file mode 100644
index 000000000000..ce0e507a49fd
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/fixture.ts
@@ -0,0 +1,4 @@
+class A {
+ #a;
+ b = 1 in #a;
+}
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..67636f0e09ec
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-rhs > TSESTree - Error`]
+TSError
+ 1 | class A {
+ 2 | #a;
+> 3 | b = 1 in #a;
+ | ^^ Private identifiers are only allowed on the left-hand-side of an 'in' expression.
+ 4 | }
+ 5 |
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..2014af3eb868
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/2-Babel-Error.shot
@@ -0,0 +1,11 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-rhs > Babel - Error`]
+BabelError
+ 1 | class A {
+ 2 | #a;
+> 3 | b = 1 in #a;
+ | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:11)
+ 4 | }
+ 5 |
+
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..802be146cc95
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/_error_/private-rhs/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > BinaryExpression > _error_ > private-rhs > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/fixture.ts b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/fixture.ts
new file mode 100644
index 000000000000..f17ec7e20d07
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/fixture.ts
@@ -0,0 +1,4 @@
+class A {
+ #a;
+ b = #a in A;
+}
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..83deb39f58c9
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,138 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: false,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: PrivateIdentifier {
+ type: "PrivateIdentifier",
+ name: "a",
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [12, 15],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: false,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "b",
+ optional: false,
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: BinaryExpression {
+ type: "BinaryExpression",
+ left: PrivateIdentifier {
+ type: "PrivateIdentifier",
+ name: "a",
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ operator: "in",
+ right: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "A",
+ optional: false,
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [22, 29],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [18, 30],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+
+ range: [8, 32],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "A",
+ optional: false,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 5 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..b599e3a8bb83
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,122 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "A",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ PrivateIdentifier {
+ type: "PrivateIdentifier",
+ value: "a",
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [14, 15],
+ loc: {
+ start: { column: 4, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "b",
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [20, 21],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 5, line: 3 },
+ },
+ },
+ PrivateIdentifier {
+ type: "PrivateIdentifier",
+ value: "a",
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "in",
+
+ range: [25, 27],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "A",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [31, 32],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 4 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..83deb39f58c9
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/3-Babel-AST.shot
@@ -0,0 +1,138 @@
+Program {
+ type: "Program",
+ body: [
+ ClassDeclaration {
+ type: "ClassDeclaration",
+ abstract: false,
+ body: ClassBody {
+ type: "ClassBody",
+ body: [
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: false,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: PrivateIdentifier {
+ type: "PrivateIdentifier",
+ name: "a",
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: null,
+
+ range: [12, 15],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ PropertyDefinition {
+ type: "PropertyDefinition",
+ computed: false,
+ declare: false,
+ decorators: [],
+ definite: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "b",
+ optional: false,
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ optional: false,
+ override: false,
+ readonly: false,
+ static: false,
+ value: BinaryExpression {
+ type: "BinaryExpression",
+ left: PrivateIdentifier {
+ type: "PrivateIdentifier",
+ name: "a",
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ operator: "in",
+ right: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "A",
+ optional: false,
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [22, 29],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [18, 30],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+
+ range: [8, 32],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ declare: false,
+ decorators: [],
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "A",
+ optional: false,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ implements: [],
+ superClass: null,
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 5 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..b599e3a8bb83
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,122 @@
+[
+ Keyword {
+ type: "Keyword",
+ value: "class",
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "A",
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ PrivateIdentifier {
+ type: "PrivateIdentifier",
+ value: "a",
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [14, 15],
+ loc: {
+ start: { column: 4, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "b",
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [20, 21],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 5, line: 3 },
+ },
+ },
+ PrivateIdentifier {
+ type: "PrivateIdentifier",
+ value: "a",
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "in",
+
+ range: [25, 27],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "A",
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [29, 30],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [31, 32],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 4 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/5-AST-Alignment-AST.shot
new file mode 100644
index 000000000000..be95b85d8e44
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/5-AST-Alignment-AST.shot
@@ -0,0 +1,146 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression BinaryExpression private-lhs-in AST Alignment - AST 1`] = `
+"Snapshot Diff:
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ ClassDeclaration {
+ type: 'ClassDeclaration',
+- abstract: false,
+ body: ClassBody {
+ type: 'ClassBody',
+ body: Array [
+ PropertyDefinition {
+ type: 'PropertyDefinition',
+ computed: false,
+- declare: false,
+- decorators: Array [],
+- definite: false,
+ key: PrivateIdentifier {
+ type: 'PrivateIdentifier',
+ name: 'a',
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+- optional: false,
+- override: false,
+- readonly: false,
+ static: false,
+ value: null,
+
+ range: [12, 15],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ PropertyDefinition {
+ type: 'PropertyDefinition',
+ computed: false,
+- declare: false,
+- decorators: Array [],
+- definite: false,
+ key: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'b',
+- optional: false,
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+- optional: false,
+- override: false,
+- readonly: false,
+ static: false,
+ value: BinaryExpression {
+ type: 'BinaryExpression',
+ left: PrivateIdentifier {
+ type: 'PrivateIdentifier',
+ name: 'a',
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ operator: 'in',
+ right: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [22, 29],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+
+ range: [18, 30],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ ],
+
+ range: [8, 32],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+- declare: false,
+- decorators: Array [],
+ id: Identifier {
+ type: 'Identifier',
+- decorators: Array [],
+ name: 'A',
+- optional: false,
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+- implements: Array [],
+ superClass: null,
+
+ range: [0, 32],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 33],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 5 },
+ },
+ }"
+`;
diff --git a/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/6-AST-Alignment-Tokens.shot
new file mode 100644
index 000000000000..31764d700643
--- /dev/null
+++ b/packages/ast-spec/src/expression/BinaryExpression/fixtures/private-lhs-in/snapshots/6-AST-Alignment-Tokens.shot
@@ -0,0 +1,136 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures expression BinaryExpression private-lhs-in AST Alignment - Token 1`] = `
+"Snapshot Diff:
+- TSESTree
++ Babel
+
+ Array [
+ Keyword {
+ type: 'Keyword',
+ value: 'class',
+
+ range: [0, 5],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 5, line: 1 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'A',
+
+ range: [6, 7],
+ loc: {
+ start: { column: 6, line: 1 },
+ end: { column: 7, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
+- value: '#a',
++ PrivateIdentifier {
++ type: 'PrivateIdentifier',
++ value: 'a',
+
+ range: [12, 14],
+ loc: {
+ start: { column: 2, line: 2 },
+ end: { column: 4, line: 2 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [14, 15],
+ loc: {
+ start: { column: 4, line: 2 },
+ end: { column: 5, line: 2 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'b',
+
+ range: [18, 19],
+ loc: {
+ start: { column: 2, line: 3 },
+ end: { column: 3, line: 3 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [20, 21],
+ loc: {
+ start: { column: 4, line: 3 },
+ end: { column: 5, line: 3 },
+ },
+ },
+- Identifier {
+- type: 'Identifier',
+- value: '#a',
++ PrivateIdentifier {
++ type: 'PrivateIdentifier',
++ value: 'a',
+
+ range: [22, 24],
+ loc: {
+ start: { column: 6, line: 3 },
+ end: { column: 8, line: 3 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'in',
+
+ range: [25, 27],
+ loc: {
+ start: { column: 9, line: 3 },
+ end: { column: 11, line: 3 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'A',
+
+ range: [28, 29],
+ loc: {
+ start: { column: 12, line: 3 },
+ end: { column: 13, line: 3 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [29, 30],
+ loc: {
+ start: { column: 13, line: 3 },
+ end: { column: 14, line: 3 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [31, 32],
+ loc: {
+ start: { column: 0, line: 4 },
+ end: { column: 1, line: 4 },
+ },
+ },
+ ]"
+`;
diff --git a/packages/ast-spec/src/expression/BinaryExpression/spec.ts b/packages/ast-spec/src/expression/BinaryExpression/spec.ts
index 6c262d443064..874df2c6d586 100644
--- a/packages/ast-spec/src/expression/BinaryExpression/spec.ts
+++ b/packages/ast-spec/src/expression/BinaryExpression/spec.ts
@@ -7,9 +7,18 @@ import type { BinaryOperatorToText } from './BinaryOperatorToText';
export * from './BinaryOperatorToText';
-export interface BinaryExpression extends BaseNode {
+export interface PrivateInExpression extends BaseNode {
type: AST_NODE_TYPES.BinaryExpression;
- left: Expression | PrivateIdentifier;
+ left: PrivateIdentifier;
+ operator: 'in';
+ right: Expression;
+}
+
+export interface SymmetricBinaryExpression extends BaseNode {
+ type: AST_NODE_TYPES.BinaryExpression;
+ left: Expression;
operator: ValueOf;
right: Expression;
}
+
+export type BinaryExpression = PrivateInExpression | SymmetricBinaryExpression;
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot
index e172a1d225d5..0cf17825f8a7 100644
--- a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/extra-arguments/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > ImportExpression > _error_ > extra-arguments > Babel - Error`]
-SyntaxError: `import()` requires exactly one or two arguments. (1:0)
+BabelError
+> 1 | import(
+ | ^ `import()` requires exactly one or two arguments. (1:0)
+ 2 | "./source.json",
+ 3 | {assert: {type: "json"}},
+ 4 | extraArgument
+
diff --git a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot
index 6fb52dd6f0b0..24bd7006421a 100644
--- a/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/ImportExpression/fixtures/_error_/no-arguments/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > ImportExpression > _error_ > no-arguments > Babel - Error`]
-SyntaxError: `import()` requires exactly one or two arguments. (1:0)
+BabelError
+> 1 | import();
+ | ^ `import()` requires exactly one or two arguments. (1:0)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/fixture.ts
new file mode 100644
index 000000000000..7da365aa96dc
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/fixture.ts
@@ -0,0 +1 @@
+({abstract get getter(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..c6b3818e424f
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-abstract > TSESTree - Error`]
+TSError
+> 1 | ({abstract get getter(){}})
+ | ^^^^^^ An abstract accessor cannot have an implementation.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..8c1fc8d18638
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-abstract > Babel - Error`]
+BabelError
+> 1 | ({abstract get getter(){}})
+ | ^ Unexpected token, expected "," (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..f5385a54f496
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-abstract/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-abstract > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/fixture.ts
new file mode 100644
index 000000000000..503e02f960ae
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/fixture.ts
@@ -0,0 +1 @@
+({async get getter(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..469f62b8e05e
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-async > TSESTree - Error`]
+TSError
+> 1 | ({async get getter(){}})
+ | ^^^^^ 'async' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..21344f041c47
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-async > Babel - Error`]
+BabelError
+> 1 | ({async get getter(){}})
+ | ^ Unexpected token, expected "(" (1:12)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..f37cf0b5cb71
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-async/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-async > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/fixture.ts
new file mode 100644
index 000000000000..c4665dca5599
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/fixture.ts
@@ -0,0 +1 @@
+({declare get getter(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..3be473c2e955
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-declare > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..89aa85c1528a
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-declare > Babel - Error`]
+BabelError
+> 1 | ({declare get getter(){}})
+ | ^ Unexpected token, expected "," (1:10)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..fe62478d60e3
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-declare > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/fixture.ts
new file mode 100644
index 000000000000..49c45b221289
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/fixture.ts
@@ -0,0 +1 @@
+({export get getter(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..04a140d4a86a
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-export > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..43fd96f8211f
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-export > Babel - Error`]
+BabelError
+> 1 | ({export get getter(){}})
+ | ^ Unexpected keyword 'export'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..2630e9395407
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-export/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-export > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/fixture.ts
new file mode 100644
index 000000000000..9c38112689a7
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/fixture.ts
@@ -0,0 +1 @@
+({override get getter(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..bd0dd27042de
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-override > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..3cd034d0f848
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-override > Babel - Error`]
+BabelError
+> 1 | ({override get getter(){}})
+ | ^ Unexpected token, expected "," (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..67072b96a25f
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-override/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-override > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/fixture.ts
new file mode 100644
index 000000000000..8c3c3f387734
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/fixture.ts
@@ -0,0 +1 @@
+({private get getter(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..2a95a795d410
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-private > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..ad8f34751b30
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-private > Babel - Error`]
+BabelError
+> 1 | ({private get getter(){}})
+ | ^ Unexpected reserved word 'private'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..e5449cb3d436
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-private/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-private > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/fixture.ts
new file mode 100644
index 000000000000..f6182886cf4b
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/fixture.ts
@@ -0,0 +1 @@
+({protected get getter(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..5a842187ab8b
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-protected > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..f50ad9df0644
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-protected > Babel - Error`]
+BabelError
+> 1 | ({protected get getter(){}})
+ | ^ Unexpected reserved word 'protected'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..d3a451a6f34a
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-protected > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/fixture.ts
new file mode 100644
index 000000000000..d168f83f4877
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/fixture.ts
@@ -0,0 +1 @@
+({public get getter(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..c77a8e8fcb1f
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-public > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..a0bfd54c27b9
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-public > Babel - Error`]
+BabelError
+> 1 | ({public get getter(){}})
+ | ^ Unexpected reserved word 'public'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..b9cf0e7bb818
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-public/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-public > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/fixture.ts
new file mode 100644
index 000000000000..f783949c9c17
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/fixture.ts
@@ -0,0 +1 @@
+({static get getter(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..e119aa3d2ea1
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-static > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..7a4f79268aa6
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-static > Babel - Error`]
+BabelError
+> 1 | ({static get getter(){}})
+ | ^ Unexpected reserved word 'static'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..dbd2ec6c9b39
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/getter-modifier-static/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > getter-modifier-static > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/fixture.ts
new file mode 100644
index 000000000000..8d7ba0694b01
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/fixture.ts
@@ -0,0 +1 @@
+({abstract method(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..2a9157795088
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-abstract > TSESTree - Error`]
+TSError
+> 1 | ({abstract method(){}})
+ | ^^^^^^^^ 'abstract' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..36577e2c3b93
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-abstract > Babel - Error`]
+BabelError
+> 1 | ({abstract method(){}})
+ | ^ Unexpected token, expected "," (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..69159de758f3
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-abstract/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-abstract > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/fixture.ts
new file mode 100644
index 000000000000..d04b737ea44c
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/fixture.ts
@@ -0,0 +1 @@
+({declare method(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..98198fa601fb
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-declare > TSESTree - Error`]
+TSError
+> 1 | ({declare method(){}})
+ | ^^^^^^^ 'declare' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..8a265181dc1b
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-declare > Babel - Error`]
+BabelError
+> 1 | ({declare method(){}})
+ | ^ Unexpected token, expected "," (1:10)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..cb8d4e5a8d3e
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-declare/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-declare > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/fixture.ts
new file mode 100644
index 000000000000..53ce4bbc923f
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/fixture.ts
@@ -0,0 +1 @@
+({export method(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..f5c77f873fcf
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-export > TSESTree - Error`]
+TSError
+> 1 | ({export method(){}})
+ | ^^^^^^ 'export' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..40acbd491c03
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-export > Babel - Error`]
+BabelError
+> 1 | ({export method(){}})
+ | ^ Unexpected keyword 'export'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..2af6c62d78e0
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-export/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-export > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/fixture.ts
new file mode 100644
index 000000000000..f4a1f8044de5
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/fixture.ts
@@ -0,0 +1 @@
+({override method(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..9132d6be3aa1
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-override > TSESTree - Error`]
+TSError
+> 1 | ({override method(){}})
+ | ^^^^^^^^ 'override' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..dc144f96e410
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-override > Babel - Error`]
+BabelError
+> 1 | ({override method(){}})
+ | ^ Unexpected token, expected "," (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..740638b17ca9
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-override/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-override > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/fixture.ts
new file mode 100644
index 000000000000..17216fafa6ba
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/fixture.ts
@@ -0,0 +1 @@
+({private method(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..94c0b2b78538
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-private > TSESTree - Error`]
+TSError
+> 1 | ({private method(){}})
+ | ^^^^^^^ 'private' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..efc040b8e2b4
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-private > Babel - Error`]
+BabelError
+> 1 | ({private method(){}})
+ | ^ Unexpected reserved word 'private'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..bf509a674a8c
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-private/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-private > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/fixture.ts
new file mode 100644
index 000000000000..d0b475ae7b53
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/fixture.ts
@@ -0,0 +1 @@
+({protected method(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..537e86f8b7e8
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-protected > TSESTree - Error`]
+TSError
+> 1 | ({protected method(){}})
+ | ^^^^^^^^^ 'protected' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..1ada22fc7d6c
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-protected > Babel - Error`]
+BabelError
+> 1 | ({protected method(){}})
+ | ^ Unexpected reserved word 'protected'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..756b258562c3
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-protected/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-protected > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/fixture.ts
new file mode 100644
index 000000000000..71ae66b69227
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/fixture.ts
@@ -0,0 +1 @@
+({public method(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..3b0a6228b3bf
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-public > TSESTree - Error`]
+TSError
+> 1 | ({public method(){}})
+ | ^^^^^^ 'public' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..0e7d870a4cdb
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-public > Babel - Error`]
+BabelError
+> 1 | ({public method(){}})
+ | ^ Unexpected reserved word 'public'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..c4b3fe4fd6df
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-public/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-public > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/fixture.ts
new file mode 100644
index 000000000000..4327f0fc0277
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/fixture.ts
@@ -0,0 +1 @@
+({static method(){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..462a18ebf56e
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-static > TSESTree - Error`]
+TSError
+> 1 | ({static method(){}})
+ | ^^^^^^ 'static' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..ab26c91ba108
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-static > Babel - Error`]
+BabelError
+> 1 | ({static method(){}})
+ | ^ Unexpected reserved word 'static'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..901470979766
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/method-modifier-static/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > method-modifier-static > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot
index 75be7695d3c1..f008887400ca 100644
--- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-getter-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > ObjectExpression > _error_ > missing-getter-body > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:11)
+BabelError
+> 1 | ({get foo();})
+ | ^ Unexpected token, expected "{" (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot
index 63c0979436ab..f88ac257cfaf 100644
--- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-method-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > ObjectExpression > _error_ > missing-method-body > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:10)
+BabelError
+> 1 | ({method();})
+ | ^ Unexpected token, expected "{" (1:10)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot
index 2f6b7b23b6b4..1414079b7aed 100644
--- a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/missing-setter-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > ObjectExpression > _error_ > missing-setter-body > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (1:16)
+BabelError
+> 1 | ({set foo(value);})
+ | ^ Unexpected token, expected "{" (1:16)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/fixture.ts
new file mode 100644
index 000000000000..5a91f9a97b8c
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/fixture.ts
@@ -0,0 +1 @@
+({abstract property: 1})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..3fde78482148
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-abstract > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..7a92a736eb21
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-abstract > Babel - Error`]
+BabelError
+> 1 | ({abstract property: 1})
+ | ^ Unexpected token, expected "," (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..7e13c1111604
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-abstract > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/fixture.ts
new file mode 100644
index 000000000000..9b6990e1578c
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/fixture.ts
@@ -0,0 +1 @@
+({async property: 1})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..083a82058ab1
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-async > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..6e65e9380954
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-async > Babel - Error`]
+BabelError
+> 1 | ({async property: 1})
+ | ^ Unexpected token, expected "(" (1:16)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..210d506718ef
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-async/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-async > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/fixture.ts
new file mode 100644
index 000000000000..ab759d58ee6b
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/fixture.ts
@@ -0,0 +1 @@
+({declare property: 1})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..db7a3ac5dc66
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-declare > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..1566801a28d7
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-declare > Babel - Error`]
+BabelError
+> 1 | ({declare property: 1})
+ | ^ Unexpected token, expected "," (1:10)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..6c5dc1bac93d
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-declare/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-declare > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/fixture.ts
new file mode 100644
index 000000000000..de0b9ac7be0e
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/fixture.ts
@@ -0,0 +1 @@
+({export property: 1})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..1763adeb0c88
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-export > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..791277f74ff2
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-export > Babel - Error`]
+BabelError
+> 1 | ({export property: 1})
+ | ^ Unexpected keyword 'export'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..042904f5eb84
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-export/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-export > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/fixture.ts
new file mode 100644
index 000000000000..c31d3bf6e27a
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/fixture.ts
@@ -0,0 +1 @@
+({override property: 1})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..1e13125b9002
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-override > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..1e14511997de
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-override > Babel - Error`]
+BabelError
+> 1 | ({override property: 1})
+ | ^ Unexpected token, expected "," (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..ad900508147d
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-override/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-override > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/fixture.ts
new file mode 100644
index 000000000000..463b7c4ab593
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/fixture.ts
@@ -0,0 +1 @@
+({private property: 1})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..3dfdac48c91f
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-private > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..490659356138
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-private > Babel - Error`]
+BabelError
+> 1 | ({private property: 1})
+ | ^ Unexpected reserved word 'private'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..ac6b919842ba
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-private/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-private > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/fixture.ts
new file mode 100644
index 000000000000..bcffd32f4654
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/fixture.ts
@@ -0,0 +1 @@
+({protected property: 1})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..22fe1acfb0cb
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-protected > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..d3c7faa9ff5c
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-protected > Babel - Error`]
+BabelError
+> 1 | ({protected property: 1})
+ | ^ Unexpected reserved word 'protected'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..d9b57268bc1f
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-protected/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-protected > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/fixture.ts
new file mode 100644
index 000000000000..d0bdb34d9222
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/fixture.ts
@@ -0,0 +1 @@
+({public property: 1})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..ea015d3e6ff5
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-public > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..5bfdabbf290e
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-public > Babel - Error`]
+BabelError
+> 1 | ({public property: 1})
+ | ^ Unexpected reserved word 'public'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..37db719aafbe
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-public/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-public > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/fixture.ts
new file mode 100644
index 000000000000..7b8844223f9d
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/fixture.ts
@@ -0,0 +1 @@
+({static property: 1})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..9cddb615c99a
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-static > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..9f748a2d8d56
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-static > Babel - Error`]
+BabelError
+> 1 | ({static property: 1})
+ | ^ Unexpected reserved word 'static'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..04df46c94c5c
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/property-modifier-static/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > property-modifier-static > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/fixture.ts
new file mode 100644
index 000000000000..b6ab4dcdf39b
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/fixture.ts
@@ -0,0 +1 @@
+({abstract set setter(v){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..a8576b829681
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-abstract > TSESTree - Error`]
+TSError
+> 1 | ({abstract set setter(v){}})
+ | ^^^^^^ An abstract accessor cannot have an implementation.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..aa2f22b8ab88
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-abstract > Babel - Error`]
+BabelError
+> 1 | ({abstract set setter(v){}})
+ | ^ Unexpected token, expected "," (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..555eb1dcb596
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-abstract/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-abstract > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/fixture.ts
new file mode 100644
index 000000000000..b7d58fc71cc9
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/fixture.ts
@@ -0,0 +1 @@
+({async set setter(v){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..5040e61ae271
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-async > TSESTree - Error`]
+TSError
+> 1 | ({async set setter(v){}})
+ | ^^^^^ 'async' modifier cannot be used here.
+ 2 |
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..1ea7c6ed8f91
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-async > Babel - Error`]
+BabelError
+> 1 | ({async set setter(v){}})
+ | ^ Unexpected token, expected "(" (1:12)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..3e5b8ccf4efc
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-async/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-async > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/fixture.ts
new file mode 100644
index 000000000000..6bcb875be849
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/fixture.ts
@@ -0,0 +1 @@
+({declare set setter(v){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..cf76a53db090
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-declare > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..067419e5adbb
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-declare > Babel - Error`]
+BabelError
+> 1 | ({declare set setter(v){}})
+ | ^ Unexpected token, expected "," (1:10)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..48b461cd66d9
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-declare > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/fixture.ts
new file mode 100644
index 000000000000..f7d4ca9236af
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/fixture.ts
@@ -0,0 +1 @@
+({export set setter(v){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..0683934ea344
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-export > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..6cc5ed90ad4e
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-export > Babel - Error`]
+BabelError
+> 1 | ({export set setter(v){}})
+ | ^ Unexpected keyword 'export'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..3f52b9168036
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-export/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-export > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/fixture.ts
new file mode 100644
index 000000000000..eeafc1fea1ad
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/fixture.ts
@@ -0,0 +1 @@
+({override set setter(v){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..ab027e28bbfd
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-override > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..f40423fb0984
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-override > Babel - Error`]
+BabelError
+> 1 | ({override set setter(v){}})
+ | ^ Unexpected token, expected "," (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..3c28691efdd0
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-override/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-override > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/fixture.ts
new file mode 100644
index 000000000000..f81f8fa55022
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/fixture.ts
@@ -0,0 +1 @@
+({private set setter(v){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..bad8df2cd939
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-private > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..65345de45e99
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-private > Babel - Error`]
+BabelError
+> 1 | ({private set setter(v){}})
+ | ^ Unexpected reserved word 'private'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..5601896eea99
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-private/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-private > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/fixture.ts
new file mode 100644
index 000000000000..32b267e2189a
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/fixture.ts
@@ -0,0 +1 @@
+({protected set setter(v){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..5e6e7e168fe2
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-protected > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..82cf31f6cf35
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-protected > Babel - Error`]
+BabelError
+> 1 | ({protected set setter(v){}})
+ | ^ Unexpected reserved word 'protected'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..5085cb1873b3
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-protected > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/fixture.ts
new file mode 100644
index 000000000000..7949d3875d67
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/fixture.ts
@@ -0,0 +1 @@
+({public set setter(v){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..efd2d846400f
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-public > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..6be782e5749f
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-public > Babel - Error`]
+BabelError
+> 1 | ({public set setter(v){}})
+ | ^ Unexpected reserved word 'public'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..48db772cb684
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-public/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-public > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/fixture.ts
new file mode 100644
index 000000000000..df98c494c04d
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/fixture.ts
@@ -0,0 +1 @@
+({static set setter(v){}})
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..9c69f633480d
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-static > TSESTree - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..98ec583edf82
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-static > Babel - Error`]
+BabelError
+> 1 | ({static set setter(v){}})
+ | ^ Unexpected reserved word 'static'. (1:2)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..75f0064be033
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/_error_/setter-modifier-static/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > ObjectExpression > _error_ > setter-modifier-static > Error Alignment`]
+Babel errored but TSESTree didn't
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/fixture.ts b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/fixture.ts
new file mode 100644
index 000000000000..29ec8ac274e0
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/fixture.ts
@@ -0,0 +1 @@
+({ async method() {} });
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..c6ed369c1008
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,83 @@
+Program {
+ type: "Program",
+ body: [
+ ExpressionStatement {
+ type: "ExpressionStatement",
+ expression: ObjectExpression {
+ type: "ObjectExpression",
+ properties: [
+ Property {
+ type: "Property",
+ computed: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "method",
+ optional: false,
+
+ range: [9, 15],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 15, line: 1 },
+ },
+ },
+ kind: "init",
+ method: true,
+ optional: false,
+ shorthand: false,
+ value: FunctionExpression {
+ type: "FunctionExpression",
+ async: true,
+ body: BlockStatement {
+ type: "BlockStatement",
+ body: [],
+
+ range: [18, 20],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ declare: false,
+ expression: false,
+ generator: false,
+ id: null,
+ params: [],
+
+ range: [15, 20],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+
+ range: [3, 20],
+ loc: {
+ start: { column: 3, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ ],
+
+ range: [1, 22],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+
+ range: [0, 24],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 25],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..99aed7b8b364
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,112 @@
+[
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [0, 1],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [1, 2],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 2, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "async",
+
+ range: [3, 8],
+ loc: {
+ start: { column: 3, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "method",
+
+ range: [9, 15],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 15, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [16, 17],
+ loc: {
+ start: { column: 16, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [18, 19],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [21, 22],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [22, 23],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 23, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 23, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..c6ed369c1008
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/3-Babel-AST.shot
@@ -0,0 +1,83 @@
+Program {
+ type: "Program",
+ body: [
+ ExpressionStatement {
+ type: "ExpressionStatement",
+ expression: ObjectExpression {
+ type: "ObjectExpression",
+ properties: [
+ Property {
+ type: "Property",
+ computed: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "method",
+ optional: false,
+
+ range: [9, 15],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 15, line: 1 },
+ },
+ },
+ kind: "init",
+ method: true,
+ optional: false,
+ shorthand: false,
+ value: FunctionExpression {
+ type: "FunctionExpression",
+ async: true,
+ body: BlockStatement {
+ type: "BlockStatement",
+ body: [],
+
+ range: [18, 20],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ declare: false,
+ expression: false,
+ generator: false,
+ id: null,
+ params: [],
+
+ range: [15, 20],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+
+ range: [3, 20],
+ loc: {
+ start: { column: 3, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ ],
+
+ range: [1, 22],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+
+ range: [0, 24],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 25],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..99aed7b8b364
--- /dev/null
+++ b/packages/ast-spec/src/expression/ObjectExpression/fixtures/method-modifier-async/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,112 @@
+[
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [0, 1],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [1, 2],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 2, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "async",
+
+ range: [3, 8],
+ loc: {
+ start: { column: 3, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "method",
+
+ range: [9, 15],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 15, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [15, 16],
+ loc: {
+ start: { column: 15, line: 1 },
+ end: { column: 16, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [16, 17],
+ loc: {
+ start: { column: 16, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [18, 19],
+ loc: {
+ start: { column: 18, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [21, 22],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [22, 23],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 23, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [23, 24],
+ loc: {
+ start: { column: 23, line: 1 },
+ end: { column: 24, line: 1 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/fixture.ts b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/fixture.ts
new file mode 100644
index 000000000000..402329cc285f
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/fixture.ts
@@ -0,0 +1,4 @@
+class A {
+ #a;
+ c = (#a, 1);
+}
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..ba6e5a7a7e5f
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-lhs > TSESTree - Error`]
+TSError
+ 1 | class A {
+ 2 | #a;
+> 3 | c = (#a, 1);
+ | ^^ Private identifiers cannot appear on the right-hand-side of an 'in' expression.
+ 4 | }
+ 5 |
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..9006b349152b
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/2-Babel-Error.shot
@@ -0,0 +1,11 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-lhs > Babel - Error`]
+BabelError
+ 1 | class A {
+ 2 | #a;
+> 3 | c = (#a, 1);
+ | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:7)
+ 4 | }
+ 5 |
+
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..15de730f25f8
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-lhs/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-lhs > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/fixture.ts b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/fixture.ts
new file mode 100644
index 000000000000..9f1df9d73fa4
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/fixture.ts
@@ -0,0 +1,4 @@
+class A {
+ #a;
+ c = (1, #a);
+}
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..da508ef53ff0
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-rhs > TSESTree - Error`]
+TSError
+ 1 | class A {
+ 2 | #a;
+> 3 | c = (1, #a);
+ | ^^ Private identifiers are only allowed on the left-hand-side of an 'in' expression.
+ 4 | }
+ 5 |
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..4a6a0b8baf68
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/2-Babel-Error.shot
@@ -0,0 +1,11 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-rhs > Babel - Error`]
+BabelError
+ 1 | class A {
+ 2 | #a;
+> 3 | c = (1, #a);
+ | ^ Private names are only allowed in property accesses (`obj.#a`) or in `in` expressions (`#a in obj`). (3:10)
+ 4 | }
+ 5 |
+
diff --git a/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..aeb556b36b22
--- /dev/null
+++ b/packages/ast-spec/src/expression/SequenceExpression/fixtures/_error_/private-id-rhs/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > SequenceExpression > _error_ > private-id-rhs > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/fixture.ts b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/fixture.ts
new file mode 100644
index 000000000000..7fc56660a355
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/fixture.ts
@@ -0,0 +1 @@
+a?.b()`...`
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..e096b5f6d715
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-function-tag > TSESTree - Error`]
+TSError
+> 1 | a?.b()`...`
+ | ^^^^^^^^^^^ Tagged template expressions are not permitted in an optional chain.
+ 2 |
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..69c9ea2f84ea
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-function-tag > Babel - Error`]
+BabelError
+> 1 | a?.b()`...`
+ | ^ Tagged Template Literals are not allowed in optionalChain. (1:0)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..11aea0c55d48
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-function-tag/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-function-tag > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/fixture.ts b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/fixture.ts
new file mode 100644
index 000000000000..d6e041652e3d
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/fixture.ts
@@ -0,0 +1 @@
+a?.b.c`...`
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..3be80a77ffb4
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-tag > TSESTree - Error`]
+TSError
+> 1 | a?.b.c`...`
+ | ^^^^^^^^^^^ Tagged template expressions are not permitted in an optional chain.
+ 2 |
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..e27266628424
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-tag > Babel - Error`]
+BabelError
+> 1 | a?.b.c`...`
+ | ^ Tagged Template Literals are not allowed in optionalChain. (1:0)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..87a5ea5117c6
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-nested-tag/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-nested-tag > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/fixture.ts b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/fixture.ts
new file mode 100644
index 000000000000..fb8c8604a1d5
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/fixture.ts
@@ -0,0 +1 @@
+a?.b`...`
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..b7909f67ed9e
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-tag > TSESTree - Error`]
+TSError
+> 1 | a?.b`...`
+ | ^^^^^^^^^ Tagged template expressions are not permitted in an optional chain.
+ 2 |
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..23079d1b071e
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-tag > Babel - Error`]
+BabelError
+> 1 | a?.b`...`
+ | ^ Tagged Template Literals are not allowed in optionalChain. (1:0)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/3-Alignment-Error.shot
new file mode 100644
index 000000000000..d32839672fdb
--- /dev/null
+++ b/packages/ast-spec/src/expression/TaggedTemplateExpression/fixtures/_error_/optional-tag/snapshots/3-Alignment-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > expression > TaggedTemplateExpression > _error_ > optional-tag > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/expression/UnaryExpression/spec.ts b/packages/ast-spec/src/expression/UnaryExpression/spec.ts
index 2d9f09f317b8..e68cc35047d0 100644
--- a/packages/ast-spec/src/expression/UnaryExpression/spec.ts
+++ b/packages/ast-spec/src/expression/UnaryExpression/spec.ts
@@ -1,7 +1,31 @@
import type { AST_NODE_TYPES } from '../../ast-node-types';
import type { UnaryExpressionBase } from '../../base/UnaryExpressionBase';
-export interface UnaryExpression extends UnaryExpressionBase {
+interface UnaryExpressionSpecific
+ extends UnaryExpressionBase {
type: AST_NODE_TYPES.UnaryExpression;
- operator: '!' | '+' | '~' | '-' | 'delete' | 'typeof' | 'void';
+ operator: T;
}
+
+export type UnaryExpressionNot = UnaryExpressionSpecific<'!'>;
+
+export type UnaryExpressionPlus = UnaryExpressionSpecific<'+'>;
+
+export type UnaryExpressionMinus = UnaryExpressionSpecific<'-'>;
+
+export type UnaryExpressionDelete = UnaryExpressionSpecific<'delete'>;
+
+export type UnaryExpressionTypeof = UnaryExpressionSpecific<'typeof'>;
+
+export type UnaryExpressionVoid = UnaryExpressionSpecific<'void'>;
+
+export type UnaryExpressionBitwiseNot = UnaryExpressionSpecific<'~'>;
+
+export type UnaryExpression =
+ | UnaryExpressionBitwiseNot
+ | UnaryExpressionDelete
+ | UnaryExpressionMinus
+ | UnaryExpressionNot
+ | UnaryExpressionPlus
+ | UnaryExpressionTypeof
+ | UnaryExpressionVoid;
diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot
index f254c274c881..11c9fa5deba0 100644
--- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/call-expr/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > UpdateExpression > _error_ > call-expr > Babel - Error`]
-SyntaxError: Invalid left-hand side in postfix operation. (1:0)
+BabelError
+> 1 | a()++;
+ | ^ Invalid left-hand side in postfix operation. (1:0)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot
index 67b54975f662..c2766f769ac6 100644
--- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/literal/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > UpdateExpression > _error_ > literal > Babel - Error`]
-SyntaxError: Invalid left-hand side in postfix operation. (1:0)
+BabelError
+> 1 | 1++;
+ | ^ Invalid left-hand side in postfix operation. (1:0)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot
index 91473dbcc636..7a3e4de5faf0 100644
--- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > UpdateExpression > _error_ > optional-chain > Babel - Error`]
-SyntaxError: This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0)
+BabelError
+> 1 | x?.y++;
+ | ^ This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot
index 0ddfe456abaa..9dd7dbc9fb81 100644
--- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain2/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > UpdateExpression > _error_ > optional-chain2 > Babel - Error`]
-SyntaxError: This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0)
+BabelError
+> 1 | x?.y.z++;
+ | ^ This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot
index 3c478bc81318..25bcdc744cb3 100644
--- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/optional-chain3/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > UpdateExpression > _error_ > optional-chain3 > Babel - Error`]
-SyntaxError: This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0)
+BabelError
+> 1 | x?.y().z++;
+ | ^ This experimental syntax requires enabling the parser plugin: "optionalChainingAssign". (1:0)
+ 2 |
+
diff --git a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot
index 96d9daba8b0b..c99074e87e83 100644
--- a/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/expression/UpdateExpression/fixtures/_error_/paren-expr/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > expression > UpdateExpression > _error_ > paren-expr > Babel - Error`]
-SyntaxError: Invalid left-hand side in postfix operation. (1:1)
+BabelError
+> 1 | (a())++;
+ | ^ Invalid left-hand side in postfix operation. (1:1)
+ 2 |
+
diff --git a/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/2-TSESTree-Tokens.shot
index 52c93eab8644..1d0b129b61d1 100644
--- a/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/2-TSESTree-Tokens.shot
@@ -81,21 +81,11 @@
},
Punctuator {
type: "Punctuator",
- value: "<",
+ value: "",
- range: [17, 18],
+ range: [17, 19],
loc: {
start: { column: 17, line: 1 },
- end: { column: 18, line: 1 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "/",
-
- range: [18, 19],
- loc: {
- start: { column: 18, line: 1 },
end: { column: 19, line: 1 },
},
},
diff --git a/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/6-AST-Alignment-Tokens.shot
index 55dc02b2a6c9..a5be8a92c520 100644
--- a/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/jsx/JSXAttribute/fixtures/element-non-self-closing/snapshots/6-AST-Alignment-Tokens.shot
@@ -2,4 +2,160 @@
exports[`AST Fixtures > jsx > JSXAttribute > element-non-self-closing > AST Alignment - Token`]
Snapshot Diff:
-Compared values have no visual difference.
+- TSESTree
++ Babel
+
+ Array [
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [0, 1],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 1, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'App',
+
+ range: [1, 4],
+ loc: {
+ start: { column: 1, line: 1 },
+ end: { column: 4, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'foo',
+
+ range: [5, 8],
+ loc: {
+ start: { column: 5, line: 1 },
+ end: { column: 8, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [8, 9],
+ loc: {
+ start: { column: 8, line: 1 },
+ end: { column: 9, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '<',
+
+ range: [9, 10],
+ loc: {
+ start: { column: 9, line: 1 },
+ end: { column: 10, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'div',
+
+ range: [10, 13],
+ loc: {
+ start: { column: 10, line: 1 },
+ end: { column: 13, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [13, 14],
+ loc: {
+ start: { column: 13, line: 1 },
+ end: { column: 14, line: 1 },
+ },
+ },
+ JSXText {
+ type: 'JSXText',
+ value: 'bar',
+
+ range: [14, 17],
+ loc: {
+ start: { column: 14, line: 1 },
+ end: { column: 17, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+- value: '',
++ value: '<',
+
+- range: [17, 19],
++ range: [17, 18],
+ loc: {
+ start: { column: 17, line: 1 },
++ end: { column: 18, line: 1 },
++ },
++ },
++ Punctuator {
++ type: 'Punctuator',
++ value: '/',
++
++ range: [18, 19],
++ loc: {
++ start: { column: 18, line: 1 },
+ end: { column: 19, line: 1 },
+ },
+ },
+ JSXIdentifier {
+ type: 'JSXIdentifier',
+ value: 'div',
+
+ range: [19, 22],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 22, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [22, 23],
+ loc: {
+ start: { column: 22, line: 1 },
+ end: { column: 23, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '/',
+
+ range: [24, 25],
+ loc: {
+ start: { column: 24, line: 1 },
+ end: { column: 25, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '>',
+
+ range: [25, 26],
+ loc: {
+ start: { column: 25, line: 1 },
+ end: { column: 26, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [26, 27],
+ loc: {
+ start: { column: 26, line: 1 },
+ end: { column: 27, line: 1 },
+ },
+ },
+ ]
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot
index 4b048a6998fe..559bb0197281 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot
@@ -521,21 +521,11 @@
},
Punctuator {
type: "Punctuator",
- value: "<",
+ value: "",
- range: [275, 276],
+ range: [275, 277],
loc: {
start: { column: 28, line: 9 },
- end: { column: 29, line: 9 },
- },
- },
- Punctuator {
- type: "Punctuator",
- value: "/",
-
- range: [276, 277],
- loc: {
- start: { column: 29, line: 9 },
end: { column: 30, line: 9 },
},
},
diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot
index 77f560e79abf..428f2e875de7 100644
--- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot
@@ -542,21 +542,23 @@ Snapshot Diff:
},
Punctuator {
type: 'Punctuator',
- value: '<',
+- value: '',
++ value: '<',
- range: [275, 276],
+- range: [275, 277],
++ range: [275, 276],
loc: {
start: { column: 28, line: 9 },
- end: { column: 29, line: 9 },
- },
- },
- Punctuator {
- type: 'Punctuator',
- value: '/',
-
- range: [276, 277],
- loc: {
- start: { column: 29, line: 9 },
++ end: { column: 29, line: 9 },
++ },
++ },
++ Punctuator {
++ type: 'Punctuator',
++ value: '/',
++
++ range: [276, 277],
++ loc: {
++ start: { column: 29, line: 9 },
end: { column: 30, line: 9 },
},
},
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot
index 802164c43fb8..c3064f2c191b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-abstract-static-constructor/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > abstract-class-with-abstract-static-constructor > Babel - Error`]
-SyntaxError: 'static' modifier cannot be used with 'abstract' modifier. (4:11)
+BabelError
+ 2 |
+ 3 | export abstract class AbstractSocket {
+> 4 | abstract static constructor();
+ | ^ 'static' modifier cannot be used with 'abstract' modifier. (4:11)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot
index 0b00b4cdf6c5..aa73011ad650 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-class-with-override-property/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > abstract-class-with-override-property > Babel - Error`]
-SyntaxError: Property 'foo' cannot have an initializer because it is marked abstract. (4:24)
+BabelError
+ 2 |
+ 3 | abstract class SpecializedComponent extends SomeComponent {
+> 4 | abstract override foo = 1;
+ | ^ Property 'foo' cannot have an initializer because it is marked abstract. (4:24)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot
index 4bb592375d4a..1af0e07eb087 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/abstract-interface/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > abstract-interface > Babel - Error`]
-SyntaxError: 'abstract' modifier can only appear on a class, method, or property declaration. (3:7)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | export abstract interface I {
+ | ^ 'abstract' modifier can only appear on a class, method, or property declaration. (3:7)
+ 4 | }
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot
index 06bf7d76b398..c36fee2891bf 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/await-without-async-function/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > await-without-async-function > Babel - Error`]
-SyntaxError: Unexpected reserved word 'await'. (4:14)
+BabelError
+ 2 |
+ 3 | function foo() {
+> 4 | const bar = await baz();
+ | ^ Unexpected reserved word 'await'. (4:14)
+ 5 | return bar.qux;
+ 6 | }
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot
index f33c24ea95a7..b4121cb4ae51 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-private-identifier-field-with-accessibility-error > Babel - Error`]
-SyntaxError: Private elements cannot have an accessibility modifier ('private'). (4:2)
+BabelError
+ 2 |
+ 3 | class Foo {
+> 4 | private #priv1: string
+ | ^ Private elements cannot have an accessibility modifier ('private'). (4:2)
+ 5 | public #priv2: string
+ 6 | static #priv3: string
+ 7 | }
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot
index db76a5bf8aa9..69f1445d8735 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-constructor-and-type-parameters > Babel - Error`]
-SyntaxError: Type parameters cannot appear on a constructor declaration. (4:13)
+BabelError
+ 2 |
+ 3 | class C {
+> 4 | constructor() { }
+ | ^ Type parameters cannot appear on a constructor declaration. (4:13)
+ 5 |
+ 6 | ['constructor']() { }
+ 7 | }
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot
index 4f49707b5721..448313d2ceb8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-export-parameter-properties/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-export-parameter-properties > Babel - Error`]
-SyntaxError: Unexpected keyword 'export'. (4:16)
+BabelError
+ 2 |
+ 3 | class Foo {
+> 4 | constructor(export a: string) {
+ | ^ Unexpected keyword 'export'. (4:16)
+ 5 |
+ 6 | }
+ 7 | }
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot
index f3b7c8370e86..6eecefc158d1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-implements-and-extends/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-implements-and-extends > Babel - Error`]
-SyntaxError: Unexpected token, expected "," (3:57)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | class ClassWithParentAndInterface implements MyInterface extends MyOtherClass {}
+ | ^ Unexpected token, expected "," (3:57)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot
index 93ba259b14c2..222ba46172fc 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-static-parameter-properties/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-static-parameter-properties > Babel - Error`]
-SyntaxError: Unexpected reserved word 'static'. (4:16)
+BabelError
+ 2 |
+ 3 | class Foo {
+> 4 | constructor(static a: string) {
+ | ^ Unexpected reserved word 'static'. (4:16)
+ 5 |
+ 6 | }
+ 7 | }
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot
index e27b8241af48..c2de560d7935 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > class-with-two-methods-computed-constructor > Babel - Error`]
-SyntaxError: Type parameters cannot appear on a constructor declaration. (4:15)
+BabelError
+ 2 |
+ 3 | class A {
+> 4 | "constructor"(): number {
+ | ^ Type parameters cannot appear on a constructor declaration. (4:15)
+ 5 | }
+ 6 |
+ 7 | ["constructor"](): number {
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot
index d36815d31301..8627909786fd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/const-assertions/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > const-assertions > Babel - Error`]
-SyntaxError: Identifier 'x' has already been declared. (13:4)
+BabelError
+ 11 |
+ 12 | // Type '10'
+> 13 | let x = 10;
+ | ^ Identifier 'x' has already been declared. (13:4)
+ 14 |
+ 15 | // Type 'readonly [10, 20]'
+ 16 | let y = [10, 20];
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot
index c64aaae4a4d8..dc8d857908c8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > TSESTree - Error`]
-NO ERROR
+TSError
+ 2 |
+ 3 | export enum Foo {
+> 4 | [1],
+ | ^^^ Computed property names are not allowed in enums.
+ 5 | }
+ 6 |
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot
index e3ebeee984c1..2810528b926b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > Babel - Error`]
-SyntaxError: Unexpected token (4:4)
+BabelError
+ 2 |
+ 3 | export enum Foo {
+> 4 | [1],
+ | ^ Unexpected token (4:4)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot
index f5e14d5d4b27..f9ae118971e1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-number > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot
index 866743a38587..90ef25fd26d8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > TSESTree - Error`]
-NO ERROR
+TSError
+ 2 |
+ 3 | export enum Foo {
+> 4 | ['baz'],
+ | ^^^^^^^ Computed property names are not allowed in enums.
+ 5 | }
+ 6 |
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot
index 30b625fd5ba4..d296e5c547da 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > Babel - Error`]
-SyntaxError: Unexpected token (4:4)
+BabelError
+ 2 |
+ 3 | export enum Foo {
+> 4 | ['baz'],
+ | ^ Unexpected token (4:4)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot
index f58190aa21f3..2dc13fd3d5d2 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-string > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot
index 85b95f8e17d3..7e31fde5e0c7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > TSESTree - Error`]
-NO ERROR
+TSError
+ 2 |
+ 3 | export enum Foo {
+> 4 | [x],
+ | ^^^ Computed property names are not allowed in enums.
+ 5 | }
+ 6 |
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot
index 2612787d1b85..f34477b53b70 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > Babel - Error`]
-SyntaxError: Unexpected token (4:4)
+BabelError
+ 2 |
+ 3 | export enum Foo {
+> 4 | [x],
+ | ^ Unexpected token (4:4)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot
index 006e3518ee1f..3909357acf22 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-named-enum-computed-var-ref > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot
index 580ccafe0581..55ec89897af8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > export-with-import-assertions > Babel - Error`]
-SyntaxError: A JSON module can only be imported with `default`. (3:9)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | export { foo } from "mod" assert { type: "json" };
+ | ^ A JSON module can only be imported with `default`. (3:9)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot
index fbb578bcabad..3745c520879d 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/import-type-error/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > import-type-error > Babel - Error`]
-SyntaxError: A type-only import can specify a default import or named bindings, but not both. (3:0)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | import type foo, { bar } from 'bar';
+ | ^ A type-only import can specify a default import or named bindings, but not both. (3:0)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot
index 98c91ef49faf..227ecfb29f8c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/interface-with-construct-signature-with-parameter-accessibility/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > interface-with-construct-signature-with-parameter-accessibility > Babel - Error`]
-SyntaxError: A parameter property is only allowed in a constructor implementation. (4:9)
+BabelError
+ 2 |
+ 3 | interface Test {
+> 4 | new (public x, private y);
+ | ^ A parameter property is only allowed in a constructor implementation. (4:9)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot
index 35034cb9ecdf..fa95c78a4f0c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > new-target-in-arrow-function-body > Babel - Error`]
-SyntaxError: `new.target` can only be used in functions or class properties. (3:16)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | const b = () => new.target;
+ | ^ `new.target` can only be used in functions or class properties. (3:16)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot
index 084bd81246e1..5b148e27fcc7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/_error_/var-with-definite-assignment/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > basics > _error_ > var-with-definite-assignment > Babel - Error`]
-SyntaxError: Missing initializer in const declaration. (3:16)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | const x!: string;
+ | ^ Missing initializer in const declaration. (3:16)
+ 4 | var y!: number;
+ 5 | let z!: object;
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot
index 794cf8cd318c..b2ba9113ed0e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/async-function-with-var-declaration/snapshots/4-Babel-Tokens.shot
@@ -109,8 +109,8 @@
end: { column: 18, line: 4 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [118, 121],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot
index 9187f52aade3..238113e5cc58 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,6 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
@@ -41,7 +40,6 @@ Program {
},
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot
index 1c5c321a9cf2..20c84325ce31 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/const-enum/snapshots/5-AST-Alignment-AST.shot
@@ -15,7 +15,6 @@ Snapshot Diff:
- members: Array [
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
@@ -81,7 +80,6 @@ Snapshot Diff:
},
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
@@ -121,12 +119,7 @@ Snapshot Diff:
- loc: {
- start: { column: 15, line: 3 },
- end: { column: 1, line: 6 },
-+ range: [103, 106],
-+ loc: {
-+ start: { column: 2, line: 5 },
-+ end: { column: 5, line: 5 },
-+ },
- },
+- },
- },
- const: true,
- declare: false,
@@ -140,7 +133,12 @@ Snapshot Diff:
- loc: {
- start: { column: 11, line: 3 },
- end: { column: 14, line: 3 },
-- },
++ range: [103, 106],
++ loc: {
++ start: { column: 2, line: 5 },
++ end: { column: 5, line: 5 },
++ },
+ },
- },
+ ],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot
index 0a35e9756f00..01c4d100b383 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/1-TSESTree-AST.shot
@@ -11,7 +11,6 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
@@ -44,7 +43,6 @@ Program {
},
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot
index bc225b94ed0d..603938fb4270 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-const-named-enum/snapshots/5-AST-Alignment-AST.shot
@@ -19,7 +19,6 @@ Snapshot Diff:
- members: Array [
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
@@ -85,7 +84,6 @@ Snapshot Diff:
},
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot
index 15279e8049d7..f946f794f043 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/1-TSESTree-AST.shot
@@ -11,7 +11,6 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
@@ -44,7 +43,6 @@ Program {
},
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot
index 695e866e0f98..eff7ba3226bd 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-declare-named-enum/snapshots/5-AST-Alignment-AST.shot
@@ -19,7 +19,6 @@ Snapshot Diff:
- members: Array [
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
@@ -85,7 +84,6 @@ Snapshot Diff:
},
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot
index b1554a6d0194..8f42d8de69bf 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/1-TSESTree-AST.shot
@@ -11,7 +11,6 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
@@ -44,7 +43,6 @@ Program {
},
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot
index b52051becdfb..10c5f8d572d1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/export-named-enum/snapshots/5-AST-Alignment-AST.shot
@@ -19,7 +19,6 @@ Snapshot Diff:
- members: Array [
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
@@ -85,7 +84,6 @@ Snapshot Diff:
},
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot
index 2b4bd47565ba..fb0b35f8e5f1 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/global-this/snapshots/4-Babel-Tokens.shot
@@ -109,8 +109,8 @@
end: { column: 21, line: 8 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [165, 168],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot
index 65e2dfe0dc77..781a841d719c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/4-Babel-Tokens.shot
@@ -2579,8 +2579,8 @@
end: { column: 18, line: 76 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [1130, 1133],
@@ -2609,8 +2609,8 @@
end: { column: 11, line: 77 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "yield",
range: [1138, 1143],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot
index 358988f5d91b..89c5aca71c1a 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/keyword-variables/snapshots/6-AST-Alignment-Tokens.shot
@@ -2596,10 +2596,8 @@ Snapshot Diff:
end: { column: 18, line: 76 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Keyword {
+ type: 'Keyword',
value: 'let',
range: [1130, 1133],
@@ -2628,10 +2626,8 @@ Snapshot Diff:
end: { column: 11, line: 77 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Keyword {
+ type: 'Keyword',
value: 'yield',
range: [1138, 1143],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot
index 0ebcd27bf8f3..d5d1ec3f7e5c 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/non-null-assertion-operator/snapshots/4-Babel-Tokens.shot
@@ -139,8 +139,8 @@
end: { column: 20, line: 4 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [133, 136],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot
index c0d2cc8c0600..d7da87a7a9d7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/2-TSESTree-Tokens.shot
@@ -29,8 +29,8 @@
end: { column: 6, line: 3 },
},
},
- Keyword {
- type: "Keyword",
+ Null {
+ type: "Null",
value: "null",
range: [80, 84],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot
index cfe34f596563..d7da87a7a9d7 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
@@ -49,8 +49,8 @@
end: { column: 12, line: 3 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [86, 89],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot
index bfef506c822e..2fc7fb8f35c0 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/snapshots/6-AST-Alignment-Tokens.shot
@@ -38,10 +38,8 @@ Snapshot Diff:
end: { column: 6, line: 3 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Null {
-+ type: 'Null',
+ Null {
+ type: 'Null',
value: 'null',
range: [80, 84],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot
index 7efe3d3c1a01..bc7b5325ce7b 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/nullish-coalescing/snapshots/4-Babel-Tokens.shot
@@ -89,8 +89,8 @@
end: { column: 45, line: 3 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [121, 124],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot
index c79f24defb00..2449e4574bc0 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/object-with-escaped-properties/snapshots/2-TSESTree-Tokens.shot
@@ -39,8 +39,8 @@
end: { column: 6, line: 3 },
},
},
- Keyword {
- type: "Keyword",
+ Null {
+ type: "Null",
value: "null",
range: [80, 84],
@@ -239,8 +239,8 @@
end: { column: 10, line: 7 },
},
},
- Keyword {
- type: "Keyword",
+ Null {
+ type: "Null",
value: "null",
range: [117, 121],
@@ -329,8 +329,8 @@
end: { column: 8, line: 10 },
},
},
- Keyword {
- type: "Keyword",
+ Null {
+ type: "Null",
value: "null",
range: [146, 150],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot
index f3c7150f41d1..fed3e2747887 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-keyword-null/snapshots/2-TSESTree-Tokens.shot
@@ -29,8 +29,8 @@
end: { column: 10, line: 3 },
},
},
- Keyword {
- type: "Keyword",
+ Null {
+ type: "Null",
value: "null",
range: [84, 88],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot
index 573d00dfabbf..c7bbf886221e 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/2-TSESTree-Tokens.shot
@@ -79,8 +79,8 @@
end: { column: 29, line: 4 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "this",
range: [124, 128],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot
index cf45b4578a48..e60f93635f64 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/typed-this/snapshots/6-AST-Alignment-Tokens.shot
@@ -88,10 +88,8 @@ Snapshot Diff:
end: { column: 29, line: 4 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'this',
range: [124, 128],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot
index d17773cf1d68..c5d1e3db16f5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot
@@ -49,8 +49,8 @@
end: { column: 19, line: 3 },
},
},
- Keyword {
- type: "Keyword",
+ Null {
+ type: "Null",
value: "null",
range: [93, 97],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot
index e8b74eb74e4b..c5d1e3db16f5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
@@ -89,8 +89,8 @@
end: { column: 37, line: 3 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [111, 114],
@@ -159,8 +159,8 @@
end: { column: 34, line: 4 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [146, 149],
@@ -269,8 +269,8 @@
end: { column: 45, line: 5 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [192, 195],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot
index d746756b46c1..1270fb2681e8 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot
@@ -58,10 +58,8 @@ Snapshot Diff:
end: { column: 19, line: 3 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Null {
-+ type: 'Null',
+ Null {
+ type: 'Null',
value: 'null',
range: [93, 97],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot
index 81c2b521b7d5..693b4c9de7a5 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/unknown-type-annotation/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot
index 35f693b45343..efe446c91415 100644
--- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot
index 513eb9bcd84c..e483a20f2a29 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/1-TSESTree-AST.shot
@@ -8,7 +8,6 @@ Program {
members: [
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
@@ -30,7 +29,6 @@ Program {
},
TSEnumMember {
type: "TSEnumMember",
- computed: false,
id: Identifier {
type: "Identifier",
decorators: [],
diff --git a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot
index 3c1cbd1bc2a0..544b72e407c8 100644
--- a/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/legacy-fixtures/declare/fixtures/enum/snapshots/5-AST-Alignment-AST.shot
@@ -15,7 +15,6 @@ Snapshot Diff:
- members: Array [
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
@@ -59,7 +58,6 @@ Snapshot Diff:
},
- TSEnumMember {
- type: 'TSEnumMember',
-- computed: false,
- id: Identifier {
- type: 'Identifier',
- decorators: Array [],
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot
index a7759221c36d..c2a01fb21025 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends-implements/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-empty-extends-implements > Babel - Error`]
-SyntaxError: Unexpected reserved word 'implements'. (3:18)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | class Foo extends implements Bar {
+ | ^ Unexpected reserved word 'implements'. (3:18)
+ 4 |
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot
index 4ec40f4b3b0e..d66d7ee5ec1a 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-empty-extends/snapshots/2-Babel-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-empty-extends > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (6:0)
+BabelError
+ 4 |
+ 5 | }
+> 6 |
+ | ^ Unexpected token, expected "{" (6:0)
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot
index 8e3eea6c1131..d9a512c232d2 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-extends-empty-implements/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-extends-empty-implements > Babel - Error`]
-SyntaxError: 'implements' list cannot be empty. (3:33)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | class Foo extends Bar implements {
+ | ^ 'implements' list cannot be empty. (3:33)
+ 4 |
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot
index 9bc9aef71f23..b3835b41371c 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/class-multiple-implements/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > class-multiple-implements > Babel - Error`]
-SyntaxError: Unexpected token, expected "," (3:21)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | class a implements b implements c {}
+ | ^ Unexpected token, expected "," (3:21)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot
index 78f8c4703d14..49920535e977 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-enum-declaration/snapshots/2-Babel-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-enum-declaration > Babel - Error`]
-SyntaxError: Leading decorators must be attached to a class declaration. (3:5)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | @dec enum E {}
+ | ^ Leading decorators must be attached to a class declaration. (3:5)
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot
index 0e2ce63ec8c7..c21fbbfa8050 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-function/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-function > Babel - Error`]
-SyntaxError: Leading decorators must be attached to a class declaration. (4:0)
+BabelError
+ 2 |
+ 3 | @dec
+> 4 | function b(){}
+ | ^ Leading decorators must be attached to a class declaration. (4:0)
+ 5 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot
index 6c236792b4cf..cd433bb6eff6 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-interface-declaration/snapshots/2-Babel-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-interface-declaration > Babel - Error`]
-SyntaxError: Leading decorators must be attached to a class declaration. (4:0)
+BabelError
+ 2 |
+ 3 | @deco()
+> 4 | interface M {}
+ | ^ Leading decorators must be attached to a class declaration. (4:0)
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot
index de18083b45ff..2de8a9c2e651 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/decorator-on-variable/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > decorator-on-variable > Babel - Error`]
-SyntaxError: Leading decorators must be attached to a class declaration. (4:0)
+BabelError
+ 2 |
+ 3 | @deco()
+> 4 | const a = 1
+ | ^ Leading decorators must be attached to a class declaration. (4:0)
+ 5 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/fixture.ts
similarity index 76%
rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts
rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/fixture.ts
index add9711e2f79..1b6ae87f6359 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/fixture.ts
@@ -1,3 +1,3 @@
// TODO: This fixture might be too large, and if so should be split up.
-function f1<>() {}
+foo< /* empty */ >();
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-Babel-Error.shot
similarity index 51%
rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot
rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-Babel-Error.shot
index ae64111c78c0..4992c1bda8ba 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-Babel-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:11)]`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression Babel - Error 1`] = `[SyntaxError: Unexpected token (3:4)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..33b566c2ad26
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,9 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression-with-comment > TSESTree - Error`]
+TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | foo< /* empty */ >();
+ | ^^^^^^^^^^^^^^^ Type argument list cannot be empty.
+ 4 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Alignment-Error.shot
similarity index 52%
rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot
rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Alignment-Error.shot
index 14e18802b751..c7ddaf4d3507 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Alignment-Error.shot
@@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
-exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..8ea146fad19d
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Babel-Error.shot
@@ -0,0 +1,10 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression-with-comment > Babel - Error`]
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | foo< /* empty */ >();
+ | ^ Unexpected token (3:17)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/3-Alignment-Error.shot
similarity index 58%
rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot
rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/3-Alignment-Error.shot
index c1b25cba23a7..6e7b21bf1776 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > TSESTree - Error`]
-NO ERROR
+exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression-with-comment > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot
index fa76bcceec4c..2bc9a5f6b7c7 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression > TSESTree - Error`]
-NO ERROR
+TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | foo<>();
+ | ^^ Type argument list cannot be empty.
+ 4 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot
index f59176307e6a..91534ecc195a 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression > Babel - Error`]
-SyntaxError: Unexpected token (3:4)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | foo<>();
+ | ^ Unexpected token (3:4)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot
index 6cd8bffbdf9b..e42614b0c09e 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-call-expression > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot
index 04397c1ad1f6..398387294483 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-new-expression > TSESTree - Error`]
-NO ERROR
+TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | new Foo<>()
+ | ^^ Type argument list cannot be empty.
+ 4 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot
index 93efdda3f71f..14594e627a49 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-new-expression > Babel - Error`]
-SyntaxError: Unexpected token (3:8)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | new Foo<>()
+ | ^ Unexpected token (3:8)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot
index d2b55f055473..704d3be4ffe4 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments-in-new-expression > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot
index e49d52208b33..ca475faf4bcb 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments > TSESTree - Error`]
-NO ERROR
+TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | const foo: Foo<>
+ | ^^ Type argument list cannot be empty.
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot
index ada9518aae7f..50d06d9aa9bd 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/2-Babel-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments > Babel - Error`]
-SyntaxError: Type argument list cannot be empty. (3:14)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | const foo: Foo<>
+ | ^ Type argument list cannot be empty. (3:14)
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot
index 85b0b7246e10..7e8871022446 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-arguments > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts
index add9711e2f79..0367dc4b8cad 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts
@@ -1,3 +1 @@
-// TODO: This fixture might be too large, and if so should be split up.
-
-function f1<>() {}
+const arrowFunction = < /* empty */ >() => {};
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot
index f77a6fda39cf..5c7d9964c1b8 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > TSESTree - Error`]
-NO ERROR
+TSError
+> 1 | const arrowFunction = < /* empty */ >() => {};
+ | ^ Type expected.
+ 2 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot
index bea6f602ef56..536bb927ec57 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (3:11)
+BabelError
+> 1 | const arrowFunction = < /* empty */ >() => {};
+ | ^ Type parameter list cannot be empty. (1:22)
+ 2 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot
index ff94d062b9d7..84a2d786eff3 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-arrow-function > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot
index 2546fb018409..b9c00c6592d0 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-constructor > TSESTree - Error`]
-NO ERROR
+TSError
+ 2 |
+ 3 | class foo {
+> 4 | constructor<>() {}
+ | ^^ Type parameter list cannot be empty.
+ 5 | }
+ 6 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot
index 690ef1aa63bb..16a2f804505e 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-constructor > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (4:13)
+BabelError
+ 2 |
+ 3 | class foo {
+> 4 | constructor<>() {}
+ | ^ Type parameter list cannot be empty. (4:13)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot
index 958c1dec19b5..99acc7c21d77 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-constructor > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/fixture.ts
new file mode 100644
index 000000000000..1dbabedb798c
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/fixture.ts
@@ -0,0 +1 @@
+function f1<>() {}
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-Babel-Error.shot
new file mode 100644
index 000000000000..12440d8874fa
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-Babel-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function Babel - Error 1`] = `[SyntaxError: Type parameter list cannot be empty. (3:11)]`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-TSESTree-Error.shot
new file mode 100644
index 000000000000..57bcc54e2635
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/1-TSESTree-Error.shot
@@ -0,0 +1,7 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-declaration > TSESTree - Error`]
+TSError
+> 1 | function f1<>() {}
+ | ^^ Type parameter list cannot be empty.
+ 2 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Alignment-Error.shot
new file mode 100644
index 000000000000..04350071ad74
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Alignment-Error.shot
@@ -0,0 +1,3 @@
+// Jest Snapshot v1, https://goo.gl/fbAQLP
+
+exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-parameters-in-arrow-function Error Alignment 1`] = `"Babel errored but TSESTree didn't"`;
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Babel-Error.shot
new file mode 100644
index 000000000000..e9932497ceaa
--- /dev/null
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/2-Babel-Error.shot
@@ -0,0 +1,8 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-declaration > Babel - Error`]
+BabelError
+> 1 | function f1<>() {}
+ | ^ Type parameter list cannot be empty. (1:11)
+ 2 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/3-Alignment-Error.shot
similarity index 60%
rename from packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot
rename to packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/3-Alignment-Error.shot
index 4fd1ec55af88..8c7aff64046a 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-declaration/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > Error Alignment`]
-Babel errored but TSESTree didn't
+exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-declaration > Error Alignment`]
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts
index 43d8a0629438..97b3b1bd5b97 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts
@@ -1,3 +1 @@
-// TODO: This fixture might be too large, and if so should be split up.
-
const foo = function<>() {}
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot
index 40cee72976cb..baeead551b4b 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > TSESTree - Error`]
-NO ERROR
+TSError
+> 1 | const foo = function<>() {}
+ | ^^ Type parameter list cannot be empty.
+ 2 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot
index 8865ff0be4c9..3dff8a44c1db 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (3:20)
+BabelError
+> 1 | const foo = function<>() {}
+ | ^ Type parameter list cannot be empty. (1:20)
+ 2 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot
index defbf77fcf62..1b64cd4e9668 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-function-expression > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot
index 3f66104ff937..bcc1d1c1ea7d 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method-signature > TSESTree - Error`]
-NO ERROR
+TSError
+ 2 |
+ 3 | interface foo {
+> 4 | test<>();
+ | ^^ Type parameter list cannot be empty.
+ 5 | }
+ 6 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot
index 78845bb622fc..e64d189f57d3 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method-signature > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (4:6)
+BabelError
+ 2 |
+ 3 | interface foo {
+> 4 | test<>();
+ | ^ Type parameter list cannot be empty. (4:6)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot
index 78a1922357aa..42b81315e508 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method-signature > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot
index 6cdb099d73e4..ceec3f99b420 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method > TSESTree - Error`]
-NO ERROR
+TSError
+ 2 |
+ 3 | class foo {
+> 4 | test<>() {}
+ | ^^ Type parameter list cannot be empty.
+ 5 | }
+ 6 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot
index 8edfff6a61ee..3094f70c4dea 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (4:6)
+BabelError
+ 2 |
+ 3 | class foo {
+> 4 | test<>() {}
+ | ^ Type parameter list cannot be empty. (4:6)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot
index 5c8dfc4b3d35..d6d8837d6520 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters-in-method > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot
deleted file mode 100644
index 18c13853083c..000000000000
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/2-Babel-Error.shot
+++ /dev/null
@@ -1,4 +0,0 @@
-// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-
-exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > empty-type-parameters > Babel - Error`]
-SyntaxError: Type parameter list cannot be empty. (3:11)
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot
index 4a5bede8b8ba..8fc83f6a5be4 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/enum-with-keywords/snapshots/2-Babel-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > enum-with-keywords > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (3:7)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | export private public protected static readonly abstract async enum X {}
+ | ^ Unexpected token, expected "{" (3:7)
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot
index 2cc0c09a7eaf..554c009cecd0 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > index-signature-parameters > Babel - Error`]
-SyntaxError: Unexpected token, expected "]" (4:12)
+BabelError
+ 2 |
+ 3 | type foo = {
+> 4 | [a: string, b: string]: string;
+ | ^ Unexpected token, expected "]" (4:12)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot
index c8fd8337e295..0c7e138c8054 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-empty-extends > Babel - Error`]
-SyntaxError: 'extends' list cannot be empty. (3:22)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | interface Foo extends {
+ | ^ 'extends' list cannot be empty. (3:22)
+ 4 |
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot
index 363365dcf16d..c422799a230e 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-implements/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-implements > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (3:12)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | interface d implements e {}
+ | ^ Unexpected token, expected "{" (3:12)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot
index 68489300cc2e..08b5aa8c4257 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-export/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-export > Babel - Error`]
-SyntaxError: Unexpected token, expected ";" (4:9)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | export [baz: string]: string;
+ | ^ Unexpected token, expected ";" (4:9)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot
index 1647b535967c..86a7acc9b701 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-private/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-private > Babel - Error`]
-SyntaxError: 'private' modifier cannot appear on a type member. (4:2)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | private [baz: string]: string;
+ | ^ 'private' modifier cannot appear on a type member. (4:2)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot
index 2950f6174dcf..aa422f5e065f 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-protected/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-protected > Babel - Error`]
-SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | protected [baz: string]: string;
+ | ^ 'protected' modifier cannot appear on a type member. (4:2)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot
index 1d027ab3288d..7a6f073d84c1 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-public/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-public > Babel - Error`]
-SyntaxError: 'public' modifier cannot appear on a type member. (4:2)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | public [baz: string]: string;
+ | ^ 'public' modifier cannot appear on a type member. (4:2)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot
index d29363a7d59a..12fd7616e919 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-index-signature-static/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-index-signature-static > Babel - Error`]
-SyntaxError: 'static' modifier cannot appear on a type member. (4:2)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | static [baz: string]: string;
+ | ^ 'static' modifier cannot appear on a type member. (4:2)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot
index a0bf025bfd18..fa5282c6d766 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-export/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-export > Babel - Error`]
-SyntaxError: Unexpected token, expected ";" (4:11)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | export g(bar: string): void;
+ | ^ Unexpected token, expected ";" (4:11)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot
index 4f4403185561..d5dbbcdfca6d 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-private/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-private > Babel - Error`]
-SyntaxError: 'private' modifier cannot appear on a type member. (4:4)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | private g(bar: string): void;
+ | ^ 'private' modifier cannot appear on a type member. (4:4)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot
index 7c6aea8cbc42..567f70c03ab5 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-protected/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-protected > Babel - Error`]
-SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | protected g(bar: string): void;
+ | ^ 'protected' modifier cannot appear on a type member. (4:2)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot
index 67adc051ce12..9d0c9ab867f4 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-public/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-public > Babel - Error`]
-SyntaxError: 'public' modifier cannot appear on a type member. (4:4)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | public g(bar: string): void;
+ | ^ 'public' modifier cannot appear on a type member. (4:4)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot
index e1d86c915bec..c6663365d284 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-readonly/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-readonly > Babel - Error`]
-SyntaxError: 'readonly' modifier can only appear on a property declaration or index signature. (4:2)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | readonly g(bar: string): void;
+ | ^ 'readonly' modifier can only appear on a property declaration or index signature. (4:2)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot
index 9c86c96dcf2c..f3ef64ea4040 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-method-static/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-method-static > Babel - Error`]
-SyntaxError: 'static' modifier cannot appear on a type member. (4:2)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | static g(bar: string): void;
+ | ^ 'static' modifier cannot appear on a type member. (4:2)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot
index b9716b289515..f57a1b692cd1 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/1-TSESTree-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-multiple-extends > TSESTree - Error`]
-NO ERROR
+TSError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | interface foo extends bar extends baz {}
+ | ^^^^^^^^^^^ 'extends' clause already seen.
+ 4 |
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot
index 5ce932646399..d2a84ab002b5 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-multiple-extends > Babel - Error`]
-SyntaxError: Unexpected token, expected "," (3:26)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | interface foo extends bar extends baz {}
+ | ^ Unexpected token, expected "," (3:26)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot
index 8c05c9ec9327..2b5ef310d7cd 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/snapshots/3-Alignment-Error.shot
@@ -1,4 +1,4 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-multiple-extends > Error Alignment`]
-Babel errored but TSESTree didn't
+Both errored
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot
index 91b39c29c98a..6518ef2afcf9 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-export/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-export > Babel - Error`]
-SyntaxError: Unexpected token, expected ";" (4:9)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | export a: string;
+ | ^ Unexpected token, expected ";" (4:9)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot
index 2f122b91e44a..504c0e300be5 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-private/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-private > Babel - Error`]
-SyntaxError: 'private' modifier cannot appear on a type member. (4:2)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | private b: string;
+ | ^ 'private' modifier cannot appear on a type member. (4:2)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot
index 3f79550c6121..09ee6837fbc8 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-protected/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-protected > Babel - Error`]
-SyntaxError: 'protected' modifier cannot appear on a type member. (4:2)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | protected a: string;
+ | ^ 'protected' modifier cannot appear on a type member. (4:2)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot
index 57ead1416304..29882083cc96 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-public/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-public > Babel - Error`]
-SyntaxError: 'public' modifier cannot appear on a type member. (4:4)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | public a: string;
+ | ^ 'public' modifier cannot appear on a type member. (4:4)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot
index b2a5dab697a4..cf0246ca09ed 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-static/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-static > Babel - Error`]
-SyntaxError: 'static' modifier cannot appear on a type member. (4:2)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | static a: string;
+ | ^ 'static' modifier cannot appear on a type member. (4:2)
+ 5 | }
+ 6 |
+ 7 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot
index 5fa027e9cf4e..c05e5ad7cfa0 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-property-with-default-value/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-property-with-default-value > Babel - Error`]
-SyntaxError: Unexpected token, expected ";" (4:14)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | bar: string = 'a';
+ | ^ Unexpected token, expected ";" (4:14)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot
index ae893daf528c..ecc6c39a7e58 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-no-body/snapshots/2-Babel-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-with-no-body > Babel - Error`]
-SyntaxError: Unexpected token, expected "{" (4:0)
+BabelError
+ 2 |
+ 3 | interface Foo
+> 4 |
+ | ^ Unexpected token, expected "{" (4:0)
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot
index 38311897df43..532294b0ddfa 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > interface-with-optional-index-signature > Babel - Error`]
-SyntaxError: Unexpected token (4:7)
+BabelError
+ 2 |
+ 3 | interface Foo {
+> 4 | [fff?: number]: string;
+ | ^ Unexpected token (4:7)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot
index e15c3c0564bd..00507051d9c1 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-assertion-not-allowed/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > object-assertion-not-allowed > Babel - Error`]
-SyntaxError: Unexpected token, expected "," (3:3)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | ({a!} = {})
+ | ^ Unexpected token, expected "," (3:3)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot
index 4008e062d595..e1f5b59abe76 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/object-optional-not-allowed/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > object-optional-not-allowed > Babel - Error`]
-SyntaxError: Unexpected token, expected "," (3:3)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | ({a?} = {})
+ | ^ Unexpected token, expected "," (3:3)
+ 4 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot
index 84f2232f20d1..f02a6ac4f0b2 100644
--- a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/solo-const/snapshots/2-Babel-Error.shot
@@ -1,4 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > errorRecovery > _error_ > solo-const > Babel - Error`]
-SyntaxError: Unexpected token (3:5)
+BabelError
+ 1 | // TODO: This fixture might be too large, and if so should be split up.
+ 2 |
+> 3 | const
+ | ^ Unexpected token (3:5)
+
diff --git a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot
index 77fa78f82897..a1b2396cef0c 100644
--- a/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/expressions/fixtures/_error_/instantiation-expression/snapshots/2-Babel-Error.shot
@@ -1,4 +1,12 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > expressions > _error_ > instantiation-expression > Babel - Error`]
-SyntaxError: Unexpected token (5:7)
+BabelError
+ 3 | a;
+ 4 |
+> 5 | a;
+ | ^ Unexpected token (5:7)
+ 6 | a();
+ 7 | a?.();
+ 8 | a?.b();
+
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot
index b4627fafc300..99340a2f665a 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > parameter-decorators > _error_ > parameter-array-pattern-decorator > Babel - Error`]
-SyntaxError: Unexpected token (4:28)
+BabelError
+ 2 |
+ 3 | class Foo {
+> 4 | bar(@special(true) [ bar ]: any) {}
+ | ^ Unexpected token (4:28)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot
index 6d7c60703ac4..646af8ded572 100644
--- a/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > legacy-fixtures > parameter-decorators > _error_ > parameter-rest-element-decorator > Babel - Error`]
-SyntaxError: Unexpected token (4:21)
+BabelError
+ 2 |
+ 3 | class Foo {
+> 4 | bar(@special(true) ...foo: any) {}
+ | ^ Unexpected token (4:21)
+ 5 | }
+ 6 |
+
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot
index 19f272b4f0a1..8e7e2549262f 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/2-TSESTree-Tokens.shot
@@ -89,8 +89,8 @@
end: { column: 40, line: 3 },
},
},
- Keyword {
- type: "Keyword",
+ Null {
+ type: "Null",
value: "null",
range: [114, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot
index 9c14b6f29d0d..8e7e2549262f 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot
index 56c8590cf6bb..56f0dedb193b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional-with-null/snapshots/6-AST-Alignment-Tokens.shot
@@ -98,10 +98,8 @@ Snapshot Diff:
end: { column: 40, line: 3 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Null {
-+ type: 'Null',
+ Null {
+ type: 'Null',
value: 'null',
range: [114, 118],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot
index 220fe9555e9b..f95f0ec5e899 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/conditional/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot
index c96f24501f5e..1526af3e6f08 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-generic/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot
index d8b85c337844..308ede1f966f 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-in-generic/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot
index 1177bc6d5393..749b397d0672 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor-with-rest/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot
index e74a4370243b..e2cb259df540 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/constructor/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot
index 9e9481a35684..8333ead4d538 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-generic/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot
index fc203602a9ed..7f92e37fb63e 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-in-generic/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot
index a5b6a00a1418..d82ffedb7ebe 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-rest/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot
index 4ed3f2a15270..7384c5b71f9c 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/2-TSESTree-Tokens.shot
@@ -39,8 +39,8 @@
end: { column: 8, line: 3 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "this",
range: [81, 85],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot
index 111a3921015f..7384c5b71f9c 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot
index 4dd08bd918b5..f2753dc6195f 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function-with-this/snapshots/6-AST-Alignment-Tokens.shot
@@ -48,10 +48,8 @@ Snapshot Diff:
end: { column: 8, line: 3 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'this',
range: [81, 85],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot
index ba1f21afcd61..cb4f94fecb64 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/function/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot
index 5b981eedef46..b988bba0f56f 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/indexed/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot
index 508a7be90987..52f735fd8160 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number-negative/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot
index b3fa4f40d2cf..9289da650dcb 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-number/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot
index b56d0a990e99..0aee0dcb8696 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/literal-string/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot
index bd73b0295988..b0602909de5d 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-minus/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot
index 68b91afce98a..142b15bfa8cb 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly-plus/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot
index c3ffd41f1daa..b28d19369e69 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-readonly/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot
index 79a0ab7f3906..294fd82c0101 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped-untypped/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot
index 340b5d51db47..4487279ef14f 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/mapped/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot
index a22433f5c8ca..f33dd4aed51b 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/nested-types/snapshots/2-TSESTree-Tokens.shot
@@ -249,8 +249,8 @@
end: { column: 23, line: 5 },
},
},
- Keyword {
- type: "Keyword",
+ Null {
+ type: "Null",
value: "null",
range: [139, 143],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot
index a3de1c4a3b65..29e683c4011f 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic-nested/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot
index 4beddd730692..c2b1215eabc2 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference-generic/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot
index 474ccbd9551e..c83935cd8d50 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/reference/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot
index 1deb60e039ac..f41521a4d6ef 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/2-TSESTree-Tokens.shot
@@ -109,8 +109,8 @@
end: { column: 16, line: 6 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "this",
range: [120, 124],
@@ -269,8 +269,8 @@
end: { column: 17, line: 10 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "this",
range: [183, 187],
@@ -429,8 +429,8 @@
end: { column: 17, line: 14 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "this",
range: [241, 245],
@@ -689,8 +689,8 @@
end: { column: 17, line: 19 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "this",
range: [329, 333],
@@ -949,8 +949,8 @@
end: { column: 22, line: 24 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "this",
range: [419, 423],
@@ -1089,8 +1089,8 @@
end: { column: 8, line: 28 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "typeof",
range: [471, 477],
@@ -1109,8 +1109,8 @@
end: { column: 16, line: 28 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "this",
range: [478, 482],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot
index a00c84b46b57..3abc427e91f4 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/this-type-expanded/snapshots/6-AST-Alignment-Tokens.shot
@@ -120,10 +120,8 @@ Snapshot Diff:
end: { column: 16, line: 6 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'this',
range: [120, 124],
@@ -284,10 +282,8 @@ Snapshot Diff:
end: { column: 17, line: 10 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'this',
range: [183, 187],
@@ -448,10 +444,8 @@ Snapshot Diff:
end: { column: 17, line: 14 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'this',
range: [241, 245],
@@ -712,10 +706,8 @@ Snapshot Diff:
end: { column: 17, line: 19 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'this',
range: [329, 333],
@@ -974,10 +966,8 @@ Snapshot Diff:
end: { column: 22, line: 24 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'this',
range: [419, 423],
@@ -1116,10 +1106,8 @@ Snapshot Diff:
end: { column: 8, line: 28 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'typeof',
range: [471, 477],
@@ -1138,10 +1126,8 @@ Snapshot Diff:
end: { column: 16, line: 28 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'this',
range: [478, 482],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot
index 41031c9068b0..5fb2042b7470 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-empty/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot
index 7b3c79ba1164..0e6c24dc58d9 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-optional/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot
index 1936dc9a2c28..c2b21dcd7402 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named-rest/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot
index b696dfd5b340..55c76af54c68 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-named/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot
index f27109984826..3dfe6687ff52 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-optional/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot
index 788399b58467..9ed540fb2ebe 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple-rest/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot
index 0728f53a8a9a..c00e485c9228 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/tuple/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot
index e3baed46299d..5ea169be4a42 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-literal/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot
index 3a5d505e2e8a..82cfb8838ccd 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/type-operator/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
@@ -59,8 +59,8 @@
end: { column: 15, line: 3 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [89, 92],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot
index accecbdf3e6c..9257d8476df2 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/2-TSESTree-Tokens.shot
@@ -39,8 +39,8 @@
end: { column: 16, line: 3 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "this",
range: [90, 94],
@@ -99,8 +99,8 @@
end: { column: 15, line: 4 },
},
},
- Keyword {
- type: "Keyword",
+ Identifier {
+ type: "Identifier",
value: "this",
range: [112, 116],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot
index db8464f05758..9257d8476df2 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
@@ -59,8 +59,8 @@
end: { column: 22, line: 3 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [96, 99],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot
index c76669826b20..fdcc7a211dbb 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-this/snapshots/6-AST-Alignment-Tokens.shot
@@ -48,10 +48,8 @@ Snapshot Diff:
end: { column: 16, line: 3 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'this',
range: [90, 94],
@@ -112,10 +110,8 @@ Snapshot Diff:
end: { column: 15, line: 4 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Identifier {
-+ type: 'Identifier',
+ Identifier {
+ type: 'Identifier',
value: 'this',
range: [112, 116],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot
index 6afaf9bc864a..5a00a924380e 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof-with-type-parameters/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot
index baf361175501..1dd2f34f58fe 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/typeof/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot
index c5159511416e..547dd756f9d3 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/2-TSESTree-Tokens.shot
@@ -49,8 +49,8 @@
end: { column: 19, line: 3 },
},
},
- Keyword {
- type: "Keyword",
+ Null {
+ type: "Null",
value: "null",
range: [93, 97],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot
index a5c2e0f37f4e..547dd756f9d3 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/4-Babel-Tokens.shot
@@ -1,6 +1,6 @@
[
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [73, 76],
@@ -89,8 +89,8 @@
end: { column: 37, line: 3 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [111, 114],
@@ -159,8 +159,8 @@
end: { column: 34, line: 4 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [146, 149],
@@ -269,8 +269,8 @@
end: { column: 45, line: 5 },
},
},
- Identifier {
- type: "Identifier",
+ Keyword {
+ type: "Keyword",
value: "let",
range: [192, 195],
diff --git a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot
index f8ff003d5c8e..0f245d08a17f 100644
--- a/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/legacy-fixtures/types/fixtures/union-intersection/snapshots/6-AST-Alignment-Tokens.shot
@@ -58,10 +58,8 @@ Snapshot Diff:
end: { column: 19, line: 3 },
},
},
-- Keyword {
-- type: 'Keyword',
-+ Null {
-+ type: 'Null',
+ Null {
+ type: 'Null',
value: 'null',
range: [93, 97],
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot
index 746f2d00e0bb..330f905389c4 100644
--- a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-function-parameter/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > parameter > TSParameterProperty > _error_ > override-function-parameter > Babel - Error`]
-SyntaxError: A parameter property is only allowed in a constructor implementation. (1:13)
+BabelError
+> 1 | function foo(override parameter) {}
+ | ^ A parameter property is only allowed in a constructor implementation. (1:13)
+ 2 |
+
diff --git a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot
index c01c6423d57f..56ac32bf65b0 100644
--- a/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/parameter/TSParameterProperty/fixtures/_error_/override-method-parameter/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > parameter > TSParameterProperty > _error_ > override-method-parameter > Babel - Error`]
-SyntaxError: A parameter property is only allowed in a constructor implementation. (2:9)
+BabelError
+ 1 | class Foo {
+> 2 | method(override parameter) {}
+ | ^ A parameter property is only allowed in a constructor implementation. (2:9)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot
index 45304cec97a8..49ba046f48b7 100644
--- a/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/special/CatchClause/fixtures/_error_/with-initializer/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > special > CatchClause > _error_ > with-initializer > Babel - Error`]
-SyntaxError: Unexpected token, expected ")" (3:9)
+BabelError
+ 1 | try {
+ 2 | }
+> 3 | catch (e = 1) {
+ | ^ Unexpected token, expected ")" (3:9)
+ 4 | }
+ 5 |
+
diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot
index 14ba1326d51f..8066f19648c0 100644
--- a/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot
@@ -1,5 +1,9 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > special > ExportSpecifier > _error_ > literal-specifier > Babel - Error`]
-SyntaxError: A string literal cannot be used as an exported binding without `from`.
+BabelError
+> 1 | export { 'A' as A };
+ | ^ A string literal cannot be used as an exported binding without `from`.
- Did you mean `export { 'A' as 'A' } from 'some-module'`? (1:9)
+ 2 |
+
diff --git a/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot
index de1d87cc292d..155a5df05e1c 100644
--- a/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/statement/ForInStatement/fixtures/_error_/using-initializer/snapshots/2-Babel-Error.shot
@@ -1,4 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > statement > ForInStatement > _error_ > using-initializer > Babel - Error`]
-SyntaxError: For-in loop may not start with 'using' declaration. (1:4)
+BabelError
+> 1 | for(using foo in {});
+ | ^ For-in loop may not start with 'using' declaration. (1:4)
+
diff --git a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot
index 7cee4dc26990..f9f88b371b57 100644
--- a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-init/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > statement > ForOfStatement > _error_ > decl-init > Babel - Error`]
-SyntaxError: 'for-of' loop variable declaration may not have an initializer. (1:5)
+BabelError
+> 1 | for (const x = 1 of []) {}
+ | ^ 'for-of' loop variable declaration may not have an initializer. (1:5)
+ 2 |
+
diff --git a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot
index 415f6f6fc038..fff804c7ba6b 100644
--- a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/decl-multi/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > statement > ForOfStatement > _error_ > decl-multi > Babel - Error`]
-SyntaxError: Missing initializer in const declaration. (1:12)
+BabelError
+> 1 | for (const x, y of []) {}
+ | ^ Missing initializer in const declaration. (1:12)
+ 2 |
+
diff --git a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot
index fab92480a170..3cd37f4376f4 100644
--- a/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/statement/ForOfStatement/fixtures/_error_/expr-not-assignment-target/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > statement > ForOfStatement > _error_ > expr-not-assignment-target > Babel - Error`]
-SyntaxError: Invalid left-hand side in for-of statement. (1:5)
+BabelError
+> 1 | for (1 of []) {}
+ | ^ Invalid left-hand side in for-of statement. (1:5)
+ 2 |
+
diff --git a/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot
index 2c9a2de70deb..b96cae72438d 100644
--- a/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/statement/SwitchStatement/fixtures/_error_/multiple-default-cases/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > statement > SwitchStatement > _error_ > multiple-default-cases > Babel - Error`]
-SyntaxError: Multiple default clauses. (2:10)
+BabelError
+ 1 | switch (true) {
+> 2 | default: default:
+ | ^ Multiple default clauses. (2:10)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot
index 7ae654c72d7a..164119608484 100644
--- a/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/statement/ThrowStatement/fixtures/_error_/missing-argument/snapshots/2-Babel-Error.shot
@@ -1,4 +1,10 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > statement > ThrowStatement > _error_ > missing-argument > Babel - Error`]
-SyntaxError: Illegal newline after throw. (2:9)
+BabelError
+ 1 | {
+> 2 | throw
+ | ^ Illegal newline after throw. (2:9)
+ 3 | }
+ 4 |
+
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot
index ff33d238cf32..dd4ad391b99f 100644
--- a/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/_error_/type-import-type-with-import-attributes-assert/snapshots/2-Babel-Error.shot
@@ -1,4 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > type > TSImportType > _error_ > type-import-type-with-import-attributes-assert > Babel - Error`]
-SyntaxError: Unexpected token, expected "with" (1:23)
+BabelError
+> 1 | type A = import("A", { assert: { type: "json" } });
+ | ^ Unexpected token, expected "with" (1:23)
+ 2 |
+
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts
index 79df9dadf881..25af9fe33ec6 100644
--- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts
@@ -1 +1 @@
-type A = import("A", { with: { type: "json" } });
+type A = import('A', { with: { type: 'json' } });
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/1-TSESTree-AST.shot
index 225e77e8303a..e20487325971 100644
--- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/1-TSESTree-AST.shot
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/1-TSESTree-AST.shot
@@ -22,7 +22,7 @@ Program {
type: "TSLiteralType",
literal: Literal {
type: "Literal",
- raw: ""A"",
+ raw: "'A'",
value: "A",
range: [16, 19],
@@ -84,7 +84,7 @@ Program {
shorthand: false,
value: Literal {
type: "Literal",
- raw: ""json"",
+ raw: "'json'",
value: "json",
range: [37, 43],
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/2-TSESTree-Tokens.shot
index d9a618899217..4aa87f31f614 100644
--- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/2-TSESTree-Tokens.shot
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/2-TSESTree-Tokens.shot
@@ -51,7 +51,7 @@
},
String {
type: "String",
- value: ""A"",
+ value: "'A'",
range: [16, 19],
loc: {
@@ -131,7 +131,7 @@
},
String {
type: "String",
- value: ""json"",
+ value: "'json'",
range: [37, 43],
loc: {
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/3-Babel-AST.shot
index 76cbe3e5d77c..79fdc1382198 100644
--- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/3-Babel-AST.shot
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/3-Babel-AST.shot
@@ -20,7 +20,7 @@ Program {
type: "TSImportType",
argument: Literal {
type: "Literal",
- raw: ""A"",
+ raw: "'A'",
value: "A",
range: [16, 19],
@@ -75,7 +75,7 @@ Program {
shorthand: false,
value: Literal {
type: "Literal",
- raw: ""json"",
+ raw: "'json'",
value: "json",
range: [37, 43],
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/4-Babel-Tokens.shot
index 91cd1f711197..352ef98a8d93 100644
--- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/4-Babel-Tokens.shot
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/4-Babel-Tokens.shot
@@ -51,7 +51,7 @@
},
String {
type: "String",
- value: ""A"",
+ value: "'A'",
range: [16, 19],
loc: {
@@ -131,7 +131,7 @@
},
String {
type: "String",
- value: ""json"",
+ value: "'json'",
range: [37, 43],
loc: {
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/5-AST-Alignment-AST.shot
index 31b5f49ee553..668b4bceacd6 100644
--- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/5-AST-Alignment-AST.shot
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/5-AST-Alignment-AST.shot
@@ -29,11 +29,11 @@ Snapshot Diff:
- type: 'TSLiteralType',
- literal: Literal {
- type: 'Literal',
-- raw: '"A"',
+- raw: '\'A\'',
- value: 'A',
+ argument: Literal {
+ type: 'Literal',
-+ raw: '"A"',
++ raw: '\'A\'',
+ value: 'A',
- range: [16, 19],
@@ -95,7 +95,7 @@ Snapshot Diff:
shorthand: false,
value: Literal {
type: 'Literal',
- raw: '"json"',
+ raw: '\'json\'',
value: 'json',
range: [37, 43],
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/6-AST-Alignment-Tokens.shot
index 87fdac962d79..bbd22a21ad7c 100644
--- a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/6-AST-Alignment-Tokens.shot
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-import-attributes-with/snapshots/6-AST-Alignment-Tokens.shot
@@ -58,7 +58,7 @@ Snapshot Diff:
},
String {
type: 'String',
- value: '"A"',
+ value: '\'A\'',
range: [16, 19],
loc: {
@@ -140,7 +140,7 @@ Snapshot Diff:
},
String {
type: 'String',
- value: '"json"',
+ value: '\'json\'',
range: [37, 43],
loc: {
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts
new file mode 100644
index 000000000000..f5ad318ad5f4
--- /dev/null
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts
@@ -0,0 +1 @@
+type TrailingComma = import("A", { with: { "resolution-mode": "import", }, } );
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/1-TSESTree-AST.shot
new file mode 100644
index 000000000000..f1f332ffa5de
--- /dev/null
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/1-TSESTree-AST.shot
@@ -0,0 +1,149 @@
+Program {
+ type: "Program",
+ body: [
+ TSTypeAliasDeclaration {
+ type: "TSTypeAliasDeclaration",
+ declare: false,
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "TrailingComma",
+ optional: false,
+
+ range: [5, 18],
+ loc: {
+ start: { column: 5, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ typeAnnotation: TSImportType {
+ type: "TSImportType",
+ argument: TSLiteralType {
+ type: "TSLiteralType",
+ literal: Literal {
+ type: "Literal",
+ raw: ""A"",
+ value: "A",
+
+ range: [28, 31],
+ loc: {
+ start: { column: 28, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+
+ range: [28, 31],
+ loc: {
+ start: { column: 28, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+ options: ObjectExpression {
+ type: "ObjectExpression",
+ properties: [
+ Property {
+ type: "Property",
+ computed: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "with",
+ optional: false,
+
+ range: [35, 39],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 39, line: 1 },
+ },
+ },
+ kind: "init",
+ method: false,
+ optional: false,
+ shorthand: false,
+ value: ObjectExpression {
+ type: "ObjectExpression",
+ properties: [
+ Property {
+ type: "Property",
+ computed: false,
+ key: Literal {
+ type: "Literal",
+ raw: ""resolution-mode"",
+ value: "resolution-mode",
+
+ range: [43, 60],
+ loc: {
+ start: { column: 43, line: 1 },
+ end: { column: 60, line: 1 },
+ },
+ },
+ kind: "init",
+ method: false,
+ optional: false,
+ shorthand: false,
+ value: Literal {
+ type: "Literal",
+ raw: ""import"",
+ value: "import",
+
+ range: [62, 70],
+ loc: {
+ start: { column: 62, line: 1 },
+ end: { column: 70, line: 1 },
+ },
+ },
+
+ range: [43, 70],
+ loc: {
+ start: { column: 43, line: 1 },
+ end: { column: 70, line: 1 },
+ },
+ },
+ ],
+
+ range: [41, 73],
+ loc: {
+ start: { column: 41, line: 1 },
+ end: { column: 73, line: 1 },
+ },
+ },
+
+ range: [35, 73],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 73, line: 1 },
+ },
+ },
+ ],
+
+ range: [33, 76],
+ loc: {
+ start: { column: 33, line: 1 },
+ end: { column: 76, line: 1 },
+ },
+ },
+ qualifier: null,
+ typeArguments: null,
+
+ range: [21, 78],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 78, line: 1 },
+ },
+ },
+
+ range: [0, 79],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 79, line: 1 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 80],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/2-TSESTree-Tokens.shot
new file mode 100644
index 000000000000..cae5e0bcfd9e
--- /dev/null
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/2-TSESTree-Tokens.shot
@@ -0,0 +1,202 @@
+[
+ Identifier {
+ type: "Identifier",
+ value: "type",
+
+ range: [0, 4],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 4, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "TrailingComma",
+
+ range: [5, 18],
+ loc: {
+ start: { column: 5, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "import",
+
+ range: [21, 27],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 27, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [27, 28],
+ loc: {
+ start: { column: 27, line: 1 },
+ end: { column: 28, line: 1 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""A"",
+
+ range: [28, 31],
+ loc: {
+ start: { column: 28, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ",",
+
+ range: [31, 32],
+ loc: {
+ start: { column: 31, line: 1 },
+ end: { column: 32, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [33, 34],
+ loc: {
+ start: { column: 33, line: 1 },
+ end: { column: 34, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "with",
+
+ range: [35, 39],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 39, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [39, 40],
+ loc: {
+ start: { column: 39, line: 1 },
+ end: { column: 40, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [41, 42],
+ loc: {
+ start: { column: 41, line: 1 },
+ end: { column: 42, line: 1 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""resolution-mode"",
+
+ range: [43, 60],
+ loc: {
+ start: { column: 43, line: 1 },
+ end: { column: 60, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [60, 61],
+ loc: {
+ start: { column: 60, line: 1 },
+ end: { column: 61, line: 1 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""import"",
+
+ range: [62, 70],
+ loc: {
+ start: { column: 62, line: 1 },
+ end: { column: 70, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ",",
+
+ range: [70, 71],
+ loc: {
+ start: { column: 70, line: 1 },
+ end: { column: 71, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [72, 73],
+ loc: {
+ start: { column: 72, line: 1 },
+ end: { column: 73, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ",",
+
+ range: [73, 74],
+ loc: {
+ start: { column: 73, line: 1 },
+ end: { column: 74, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [75, 76],
+ loc: {
+ start: { column: 75, line: 1 },
+ end: { column: 76, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [77, 78],
+ loc: {
+ start: { column: 77, line: 1 },
+ end: { column: 78, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [78, 79],
+ loc: {
+ start: { column: 78, line: 1 },
+ end: { column: 79, line: 1 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-AST.shot
new file mode 100644
index 000000000000..b667343abacf
--- /dev/null
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-AST.shot
@@ -0,0 +1,139 @@
+Program {
+ type: "Program",
+ body: [
+ TSTypeAliasDeclaration {
+ type: "TSTypeAliasDeclaration",
+ declare: false,
+ id: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "TrailingComma",
+ optional: false,
+
+ range: [5, 18],
+ loc: {
+ start: { column: 5, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ typeAnnotation: TSImportType {
+ type: "TSImportType",
+ argument: Literal {
+ type: "Literal",
+ raw: ""A"",
+ value: "A",
+
+ range: [28, 31],
+ loc: {
+ start: { column: 28, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+ options: ObjectExpression {
+ type: "ObjectExpression",
+ properties: [
+ Property {
+ type: "Property",
+ computed: false,
+ key: Identifier {
+ type: "Identifier",
+ decorators: [],
+ name: "with",
+ optional: false,
+
+ range: [35, 39],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 39, line: 1 },
+ },
+ },
+ kind: "init",
+ method: false,
+ optional: false,
+ shorthand: false,
+ value: ObjectExpression {
+ type: "ObjectExpression",
+ properties: [
+ Property {
+ type: "Property",
+ computed: false,
+ key: Literal {
+ type: "Literal",
+ raw: ""resolution-mode"",
+ value: "resolution-mode",
+
+ range: [43, 60],
+ loc: {
+ start: { column: 43, line: 1 },
+ end: { column: 60, line: 1 },
+ },
+ },
+ kind: "init",
+ method: false,
+ optional: false,
+ shorthand: false,
+ value: Literal {
+ type: "Literal",
+ raw: ""import"",
+ value: "import",
+
+ range: [62, 70],
+ loc: {
+ start: { column: 62, line: 1 },
+ end: { column: 70, line: 1 },
+ },
+ },
+
+ range: [43, 70],
+ loc: {
+ start: { column: 43, line: 1 },
+ end: { column: 70, line: 1 },
+ },
+ },
+ ],
+
+ range: [41, 73],
+ loc: {
+ start: { column: 41, line: 1 },
+ end: { column: 73, line: 1 },
+ },
+ },
+
+ range: [35, 73],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 73, line: 1 },
+ },
+ },
+ ],
+
+ range: [33, 76],
+ loc: {
+ start: { column: 33, line: 1 },
+ end: { column: 76, line: 1 },
+ },
+ },
+ qualifier: null,
+
+ range: [21, 78],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 78, line: 1 },
+ },
+ },
+
+ range: [0, 79],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 79, line: 1 },
+ },
+ },
+ ],
+ sourceType: "script",
+
+ range: [0, 80],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+}
\ No newline at end of file
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot
new file mode 100644
index 000000000000..0c1ff0965afa
--- /dev/null
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/3-Babel-Error.shot
@@ -0,0 +1,4 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > type > TSImportType > type-import-type-with-trailing-comma-in-import-attributes > Babel - Error`]
+NO ERROR
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/4-Babel-Tokens.shot
new file mode 100644
index 000000000000..1c38f78693d0
--- /dev/null
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/4-Babel-Tokens.shot
@@ -0,0 +1,202 @@
+[
+ Identifier {
+ type: "Identifier",
+ value: "type",
+
+ range: [0, 4],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 4, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "TrailingComma",
+
+ range: [5, 18],
+ loc: {
+ start: { column: 5, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "=",
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Keyword {
+ type: "Keyword",
+ value: "import",
+
+ range: [21, 27],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 27, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "(",
+
+ range: [27, 28],
+ loc: {
+ start: { column: 27, line: 1 },
+ end: { column: 28, line: 1 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""A"",
+
+ range: [28, 31],
+ loc: {
+ start: { column: 28, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ",",
+
+ range: [31, 32],
+ loc: {
+ start: { column: 31, line: 1 },
+ end: { column: 32, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [33, 34],
+ loc: {
+ start: { column: 33, line: 1 },
+ end: { column: 34, line: 1 },
+ },
+ },
+ Identifier {
+ type: "Identifier",
+ value: "with",
+
+ range: [35, 39],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 39, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [39, 40],
+ loc: {
+ start: { column: 39, line: 1 },
+ end: { column: 40, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "{",
+
+ range: [41, 42],
+ loc: {
+ start: { column: 41, line: 1 },
+ end: { column: 42, line: 1 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""resolution-mode"",
+
+ range: [43, 60],
+ loc: {
+ start: { column: 43, line: 1 },
+ end: { column: 60, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ":",
+
+ range: [60, 61],
+ loc: {
+ start: { column: 60, line: 1 },
+ end: { column: 61, line: 1 },
+ },
+ },
+ String {
+ type: "String",
+ value: ""import"",
+
+ range: [62, 70],
+ loc: {
+ start: { column: 62, line: 1 },
+ end: { column: 70, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ",",
+
+ range: [70, 71],
+ loc: {
+ start: { column: 70, line: 1 },
+ end: { column: 71, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [72, 73],
+ loc: {
+ start: { column: 72, line: 1 },
+ end: { column: 73, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ",",
+
+ range: [73, 74],
+ loc: {
+ start: { column: 73, line: 1 },
+ end: { column: 74, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: "}",
+
+ range: [75, 76],
+ loc: {
+ start: { column: 75, line: 1 },
+ end: { column: 76, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ")",
+
+ range: [77, 78],
+ loc: {
+ start: { column: 77, line: 1 },
+ end: { column: 78, line: 1 },
+ },
+ },
+ Punctuator {
+ type: "Punctuator",
+ value: ";",
+
+ range: [78, 79],
+ loc: {
+ start: { column: 78, line: 1 },
+ end: { column: 79, line: 1 },
+ },
+ },
+]
\ No newline at end of file
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/5-AST-Alignment-AST.shot
new file mode 100644
index 000000000000..4cf4abde9c9f
--- /dev/null
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/5-AST-Alignment-AST.shot
@@ -0,0 +1,160 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > type > TSImportType > type-import-type-with-trailing-comma-in-import-attributes > AST Alignment - AST`]
+Snapshot Diff:
+- TSESTree
++ Babel
+
+ Program {
+ type: 'Program',
+ body: Array [
+ TSTypeAliasDeclaration {
+ type: 'TSTypeAliasDeclaration',
+ declare: false,
+ id: Identifier {
+ type: 'Identifier',
+ decorators: Array [],
+ name: 'TrailingComma',
+ optional: false,
+
+ range: [5, 18],
+ loc: {
+ start: { column: 5, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ typeAnnotation: TSImportType {
+ type: 'TSImportType',
+- argument: TSLiteralType {
+- type: 'TSLiteralType',
+- literal: Literal {
+- type: 'Literal',
+- raw: '"A"',
+- value: 'A',
++ argument: Literal {
++ type: 'Literal',
++ raw: '"A"',
++ value: 'A',
+
+- range: [28, 31],
+- loc: {
+- start: { column: 28, line: 1 },
+- end: { column: 31, line: 1 },
+- },
+- },
+-
+ range: [28, 31],
+ loc: {
+ start: { column: 28, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+ options: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Identifier {
+ type: 'Identifier',
+ decorators: Array [],
+ name: 'with',
+ optional: false,
+
+ range: [35, 39],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 39, line: 1 },
+ },
+ },
+ kind: 'init',
+ method: false,
+ optional: false,
+ shorthand: false,
+ value: ObjectExpression {
+ type: 'ObjectExpression',
+ properties: Array [
+ Property {
+ type: 'Property',
+ computed: false,
+ key: Literal {
+ type: 'Literal',
+ raw: '"resolution-mode"',
+ value: 'resolution-mode',
+
+ range: [43, 60],
+ loc: {
+ start: { column: 43, line: 1 },
+ end: { column: 60, line: 1 },
+ },
+ },
+ kind: 'init',
+ method: false,
+ optional: false,
+ shorthand: false,
+ value: Literal {
+ type: 'Literal',
+ raw: '"import"',
+ value: 'import',
+
+ range: [62, 70],
+ loc: {
+ start: { column: 62, line: 1 },
+ end: { column: 70, line: 1 },
+ },
+ },
+
+ range: [43, 70],
+ loc: {
+ start: { column: 43, line: 1 },
+ end: { column: 70, line: 1 },
+ },
+ },
+ ],
+
+ range: [41, 73],
+ loc: {
+ start: { column: 41, line: 1 },
+ end: { column: 73, line: 1 },
+ },
+ },
+
+ range: [35, 73],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 73, line: 1 },
+ },
+ },
+ ],
+
+ range: [33, 76],
+ loc: {
+ start: { column: 33, line: 1 },
+ end: { column: 76, line: 1 },
+ },
+ },
+ qualifier: null,
+- typeArguments: null,
+
+ range: [21, 78],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 78, line: 1 },
+ },
+ },
+
+ range: [0, 79],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 79, line: 1 },
+ },
+ },
+ ],
+ sourceType: 'script',
+
+ range: [0, 80],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 0, line: 2 },
+ },
+ }
diff --git a/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/6-AST-Alignment-Tokens.shot
new file mode 100644
index 000000000000..548e27a14f2b
--- /dev/null
+++ b/packages/ast-spec/src/type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/snapshots/6-AST-Alignment-Tokens.shot
@@ -0,0 +1,211 @@
+// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
+
+exports[`AST Fixtures > type > TSImportType > type-import-type-with-trailing-comma-in-import-attributes > AST Alignment - Token`]
+Snapshot Diff:
+- TSESTree
++ Babel
+
+ Array [
+ Identifier {
+ type: 'Identifier',
+ value: 'type',
+
+ range: [0, 4],
+ loc: {
+ start: { column: 0, line: 1 },
+ end: { column: 4, line: 1 },
+ },
+ },
+ Identifier {
+ type: 'Identifier',
+ value: 'TrailingComma',
+
+ range: [5, 18],
+ loc: {
+ start: { column: 5, line: 1 },
+ end: { column: 18, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '=',
+
+ range: [19, 20],
+ loc: {
+ start: { column: 19, line: 1 },
+ end: { column: 20, line: 1 },
+ },
+ },
+ Keyword {
+ type: 'Keyword',
+ value: 'import',
+
+ range: [21, 27],
+ loc: {
+ start: { column: 21, line: 1 },
+ end: { column: 27, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '(',
+
+ range: [27, 28],
+ loc: {
+ start: { column: 27, line: 1 },
+ end: { column: 28, line: 1 },
+ },
+ },
+ String {
+ type: 'String',
+ value: '"A"',
+
+ range: [28, 31],
+ loc: {
+ start: { column: 28, line: 1 },
+ end: { column: 31, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ',',
+
+ range: [31, 32],
+ loc: {
+ start: { column: 31, line: 1 },
+ end: { column: 32, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ range: [33, 34],
+ loc: {
+ start: { column: 33, line: 1 },
+ end: { column: 34, line: 1 },
+ },
+ },
+- Keyword {
+- type: 'Keyword',
++ Identifier {
++ type: 'Identifier',
+ value: 'with',
+
+ range: [35, 39],
+ loc: {
+ start: { column: 35, line: 1 },
+ end: { column: 39, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [39, 40],
+ loc: {
+ start: { column: 39, line: 1 },
+ end: { column: 40, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '{',
+
+ range: [41, 42],
+ loc: {
+ start: { column: 41, line: 1 },
+ end: { column: 42, line: 1 },
+ },
+ },
+ String {
+ type: 'String',
+ value: '"resolution-mode"',
+
+ range: [43, 60],
+ loc: {
+ start: { column: 43, line: 1 },
+ end: { column: 60, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ':',
+
+ range: [60, 61],
+ loc: {
+ start: { column: 60, line: 1 },
+ end: { column: 61, line: 1 },
+ },
+ },
+ String {
+ type: 'String',
+ value: '"import"',
+
+ range: [62, 70],
+ loc: {
+ start: { column: 62, line: 1 },
+ end: { column: 70, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ',',
+
+ range: [70, 71],
+ loc: {
+ start: { column: 70, line: 1 },
+ end: { column: 71, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [72, 73],
+ loc: {
+ start: { column: 72, line: 1 },
+ end: { column: 73, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ',',
+
+ range: [73, 74],
+ loc: {
+ start: { column: 73, line: 1 },
+ end: { column: 74, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: '}',
+
+ range: [75, 76],
+ loc: {
+ start: { column: 75, line: 1 },
+ end: { column: 76, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ')',
+
+ range: [77, 78],
+ loc: {
+ start: { column: 77, line: 1 },
+ end: { column: 78, line: 1 },
+ },
+ },
+ Punctuator {
+ type: 'Punctuator',
+ value: ';',
+
+ range: [78, 79],
+ loc: {
+ start: { column: 78, line: 1 },
+ end: { column: 79, line: 1 },
+ },
+ },
+ ]
diff --git a/packages/ast-spec/src/type/TSLiteralType/spec.ts b/packages/ast-spec/src/type/TSLiteralType/spec.ts
index 39f6ae0d2961..7eca3ee2d9e5 100644
--- a/packages/ast-spec/src/type/TSLiteralType/spec.ts
+++ b/packages/ast-spec/src/type/TSLiteralType/spec.ts
@@ -1,10 +1,17 @@
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 { NullLiteral } from '../../expression/literal/NullLiteral/spec';
+import type { RegExpLiteral } from '../../expression/literal/RegExpLiteral/spec';
+import type {
+ UnaryExpressionMinus,
+ UnaryExpressionPlus,
+} from '../../expression/UnaryExpression/spec';
import type { LiteralExpression } from '../../unions/LiteralExpression';
export interface TSLiteralType extends BaseNode {
type: AST_NODE_TYPES.TSLiteralType;
- literal: LiteralExpression | UnaryExpression | UpdateExpression;
+ literal:
+ | Exclude
+ | UnaryExpressionMinus
+ | UnaryExpressionPlus;
}
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot
index 9f5f417fcabd..0d9adec2645d 100644
--- a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-after/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > type > TSMappedType > _error_ > with-member-after > Babel - Error`]
-SyntaxError: Unexpected token, expected "}" (3:2)
+BabelError
+ 1 | type Mapped = {
+ 2 | [key in keyof O]: number;
+> 3 | member: member;
+ | ^ Unexpected token, expected "}" (3:2)
+ 4 | };
+ 5 |
+
diff --git a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot
index c1f120be3d57..5b1a1229034e 100644
--- a/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot
+++ b/packages/ast-spec/src/type/TSMappedType/fixtures/_error_/with-member-before/snapshots/2-Babel-Error.shot
@@ -1,4 +1,11 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AST Fixtures > type > TSMappedType > _error_ > with-member-before > Babel - Error`]
-SyntaxError: Unexpected token, expected "]" (3:16)
+BabelError
+ 1 | type Mapped = {
+ 2 | member: member;
+> 3 | [key in keyof O]: number;
+ | ^ Unexpected token, expected "]" (3:16)
+ 4 | };
+ 5 |
+
diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot
index a64da89a8106..b1e1785390dd 100644
--- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot
+++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot
@@ -253,6 +253,7 @@ exports[`AST Fixtures > List fixtures with AST differences`]
"special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts",
"special/TSTypeParameter/fixtures/method-const-modifiers/fixture.ts",
"type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts",
+ "type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts",
"type/TSMappedType/fixtures/no-modifiers/fixture.ts",
"type/TSMappedType/fixtures/optional-minus/fixture.ts",
"type/TSMappedType/fixtures/optional-plus/fixture.ts",
diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot
index ef7f47117298..cb157b9d2bb9 100644
--- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot
+++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot
@@ -4,16 +4,9 @@ exports[`AST Fixtures > List fixtures with Error differences`]
{
"Babel errored but TSESTree didn't": [
"declaration/ClassDeclaration/fixtures/_error_/implements-non-identifier/fixture.ts",
- "declaration/ClassDeclaration/fixtures/_error_/missing-extends-type-param/fixture.ts",
- "declaration/ClassDeclaration/fixtures/_error_/missing-type-param/fixture.ts",
"declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts",
- "declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture.ts",
- "declaration/TSDeclareFunction/fixtures/_error_/missing-type-param/fixture.ts",
"declaration/TSImportEqualsDeclaration/fixtures/_error_/import-kind/fixture.ts",
"declaration/TSInterfaceDeclaration/fixtures/_error_/missing-extends/fixture.ts",
- "declaration/TSInterfaceDeclaration/fixtures/_error_/missing-type-param/fixture.ts",
- "declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/fixture.ts",
- "declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture.ts",
"declaration/VariableDeclaration/fixtures/_error_/const-destructure-no-init/fixture.ts",
"declaration/VariableDeclaration/fixtures/_error_/const-destructure-type-no-init/fixture.ts",
"declaration/VariableDeclaration/fixtures/_error_/const-id-no-init/fixture.ts",
@@ -23,29 +16,39 @@ exports[`AST Fixtures > List fixtures with Error differences`]
"declaration/VariableDeclaration/fixtures/_error_/var-destructure-no-init/fixture.ts",
"declaration/VariableDeclaration/fixtures/_error_/var-destructure-type-no-init/fixture.ts",
"element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/getter-modifier-declare/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/getter-modifier-export/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/getter-modifier-override/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/getter-modifier-private/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/getter-modifier-protected/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/getter-modifier-public/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/getter-modifier-static/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/property-modifier-abstract/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/property-modifier-async/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/property-modifier-declare/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/property-modifier-export/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/property-modifier-override/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/property-modifier-private/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/property-modifier-protected/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/property-modifier-public/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/property-modifier-static/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/setter-modifier-declare/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/setter-modifier-export/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/setter-modifier-override/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/setter-modifier-private/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/setter-modifier-protected/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/setter-modifier-public/fixture.ts",
+ "expression/ObjectExpression/fixtures/_error_/setter-modifier-static/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/await-without-async-function/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/class-private-identifier-field-with-accessibility-error/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/class-with-constructor-and-type-parameters/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/class-with-two-methods-computed-constructor/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/const-assertions/fixture.ts",
- "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-number/fixture.ts",
- "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-string/fixture.ts",
- "legacy-fixtures/basics/fixtures/_error_/export-named-enum-computed-var-ref/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/export-with-import-assertions/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/import-type-error/fixture.ts",
"legacy-fixtures/basics/fixtures/_error_/new-target-in-arrow-function-body/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-new-expression/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-arrow-function/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-constructor/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-function-expression/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method-signature/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters-in-method/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/index-signature-parameters/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/interface-empty-extends/fixture.ts",
- "legacy-fixtures/errorRecovery/fixtures/_error_/interface-multiple-extends/fixture.ts",
"legacy-fixtures/errorRecovery/fixtures/_error_/interface-with-optional-index-signature/fixture.ts",
"legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-array-pattern-decorator/fixture.ts",
"legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts",
diff --git a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot
index fc6544193cf1..3b8639027419 100644
--- a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot
+++ b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot
@@ -18,26 +18,14 @@ exports[`AST Fixtures > List fixtures with Token differences`]
"declaration/TSInterfaceDeclaration/fixtures/type-param-many/fixture.ts",
"declaration/TSInterfaceDeclaration/fixtures/type-param-one/fixture.ts",
"declaration/TSInterfaceDeclaration/fixtures/with-member-one/fixture.ts",
- "declaration/VariableDeclaration/fixtures/declare-let-destructure-no-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/declare-let-destructure-type-no-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/declare-let-id-no-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/declare-let-id-type-no-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/let-destructure-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/let-destructure-type-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/let-id-definite-type-no-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/let-id-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/let-id-no-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/let-id-type-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/let-id-type-no-init/fixture.ts",
- "declaration/VariableDeclaration/fixtures/multiple-declarations/fixture.ts",
"element/AccessorProperty/fixtures/modifier-private/fixture.ts",
"element/AccessorProperty/fixtures/modifier-protected/fixture.ts",
"element/AccessorProperty/fixtures/modifier-public/fixture.ts",
+ "jsx/JSXAttribute/fixtures/element-non-self-closing/fixture.tsx",
"jsx/JSXNamespacedName/fixtures/component-dashed/fixture.tsx",
"jsx/JSXNamespacedName/fixtures/component/fixture.tsx",
"legacy-fixtures/basics/fixtures/abstract-class-with-abstract-readonly-property/fixture.ts",
"legacy-fixtures/basics/fixtures/abstract-class-with-declare-properties/fixture.ts",
- "legacy-fixtures/basics/fixtures/async-function-with-var-declaration/fixture.ts",
"legacy-fixtures/basics/fixtures/class-with-accessibility-modifiers/fixture.ts",
"legacy-fixtures/basics/fixtures/class-with-constructor-and-modifier/fixture.ts",
"legacy-fixtures/basics/fixtures/class-with-constructor-and-parameter-property-with-modifiers/fixture.ts",
@@ -60,7 +48,6 @@ exports[`AST Fixtures > List fixtures with Token differences`]
"legacy-fixtures/basics/fixtures/export-declare-named-enum/fixture.ts",
"legacy-fixtures/basics/fixtures/export-default-interface/fixture.ts",
"legacy-fixtures/basics/fixtures/export-named-enum/fixture.ts",
- "legacy-fixtures/basics/fixtures/global-this/fixture.ts",
"legacy-fixtures/basics/fixtures/interface-extends-multiple/fixture.ts",
"legacy-fixtures/basics/fixtures/interface-extends/fixture.ts",
"legacy-fixtures/basics/fixtures/interface-type-parameters/fixture.ts",
@@ -73,66 +60,22 @@ exports[`AST Fixtures > List fixtures with Token differences`]
"legacy-fixtures/basics/fixtures/interface-with-optional-properties/fixture.ts",
"legacy-fixtures/basics/fixtures/interface-without-type-annotation/fixture.ts",
"legacy-fixtures/basics/fixtures/keyword-variables/fixture.ts",
- "legacy-fixtures/basics/fixtures/non-null-assertion-operator/fixture.ts",
- "legacy-fixtures/basics/fixtures/null-and-undefined-type-annotations/fixture.ts",
- "legacy-fixtures/basics/fixtures/nullish-coalescing/fixture.ts",
- "legacy-fixtures/basics/fixtures/object-with-escaped-properties/fixture.ts",
"legacy-fixtures/basics/fixtures/type-assertion-in-interface/fixture.ts",
"legacy-fixtures/basics/fixtures/type-assertion-with-guard-in-interface/fixture.ts",
"legacy-fixtures/basics/fixtures/type-guard-in-interface/fixture.ts",
"legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts",
- "legacy-fixtures/basics/fixtures/typed-keyword-null/fixture.ts",
"legacy-fixtures/basics/fixtures/typed-this/fixture.ts",
- "legacy-fixtures/basics/fixtures/union-intersection/fixture.ts",
- "legacy-fixtures/basics/fixtures/unknown-type-annotation/fixture.ts",
- "legacy-fixtures/basics/fixtures/variable-declaration-type-annotation-spacing/fixture.ts",
"legacy-fixtures/class-decorators/fixtures/class-parameter-property/fixture.ts",
"legacy-fixtures/declare/fixtures/enum/fixture.ts",
"legacy-fixtures/declare/fixtures/interface/fixture.ts",
"legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts",
- "legacy-fixtures/types/fixtures/conditional-with-null/fixture.ts",
- "legacy-fixtures/types/fixtures/conditional/fixture.ts",
- "legacy-fixtures/types/fixtures/constructor-generic/fixture.ts",
- "legacy-fixtures/types/fixtures/constructor-in-generic/fixture.ts",
- "legacy-fixtures/types/fixtures/constructor-with-rest/fixture.ts",
- "legacy-fixtures/types/fixtures/constructor/fixture.ts",
- "legacy-fixtures/types/fixtures/function-generic/fixture.ts",
- "legacy-fixtures/types/fixtures/function-in-generic/fixture.ts",
- "legacy-fixtures/types/fixtures/function-with-rest/fixture.ts",
- "legacy-fixtures/types/fixtures/function-with-this/fixture.ts",
- "legacy-fixtures/types/fixtures/function/fixture.ts",
- "legacy-fixtures/types/fixtures/indexed/fixture.ts",
"legacy-fixtures/types/fixtures/interface-with-accessors/fixture.ts",
- "legacy-fixtures/types/fixtures/literal-number-negative/fixture.ts",
- "legacy-fixtures/types/fixtures/literal-number/fixture.ts",
- "legacy-fixtures/types/fixtures/literal-string/fixture.ts",
- "legacy-fixtures/types/fixtures/mapped-readonly-minus/fixture.ts",
- "legacy-fixtures/types/fixtures/mapped-readonly-plus/fixture.ts",
- "legacy-fixtures/types/fixtures/mapped-readonly/fixture.ts",
- "legacy-fixtures/types/fixtures/mapped-untypped/fixture.ts",
- "legacy-fixtures/types/fixtures/mapped/fixture.ts",
- "legacy-fixtures/types/fixtures/nested-types/fixture.ts",
- "legacy-fixtures/types/fixtures/reference-generic-nested/fixture.ts",
- "legacy-fixtures/types/fixtures/reference-generic/fixture.ts",
- "legacy-fixtures/types/fixtures/reference/fixture.ts",
"legacy-fixtures/types/fixtures/this-type-expanded/fixture.ts",
- "legacy-fixtures/types/fixtures/tuple-empty/fixture.ts",
- "legacy-fixtures/types/fixtures/tuple-named-optional/fixture.ts",
- "legacy-fixtures/types/fixtures/tuple-named-rest/fixture.ts",
- "legacy-fixtures/types/fixtures/tuple-named/fixture.ts",
- "legacy-fixtures/types/fixtures/tuple-optional/fixture.ts",
- "legacy-fixtures/types/fixtures/tuple-rest/fixture.ts",
- "legacy-fixtures/types/fixtures/tuple/fixture.ts",
- "legacy-fixtures/types/fixtures/type-literal/fixture.ts",
- "legacy-fixtures/types/fixtures/type-operator/fixture.ts",
- "legacy-fixtures/types/fixtures/typeof-this/fixture.ts",
- "legacy-fixtures/types/fixtures/typeof-with-type-parameters/fixture.ts",
- "legacy-fixtures/types/fixtures/typeof/fixture.ts",
- "legacy-fixtures/types/fixtures/union-intersection/fixture.ts",
"special/TSTypeParameter/fixtures/interface-const-in-modifier-multiple/fixture.ts",
"special/TSTypeParameter/fixtures/interface-const-modifier-extends/fixture.ts",
"special/TSTypeParameter/fixtures/interface-const-modifier-multiple/fixture.ts",
"special/TSTypeParameter/fixtures/interface-const-modifier/fixture.ts",
"special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts",
- "type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts"
+ "type/TSImportType/fixtures/type-import-type-with-import-attributes-with/fixture.ts",
+ "type/TSImportType/fixtures/type-import-type-with-trailing-comma-in-import-attributes/fixture.ts"
]
diff --git a/packages/ast-spec/tests/fixtures.test.ts b/packages/ast-spec/tests/fixtures.test.ts
index 0660b3df3a7c..b6400540425c 100644
--- a/packages/ast-spec/tests/fixtures.test.ts
+++ b/packages/ast-spec/tests/fixtures.test.ts
@@ -4,7 +4,7 @@ import * as path from 'node:path';
import { pathToFileURL } from 'node:url';
import { VitestSnapshotEnvironment } from 'vitest/snapshot';
-import type { ASTFixtureConfig, Fixture } from './util/parsers/parser-types.js';
+import type { Fixture } from './util/parsers/parser-types.js';
import { getErrorLabel } from './util/getErrorLabel.js';
import { parseBabel } from './util/parsers/babel.js';
@@ -231,7 +231,7 @@ describe('AST Fixtures', async () => {
await expect(
[
`${vitestSnapshotHeader}\n\nexports[\`${expect.getState().currentTestName}\`]`,
- babelParsed.error,
+ serializeError(babelParsed.error, contents),
'',
].join('\n'),
).toMatchFileSnapshot(snapshotFiles.error.babel(2));
diff --git a/packages/ast-spec/tests/util/parsers/parser-types.ts b/packages/ast-spec/tests/util/parsers/parser-types.ts
index e1d382876654..e95a648c6f24 100644
--- a/packages/ast-spec/tests/util/parsers/parser-types.ts
+++ b/packages/ast-spec/tests/util/parsers/parser-types.ts
@@ -5,27 +5,6 @@ interface SuccessSnapshotPaths {
readonly tokens: SnapshotPathFn;
}
-/**
- * We define this as a global type to make it easier to consume from fixtures.
- * It saves us having to import the type into `src` files from a test utils folder.
- * This is a convenient property because it saves us from a lot of `../`!
- */
-export interface ASTFixtureConfig {
- /**
- * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript.
- * This case only usually occurs when attempting to lint invalid code.
- */
- readonly allowInvalidAST?: boolean;
-
- /**
- * Specifies that we expect that babel doesn't yet support the code in this fixture, so we expect that it will error.
- * This should not be used if we expect babel to throw for this feature due to a valid parser error!
- *
- * The value should be a description of why there isn't support - for example a github issue URL.
- */
- readonly expectBabelToNotSupport?: string;
-}
-
export interface Fixture {
readonly absolute: string;
readonly babelParsed: ParserResponse;
diff --git a/packages/ast-spec/tests/util/serialize-error.ts b/packages/ast-spec/tests/util/serialize-error.ts
index 8a54fe232230..564f76f4cf0c 100644
--- a/packages/ast-spec/tests/util/serialize-error.ts
+++ b/packages/ast-spec/tests/util/serialize-error.ts
@@ -1,12 +1,10 @@
+import type { ParseError as BabelParseError } from '@babel/parser';
+
import { codeFrameColumns } from '@babel/code-frame';
import { TSError } from './parsers/typescript-estree-import';
-export function serializeError(error: unknown, contents: string): unknown {
- if (!(error instanceof TSError)) {
- return error;
- }
-
+function serializeTSError(error: TSError, contents: string): string {
const {
location: { end, start },
message,
@@ -23,3 +21,38 @@ ${codeFrameColumns(
{ highlightCode: false, message },
)}`;
}
+
+type BabelError = SyntaxError &
+ BabelParseError & { loc: { column: number; line: number } };
+
+const isBabelError = (error: unknown): error is BabelError =>
+ error instanceof SyntaxError &&
+ 'code' in error &&
+ 'reasonCode' in error &&
+ 'loc' in error;
+
+function serializeBabelError(error: BabelError, contents: string): string {
+ const { loc, message } = error;
+
+ return `BabelError
+${codeFrameColumns(
+ contents,
+ {
+ start: { column: loc.column + 1, line: loc.line },
+ },
+ { highlightCode: false, message },
+)}
+ `;
+}
+
+export function serializeError(error: unknown, contents: string): unknown {
+ if (error instanceof TSError) {
+ return serializeTSError(error, contents);
+ }
+
+ if (isBabelError(error)) {
+ return serializeBabelError(error, contents);
+ }
+
+ return error;
+}
diff --git a/packages/ast-spec/tsconfig.spec.json b/packages/ast-spec/tsconfig.spec.json
index fa52d4c4e988..0f776aea58e3 100644
--- a/packages/ast-spec/tsconfig.spec.json
+++ b/packages/ast-spec/tsconfig.spec.json
@@ -3,6 +3,14 @@
"compilerOptions": {
"outDir": "../../dist/packages/ast-spec"
},
+ "include": [
+ "tests",
+ "typings",
+ "**/fixtures/**/config.ts",
+ "vitest.config.mts",
+ "package.json"
+ ],
+ "exclude": ["**/fixtures/**/fixture.ts"],
"references": [
{
"path": "../typescript-estree/tsconfig.build.json"
diff --git a/packages/ast-spec/typings/global.d.ts b/packages/ast-spec/typings/global.d.ts
new file mode 100644
index 000000000000..7dd0713ea5d4
--- /dev/null
+++ b/packages/ast-spec/typings/global.d.ts
@@ -0,0 +1,20 @@
+/**
+ * We define this as a global type to make it easier to consume from fixtures.
+ * It saves us having to import the type into `src` files from a test utils folder.
+ * This is a convenient property because it saves us from a lot of `../`!
+ */
+interface ASTFixtureConfig {
+ /**
+ * Prevents the parser from throwing an error if it receives an invalid AST from TypeScript.
+ * This case only usually occurs when attempting to lint invalid code.
+ */
+ readonly allowInvalidAST?: boolean;
+
+ /**
+ * Specifies that we expect that babel doesn't yet support the code in this fixture, so we expect that it will error.
+ * This should not be used if we expect babel to throw for this feature due to a valid parser error!
+ *
+ * The value should be a description of why there isn't support - for example a github issue URL.
+ */
+ readonly expectBabelToNotSupport?: string;
+}
diff --git a/packages/eslint-plugin-internal/index.d.ts b/packages/eslint-plugin-internal/index.d.ts
index 8c2962c75da3..68fc87c70ca0 100644
--- a/packages/eslint-plugin-internal/index.d.ts
+++ b/packages/eslint-plugin-internal/index.d.ts
@@ -2,8 +2,8 @@ import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
import type rules from './rules';
-declare const cjsExport: {
+declare const defaultExport: {
meta: FlatConfig.PluginMeta;
rules: typeof rules;
};
-export = cjsExport;
+export default defaultExport;
diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json
index 458bee57df6a..a6e86293d069 100644
--- a/packages/eslint-plugin-internal/package.json
+++ b/packages/eslint-plugin-internal/package.json
@@ -3,6 +3,7 @@
"private": true,
"main": "dist/index.js",
"types": "index.d.ts",
+ "type": "module",
"repository": {
"type": "git",
"url": "https://github.com/typescript-eslint/typescript-eslint.git",
@@ -14,25 +15,36 @@
"homepage": "https://typescript-eslint.io",
"license": "MIT",
"scripts": {
- "build": "npx tsc -b tsconfig.build.json",
- "clean": "npx tsc -b tsconfig.build.json --clean",
- "postclean": "rimraf dist/ coverage/",
- "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
- "lint": "npx nx lint",
- "test": "vitest --run --config=$INIT_CWD/vitest.config.mts",
- "check-types": "npx nx typecheck"
+ "build": "yarn run -BT nx build",
+ "clean": "rimraf dist/ coverage/",
+ "format": "yarn run -T format",
+ "lint": "yarn run -BT nx lint",
+ "test": "yarn run -BT nx test",
+ "typecheck": "yarn run -BT nx typecheck"
},
"dependencies": {
- "@prettier/sync": "^0.5.1",
+ "@prettier/sync": "^0.6.1",
"@typescript-eslint/rule-tester": "workspace:*",
"@typescript-eslint/scope-manager": "workspace:*",
"@typescript-eslint/type-utils": "workspace:*",
"@typescript-eslint/utils": "workspace:*",
- "prettier": "^3.2.5"
+ "prettier": "3.6.2"
},
"devDependencies": {
"@vitest/coverage-v8": "^3.1.3",
+ "eslint": "*",
"rimraf": "*",
"vitest": "^3.1.3"
+ },
+ "nx": {
+ "name": "eslint-plugin-internal",
+ "includedScripts": [
+ "clean"
+ ],
+ "targets": {
+ "lint": {
+ "command": "eslint"
+ }
+ }
}
}
diff --git a/packages/eslint-plugin-internal/project.json b/packages/eslint-plugin-internal/project.json
deleted file mode 100644
index e7e8fe15571b..000000000000
--- a/packages/eslint-plugin-internal/project.json
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "name": "eslint-plugin-internal",
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
- "projectType": "library",
- "root": "packages/eslint-plugin-internal",
- "sourceRoot": "packages/eslint-plugin-internal/src",
- "targets": {
- "lint": {
- "executor": "@nx/eslint:lint",
- "outputs": ["{options.outputFile}"]
- },
- "test": {
- "executor": "@nx/vite:test"
- }
- }
-}
diff --git a/packages/eslint-plugin-internal/src/index.ts b/packages/eslint-plugin-internal/src/index.ts
index 68991268506a..a299b00ec525 100644
--- a/packages/eslint-plugin-internal/src/index.ts
+++ b/packages/eslint-plugin-internal/src/index.ts
@@ -1,17 +1,12 @@
import type { Linter } from '@typescript-eslint/utils/ts-eslint';
-import rules from './rules';
+import rules from './rules/index.js';
+import packageJson from './util/packagejson.js';
-// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
-const { name, version } = require('../package.json') as {
- name: string;
- version: string;
-};
-
-export = {
+export default {
meta: {
- name,
- version,
+ name: packageJson.name,
+ version: packageJson.version,
},
rules,
} satisfies Linter.Plugin;
diff --git a/packages/eslint-plugin-internal/src/rules/debug-namespace.ts b/packages/eslint-plugin-internal/src/rules/debug-namespace.ts
index ca76f5e1870f..9852edbb961f 100755
--- a/packages/eslint-plugin-internal/src/rules/debug-namespace.ts
+++ b/packages/eslint-plugin-internal/src/rules/debug-namespace.ts
@@ -2,7 +2,7 @@ import type { TSESTree } from '@typescript-eslint/utils';
import { getStaticValue } from '@typescript-eslint/utils/ast-utils';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
function filePathToNamespace(filePath: string) {
const relativePath = filePath
@@ -20,7 +20,7 @@ function filePathToNamespace(filePath: string) {
}
export default createRule({
- name: __filename,
+ name: 'debug-namespace',
meta: {
type: 'problem',
docs: {
diff --git a/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts b/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts
index f118b1c10cfc..0680b631102c 100644
--- a/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts
+++ b/packages/eslint-plugin-internal/src/rules/eqeq-nullish.ts
@@ -4,10 +4,10 @@ import {
NullThrowsReasons,
} from '@typescript-eslint/utils/eslint-utils';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
export default createRule({
- name: __filename,
+ name: 'eqeq-nullish',
meta: {
type: 'suggestion',
docs: {
diff --git a/packages/eslint-plugin-internal/src/rules/index.ts b/packages/eslint-plugin-internal/src/rules/index.ts
index 806618f909e4..7381fa1f11af 100644
--- a/packages/eslint-plugin-internal/src/rules/index.ts
+++ b/packages/eslint-plugin-internal/src/rules/index.ts
@@ -1,17 +1,19 @@
import type { Linter } from '@typescript-eslint/utils/ts-eslint';
-import debugNamespace from './debug-namespace';
-import eqeqNullish from './eqeq-nullish';
-import noPoorlyTypedTsProps from './no-poorly-typed-ts-props';
-import noRelativePathsToInternalPackages from './no-relative-paths-to-internal-packages';
-import noTypescriptDefaultImport from './no-typescript-default-import';
-import noTypescriptEstreeImport from './no-typescript-estree-import';
-import pluginTestFormatting from './plugin-test-formatting';
-import preferASTTypesEnum from './prefer-ast-types-enum';
+import debugNamespace from './debug-namespace.js';
+import eqeqNullish from './eqeq-nullish.js';
+import noDynamicTests from './no-dynamic-tests.js';
+import noPoorlyTypedTsProps from './no-poorly-typed-ts-props.js';
+import noRelativePathsToInternalPackages from './no-relative-paths-to-internal-packages.js';
+import noTypescriptDefaultImport from './no-typescript-default-import.js';
+import noTypescriptEstreeImport from './no-typescript-estree-import.js';
+import pluginTestFormatting from './plugin-test-formatting.js';
+import preferASTTypesEnum from './prefer-ast-types-enum.js';
export default {
'debug-namespace': debugNamespace,
'eqeq-nullish': eqeqNullish,
+ 'no-dynamic-tests': noDynamicTests,
'no-poorly-typed-ts-props': noPoorlyTypedTsProps,
'no-relative-paths-to-internal-packages': noRelativePathsToInternalPackages,
'no-typescript-default-import': noTypescriptDefaultImport,
diff --git a/packages/eslint-plugin-internal/src/rules/no-dynamic-tests.ts b/packages/eslint-plugin-internal/src/rules/no-dynamic-tests.ts
new file mode 100644
index 000000000000..bee236413868
--- /dev/null
+++ b/packages/eslint-plugin-internal/src/rules/no-dynamic-tests.ts
@@ -0,0 +1,140 @@
+import type { InvalidTestCase } from '@typescript-eslint/rule-tester';
+import type { TSESTree } from '@typescript-eslint/utils';
+
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
+
+import { createRule } from '../util/index.js';
+
+export default createRule({
+ name: 'no-dynamic-tests',
+ meta: {
+ type: 'problem',
+ docs: {
+ description: 'Disallow dynamic syntax in RuleTester test arrays',
+ },
+ messages: {
+ noDynamicTests:
+ 'Dynamic syntax is not allowed in RuleTester test arrays. Use static values only.',
+ },
+ schema: [],
+ },
+ defaultOptions: [],
+ create(context) {
+ function isRuleTesterCall(node: TSESTree.Node): boolean {
+ return (
+ node.type === AST_NODE_TYPES.CallExpression &&
+ node.callee.type === AST_NODE_TYPES.MemberExpression &&
+ node.callee.object.type === AST_NODE_TYPES.Identifier &&
+ node.callee.object.name === 'ruleTester' &&
+ node.callee.property.type === AST_NODE_TYPES.Identifier &&
+ node.callee.property.name === 'run'
+ );
+ }
+
+ function reportDynamicElements(node: TSESTree.Node): void {
+ switch (node.type) {
+ case AST_NODE_TYPES.CallExpression:
+ case AST_NODE_TYPES.SpreadElement:
+ case AST_NODE_TYPES.Identifier:
+ case AST_NODE_TYPES.BinaryExpression:
+ case AST_NODE_TYPES.ConditionalExpression:
+ case AST_NODE_TYPES.MemberExpression:
+ context.report({
+ node,
+ messageId: 'noDynamicTests',
+ });
+ break;
+ case AST_NODE_TYPES.TemplateLiteral:
+ node.expressions.forEach(expr => {
+ reportDynamicElements(expr);
+ });
+ break;
+ case AST_NODE_TYPES.ArrayExpression:
+ node.elements.forEach(element => {
+ if (element) {
+ reportDynamicElements(element);
+ }
+ });
+ break;
+ case AST_NODE_TYPES.ObjectExpression:
+ node.properties.forEach(prop => {
+ if (prop.type === AST_NODE_TYPES.SpreadElement) {
+ context.report({
+ node: prop,
+ messageId: 'noDynamicTests',
+ });
+ } else {
+ // InvalidTestCase extends ValidTestCase
+ type TestCaseKey = keyof InvalidTestCase;
+ const keyToValidate: TestCaseKey[] = ['code', 'errors'];
+
+ if (
+ prop.key.type === AST_NODE_TYPES.Identifier &&
+ keyToValidate.includes(prop.key.name as TestCaseKey)
+ ) {
+ reportDynamicElements(prop.value);
+ } else if (
+ prop.key.type === AST_NODE_TYPES.Literal &&
+ keyToValidate.includes(prop.key.value as TestCaseKey)
+ ) {
+ reportDynamicElements(prop.value);
+ }
+ }
+ });
+ break;
+ case AST_NODE_TYPES.TaggedTemplateExpression:
+ if (
+ !(
+ node.tag.type === AST_NODE_TYPES.Identifier &&
+ node.tag.name === 'noFormat'
+ )
+ ) {
+ context.report({
+ node: node.tag,
+ messageId: 'noDynamicTests',
+ });
+ }
+ break;
+ case AST_NODE_TYPES.Literal:
+ default:
+ break;
+ }
+ }
+
+ return {
+ CallExpression(node) {
+ if (isRuleTesterCall(node)) {
+ // If valid code, arg length is always 3 but we need to avoid conflict while dev
+ if (node.arguments.length < 3) {
+ return;
+ }
+ const testObject = node.arguments[2];
+
+ if (testObject.type === AST_NODE_TYPES.ObjectExpression) {
+ for (const prop of testObject.properties) {
+ const isTestCases =
+ prop.type === AST_NODE_TYPES.Property &&
+ prop.key.type === AST_NODE_TYPES.Identifier &&
+ (prop.key.name === 'valid' || prop.key.name === 'invalid');
+
+ if (isTestCases) {
+ if (prop.value.type === AST_NODE_TYPES.ArrayExpression) {
+ prop.value.elements.forEach(element => {
+ if (element) {
+ reportDynamicElements(element);
+ }
+ });
+ } else {
+ context.report({
+ node: prop.value,
+ messageId: 'noDynamicTests',
+ });
+ }
+ }
+ }
+ }
+ }
+ },
+ };
+ },
+});
diff --git a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
index 2da006d07bd9..ac537777b070 100644
--- a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts
@@ -2,7 +2,7 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { ESLintUtils } from '@typescript-eslint/utils';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
/*
TypeScript declares some bad types for certain properties.
diff --git a/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts b/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts
index b366ee764fcb..b2eaa1d0d2f4 100644
--- a/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-relative-paths-to-internal-packages.ts
@@ -1,12 +1,17 @@
import path from 'node:path';
+import { fileURLToPath } from 'node:url';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
+
+// Replace with import.meta.dirname when minimum node version supports it
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
export const REPO_ROOT = path.resolve(__dirname, '../../../..');
export const PACKAGES_DIR = path.join(REPO_ROOT, 'packages');
export default createRule({
- name: __filename,
+ name: 'no-relative-paths-to-internal-packages',
meta: {
type: 'problem',
docs: {
diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts
index bddfbe1f7955..c5937ac0c7d3 100644
--- a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts
@@ -1,6 +1,6 @@
import type { TSESTree } from '@typescript-eslint/utils';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
/*
We have `allowSyntheticDefaultImports` turned on in this project, so there are two problems that arise:
diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
index 27d0ce54852d..e598a6faf9d0 100644
--- a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
+++ b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts
@@ -1,4 +1,4 @@
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
const TSESTREE_NAME = '@typescript-eslint/typescript-estree';
const TYPES_NAME = '@typescript-eslint/types';
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 26fcc60d8d2b..aaf4296ca3bf 100644
--- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
+++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts
@@ -3,8 +3,14 @@ import type { TSESTree } from '@typescript-eslint/utils';
import prettier from '@prettier/sync';
import { getContextualType } from '@typescript-eslint/type-utils';
import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
+
+// Replace with import.meta.dirname when minimum node version supports it
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
/*
The strings that are used for eslint plugins will not be checked for formatting.
@@ -145,6 +151,8 @@ export default createRule({
properties: {
formatWithPrettier: {
type: 'boolean',
+ description:
+ 'Whether to enforce formatting of code snippets using Prettier.',
},
},
},
@@ -411,7 +419,7 @@ export default createRule({
if (isNoFormatTagged) {
if (literal.parent.type === AST_NODE_TYPES.TaggedTemplateExpression) {
- checkForUnnecesaryNoFormat(code, literal.parent);
+ checkForUnnecessaryNoFormat(code, literal.parent);
}
return;
}
@@ -447,7 +455,7 @@ export default createRule({
return tag.type === AST_NODE_TYPES.Identifier && tag.name === 'noFormat';
}
- function checkForUnnecesaryNoFormat(
+ function checkForUnnecessaryNoFormat(
text: string,
expr: TSESTree.TaggedTemplateExpression,
): void {
@@ -472,7 +480,7 @@ export default createRule({
): void {
if (isNoFormatTemplateTag(expr.tag)) {
const { cooked } = expr.quasi.quasis[0].value;
- checkForUnnecesaryNoFormat(cooked, expr);
+ checkForUnnecessaryNoFormat(cooked, expr);
} else {
return;
}
@@ -553,10 +561,6 @@ export default createRule({
AST_NODE_TYPES.ArrayExpression,
AST_NODE_TYPES.ObjectExpression,
].join(' > ')]: checkInvalidTest,
- // special case for our batchedSingleLineTests utility
- 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression':
- checkInvalidTest,
-
/**
* generic, type-aware handling for any old object
* this is a fallback to handle random variables people declare or object
diff --git a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
index d6005443a50e..edf2bbf842f3 100755
--- a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
+++ b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts
@@ -3,14 +3,14 @@ import type { TSESTree } from '@typescript-eslint/utils';
import { DefinitionType } from '@typescript-eslint/scope-manager';
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
-import { createRule } from '../util';
+import { createRule } from '../util/index.js';
const isStringLiteral = (
node: TSESTree.Literal,
): node is TSESTree.StringLiteral => typeof node.value === 'string';
export default createRule({
- name: __filename,
+ name: 'prefer-ast-types-enum',
meta: {
type: 'problem',
docs: {
diff --git a/packages/eslint-plugin-internal/src/util/createRule.ts b/packages/eslint-plugin-internal/src/util/createRule.ts
index 628498d08dad..ed6bcbca5198 100644
--- a/packages/eslint-plugin-internal/src/util/createRule.ts
+++ b/packages/eslint-plugin-internal/src/util/createRule.ts
@@ -1,8 +1,8 @@
import { ESLintUtils } from '@typescript-eslint/utils';
-// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
-// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
-const { version }: { version: string } = require('../../package.json');
+import packageJson from './packagejson.js';
+
+const { version } = packageJson;
export interface ESLintPluginInternalDocs {
requiresTypeChecking?: true;
diff --git a/packages/eslint-plugin-internal/src/util/index.ts b/packages/eslint-plugin-internal/src/util/index.ts
index cd13da0f5cd3..71f5bf4fab22 100644
--- a/packages/eslint-plugin-internal/src/util/index.ts
+++ b/packages/eslint-plugin-internal/src/util/index.ts
@@ -1 +1 @@
-export * from './createRule';
+export * from './createRule.js';
diff --git a/packages/eslint-plugin-internal/src/util/packagejson.ts b/packages/eslint-plugin-internal/src/util/packagejson.ts
new file mode 100644
index 000000000000..2b2aa40efceb
--- /dev/null
+++ b/packages/eslint-plugin-internal/src/util/packagejson.ts
@@ -0,0 +1,17 @@
+import fs from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+// Replace with import.meta.dirname when minimum node version supports it
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
+
+const packageJsonPath = path.join(__dirname, '../../package.json');
+const packageJsonContents = fs.readFileSync(packageJsonPath, 'utf-8');
+const packageJsonValue = JSON.parse(packageJsonContents) as {
+ name: string;
+ version: string;
+};
+
+// eslint-disable-next-line import/no-default-export
+export default packageJsonValue;
diff --git a/packages/eslint-plugin-internal/tests/RuleTester.ts b/packages/eslint-plugin-internal/tests/RuleTester.ts
index 1c7e60f12d4b..15d182f0310d 100644
--- a/packages/eslint-plugin-internal/tests/RuleTester.ts
+++ b/packages/eslint-plugin-internal/tests/RuleTester.ts
@@ -1,4 +1,9 @@
import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+// Replace with import.meta.dirname when minimum node version supports it
+const __filename = fileURLToPath(import.meta.url);
+const __dirname = path.dirname(__filename);
export function getFixturesRootDir(): string {
return path.join(__dirname, 'fixtures');
diff --git a/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts b/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts
index 53e7ea81da15..8482087448ac 100644
--- a/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/debug-namespace.test.ts
@@ -1,6 +1,6 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/debug-namespace';
+import rule from '../../src/rules/debug-namespace.js';
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts b/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts
index 663270002e45..10aca8c45955 100644
--- a/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/eqeq-nullish.test.ts
@@ -1,6 +1,6 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/eqeq-nullish';
+import rule from '../../src/rules/eqeq-nullish.js';
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin-internal/tests/rules/no-dynamic-tests.test.ts b/packages/eslint-plugin-internal/tests/rules/no-dynamic-tests.test.ts
new file mode 100644
index 000000000000..dcb2ddbd007c
--- /dev/null
+++ b/packages/eslint-plugin-internal/tests/rules/no-dynamic-tests.test.ts
@@ -0,0 +1,289 @@
+import { RuleTester } from '@typescript-eslint/rule-tester';
+
+import rule from '../../src/rules/no-dynamic-tests.js';
+
+const ruleTester = new RuleTester({
+ languageOptions: {
+ parserOptions: {
+ ecmaFeatures: {},
+ ecmaVersion: 6,
+ sourceType: 'module',
+ },
+ },
+});
+
+ruleTester.run('no-dynamic-tests', rule, {
+ invalid: [
+ // Function calls in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [generateTestCases()],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [],
+ invalid: [...getInvalidCases()],
+});
+ `,
+ errors: [
+ {
+ column: 13,
+ line: 4,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Spread operator in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [...validTestCases],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [...validTestCases.map(t => t.code)],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Simple identifiers in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [testCase],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Template literals in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [\`\${getTest()}\`],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 14,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Binary expressions in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: ['test' + getSuffix()],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Conditional expressions in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [shouldTest ? 'test1' : 'test2'],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Member expressions in test arrays
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [testConfig.cases],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Object spread
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [{ ...testConfig }],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 13,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Tag
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [foo\`const x = 1;\`],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 11,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // Object Value
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [{ code: foo }],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 19,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [{ errors: [...getErrors()] }],
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 22,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ // assign directly
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: foo,
+ invalid: [],
+});
+ `,
+ errors: [
+ {
+ column: 10,
+ line: 3,
+ messageId: 'noDynamicTests',
+ },
+ ],
+ },
+ ],
+ valid: [
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: ['const x = 1;'],
+ invalid: [],
+});
+ `,
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: ['const x = 1;', 'let y = 2;'],
+ invalid: [
+ {
+ code: 'var z = 3;',
+ errors: [{ messageId: 'error' }],
+ },
+ ],
+});
+ `,
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [{ code: 'const x = 1;' }, { code: 'let y = 2;' }],
+ invalid: [],
+});
+ `,
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ valid: [noFormat\`const x = 1;\`],
+ invalid: [],
+});
+ `,
+ },
+ {
+ code: `
+ruleTester.run('test', rule, {
+ code: "import type { ValueOf } from './utils';",
+ filename: path.resolve(
+ PACKAGES_DIR,
+ 'ast-spec/src/expression/AssignmentExpression/spec.ts',
+ ),
+});
+ `,
+ },
+ ],
+});
diff --git a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts
index cee60c1a8675..3a70101eb7d5 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts
@@ -1,13 +1,14 @@
/* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/no-poorly-typed-ts-props';
-import { getFixturesRootDir } from '../RuleTester';
+import rule from '../../src/rules/no-poorly-typed-ts-props.js';
+import { getFixturesRootDir } from '../RuleTester.js';
const ruleTester = new RuleTester({
languageOptions: {
parserOptions: {
project: './tsconfig.json',
+ projectService: false,
tsconfigRootDir: getFixturesRootDir(),
},
},
diff --git a/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts b/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts
index b67fc8b64224..36b966725f79 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-relative-paths-to-internal-packages.test.ts
@@ -3,7 +3,7 @@ import path from 'node:path';
import rule, {
PACKAGES_DIR,
-} from '../../src/rules/no-relative-paths-to-internal-packages';
+} from '../../src/rules/no-relative-paths-to-internal-packages.js';
const ruleTester = new RuleTester({
languageOptions: {
diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts
index 7284c154e458..83c1f7349a8e 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts
@@ -1,6 +1,6 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/no-typescript-default-import';
+import rule from '../../src/rules/no-typescript-default-import.js';
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
index a727f98d0d61..077169eb7dde 100644
--- a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts
@@ -1,6 +1,6 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/no-typescript-estree-import';
+import rule from '../../src/rules/no-typescript-estree-import.js';
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts
index 29ee7dde5168..084eadd9b6c0 100644
--- a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts
@@ -1,12 +1,13 @@
import { RuleTester } from '@typescript-eslint/rule-tester';
-import rule from '../../src/rules/plugin-test-formatting';
-import { getFixturesRootDir } from '../RuleTester';
+import rule from '../../src/rules/plugin-test-formatting.js';
+import { getFixturesRootDir } from '../RuleTester.js';
const ruleTester = new RuleTester({
languageOptions: {
parserOptions: {
project: './tsconfig.json',
+ projectService: false,
tsconfigRootDir: getFixturesRootDir(),
},
},
diff --git a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
index c9273578ef0e..0c3ca98fbaad 100644
--- a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
+++ b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts
@@ -2,7 +2,7 @@ import { RuleTester } from '@typescript-eslint/rule-tester';
import { DefinitionType } from '@typescript-eslint/scope-manager';
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
-import rule from '../../src/rules/prefer-ast-types-enum';
+import rule from '../../src/rules/prefer-ast-types-enum.js';
const ruleTester = new RuleTester();
diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md
index 7b9fa13639b0..53995954dd83 100644
--- a/packages/eslint-plugin/CHANGELOG.md
+++ b/packages/eslint-plugin/CHANGELOG.md
@@ -1,3 +1,320 @@
+## 8.46.4 (2025-11-10)
+
+### 🩹 Fixes
+
+- **parser:** error when both `projectService` and `project` are set ([#11333](https://github.com/typescript-eslint/typescript-eslint/pull/11333))
+- **eslint-plugin:** handle override modifier in promise-function-async fixer ([#11730](https://github.com/typescript-eslint/typescript-eslint/pull/11730))
+- **eslint-plugin:** [no-deprecated] fix double-report on computed literal identifiers ([#11006](https://github.com/typescript-eslint/typescript-eslint/pull/11006), [#10958](https://github.com/typescript-eslint/typescript-eslint/issues/10958))
+
+### ❤️ Thank You
+
+- Evgeny Stepanovych @undsoft
+- Kentaro Suzuki @sushichan044
+- Maria Solano @MariaSolOs
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.3 (2025-11-03)
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [no-duplicate-enum-values] support signed numbers ([#11722](https://github.com/typescript-eslint/typescript-eslint/pull/11722), [#11723](https://github.com/typescript-eslint/typescript-eslint/pull/11723))
+- **eslint-plugin:** [no-misused-promises] expand union type to retrieve target property ([#11706](https://github.com/typescript-eslint/typescript-eslint/pull/11706))
+
+### ❤️ Thank You
+
+- Evgeny Stepanovych @undsoft
+- tao
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.2 (2025-10-20)
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [prefer-optional-chain] skip optional chaining when it could change the result ([#11702](https://github.com/typescript-eslint/typescript-eslint/pull/11702))
+
+### ❤️ Thank You
+
+- mdm317
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.1 (2025-10-13)
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [no-misused-promises] special-case `.finally` not to report when a promise returning function is provided as an argument ([#11667](https://github.com/typescript-eslint/typescript-eslint/pull/11667))
+- **eslint-plugin:** [prefer-optional-chain] include mixed "nullish comparison style" chains in checks ([#11533](https://github.com/typescript-eslint/typescript-eslint/pull/11533))
+
+### ❤️ Thank You
+
+- mdm317
+- Ronen Amiel
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.46.0 (2025-10-06)
+
+### 🚀 Features
+
+- **eslint-plugin:** [no-unsafe-member-access] add allowOptionalChaining option ([#11659](https://github.com/typescript-eslint/typescript-eslint/pull/11659))
+- **rule-schema-to-typescript-types:** clean up and make public ([#11633](https://github.com/typescript-eslint/typescript-eslint/pull/11633))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [prefer-readonly-parameter-types] ignore tagged primitives ([#11660](https://github.com/typescript-eslint/typescript-eslint/pull/11660))
+- **typescript-estree:** forbid abstract method and accessor to have implementation ([#11657](https://github.com/typescript-eslint/typescript-eslint/pull/11657))
+- **eslint-plugin:** removed error type previously deprecated ([#11674](https://github.com/typescript-eslint/typescript-eslint/pull/11674))
+- **eslint-plugin:** [no-deprecated] ignore deprecated `export import`s ([#11603](https://github.com/typescript-eslint/typescript-eslint/pull/11603))
+- **eslint-plugin:** [unbound-method] improve wording around `this: void` and binding ([#11634](https://github.com/typescript-eslint/typescript-eslint/pull/11634))
+- **rule-tester:** deprecate TestCaseError#type and LintMessage#nodeType ([#11628](https://github.com/typescript-eslint/typescript-eslint/pull/11628))
+- **eslint-plugin:** [no-floating-promises] remove excess parentheses in suggestions ([#11487](https://github.com/typescript-eslint/typescript-eslint/pull/11487))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+- Josh Goldberg ✨
+- Kirk Waiblinger @kirkwaiblinger
+- Mark de Dios @peanutenthusiast
+- Richard Torres @richardtorres314
+- Victor Genaev @mainframev
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.45.0 (2025-09-29)
+
+### 🚀 Features
+
+- **eslint-plugin:** expose rule name via RuleModule interface ([#11616](https://github.com/typescript-eslint/typescript-eslint/pull/11616))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [prefer-nullish-coalescing] ignoreBooleanCoercion should not apply to top-level ternary expressions ([#11614](https://github.com/typescript-eslint/typescript-eslint/pull/11614))
+- **eslint-plugin:** [no-base-to-string] check if superclass is ignored ([#11617](https://github.com/typescript-eslint/typescript-eslint/pull/11617))
+
+### ❤️ Thank You
+
+- mdm317
+- Moses Odutusin @thebolarin
+- Yukihiro Hasegawa @y-hsgw
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.44.1 (2025-09-22)
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [await-thenable] should not report passing values to promise aggregators which may be a promise in an array literal ([#11611](https://github.com/typescript-eslint/typescript-eslint/pull/11611))
+- **eslint-plugin:** [no-unsafe-enum-comparison] support unions of literals ([#11599](https://github.com/typescript-eslint/typescript-eslint/pull/11599))
+- **eslint-plugin:** [no-base-to-string] make ignoredTypeNames match type names without generics ([#11597](https://github.com/typescript-eslint/typescript-eslint/pull/11597))
+
+### ❤️ Thank You
+
+- Kirk Waiblinger @kirkwaiblinger
+- mdm317
+- Ronen Amiel
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.44.0 (2025-09-15)
+
+### 🚀 Features
+
+- **eslint-plugin:** [await-thenable] report invalid (non-promise) values passed to promise aggregator methods ([#11267](https://github.com/typescript-eslint/typescript-eslint/pull/11267))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [no-unnecessary-type-conversion] ignore enum members ([#11490](https://github.com/typescript-eslint/typescript-eslint/pull/11490))
+
+### ❤️ Thank You
+
+- Moses Odutusin @thebolarin
+- Ronen Amiel
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.43.0 (2025-09-08)
+
+### 🚀 Features
+
+- **typescript-estree:** disallow empty type parameter/argument lists ([#11563](https://github.com/typescript-eslint/typescript-eslint/pull/11563))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [prefer-return-this-type] don't report an error when returning a union type that includes a classType ([#11432](https://github.com/typescript-eslint/typescript-eslint/pull/11432))
+- **eslint-plugin:** [no-deprecated] should report deprecated exports and reexports ([#11359](https://github.com/typescript-eslint/typescript-eslint/pull/11359))
+- **eslint-plugin:** [no-floating-promises] allowForKnownSafeCalls now supports function names ([#11423](https://github.com/typescript-eslint/typescript-eslint/pull/11423), [#11430](https://github.com/typescript-eslint/typescript-eslint/pull/11430))
+- **eslint-plugin:** [consistent-type-exports] fix declaration shadowing ([#11457](https://github.com/typescript-eslint/typescript-eslint/pull/11457))
+- **eslint-plugin:** [no-unnecessary-type-conversion] only report ~~ on integer literal types ([#11517](https://github.com/typescript-eslint/typescript-eslint/pull/11517))
+- **scope-manager:** exclude Program from DefinitionBase node types ([#11469](https://github.com/typescript-eslint/typescript-eslint/pull/11469))
+- **eslint-plugin:** [no-non-null-assertion] do not suggest optional chain on LHS of assignment ([#11489](https://github.com/typescript-eslint/typescript-eslint/pull/11489))
+- **type-utils:** add union type support to TypeOrValueSpecifier ([#11526](https://github.com/typescript-eslint/typescript-eslint/pull/11526))
+
+### ❤️ Thank You
+
+- Dima @dbarabashh
+- Kirk Waiblinger @kirkwaiblinger
+- mdm317
+- tao
+- Victor Genaev @mainframev
+- Yukihiro Hasegawa @y-hsgw
+- 민감자(Minji Kim) @mouse0429
+- 송재욱
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.42.0 (2025-09-02)
+
+### 🩹 Fixes
+
+- **deps:** update eslint monorepo to v9.33.0 ([#11482](https://github.com/typescript-eslint/typescript-eslint/pull/11482))
+
+You can read about our [versioning strategy](https://typescript-eslint.io/users/versioning) and [releases](https://typescript-eslint.io/users/releases) on our website.
+
+## 8.41.0 (2025-08-25)
+
+### 🩹 Fixes
+
+- **deps:** update dependency prettier to v3.6.2 ([#11496](https://github.com/typescript-eslint/typescript-eslint/pull/11496))
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.40.0 (2025-08-18)
+
+### 🚀 Features
+
+- **typescript-estree:** forbid invalid keys in `EnumMember` ([#11232](https://github.com/typescript-eslint/typescript-eslint/pull/11232))
+
+### ❤️ Thank You
+
+- fisker Cheung @fisker
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.39.1 (2025-08-11)
+
+This was a version bump only for eslint-plugin to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.39.0 (2025-08-04)
+
+### 🚀 Features
+
+- **eslint-plugin:** [only-throw-error] support yield/await expressions ([#11417](https://github.com/typescript-eslint/typescript-eslint/pull/11417))
+- **eslint-plugin:** add no-unnecessary-type-conversion to strict-type-checked ruleset ([#11427](https://github.com/typescript-eslint/typescript-eslint/pull/11427))
+- update to TypeScript 5.9.2 ([#11445](https://github.com/typescript-eslint/typescript-eslint/pull/11445))
+- **eslint-plugin:** [naming-convention] add enumMember PascalCase default option ([#11127](https://github.com/typescript-eslint/typescript-eslint/pull/11127))
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [no-unsafe-assignment] add an `unsafeObjectPattern` message ([#11403](https://github.com/typescript-eslint/typescript-eslint/pull/11403))
+- **eslint-plugin:** [prefer-optional-chain] ignore `check` option for most RHS of a chain ([#11272](https://github.com/typescript-eslint/typescript-eslint/pull/11272))
+
+### ❤️ Thank You
+
+- Brad Zacher @bradzacher
+- James Garbutt @43081j
+- Kim Sang Du @developer-bandi
+- Sasha Kondrashov
+- tao
+- Younsang Na @nayounsang
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.38.0 (2025-07-21)
+
+### 🩹 Fixes
+
+- disallow extra properties in rule options ([#11397](https://github.com/typescript-eslint/typescript-eslint/pull/11397))
+- **eslint-plugin:** [consistent-generic-constructors] resolve conflict with `isolatedDeclarations` if enabled in `constructor` option ([#11351](https://github.com/typescript-eslint/typescript-eslint/pull/11351))
+
+### ❤️ Thank You
+
+- Andrew Kazakov @andreww2012
+- Younsang Na @nayounsang
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.37.0 (2025-07-14)
+
+### 🩹 Fixes
+
+- **eslint-plugin:** [unified-signatures] fix false positives for ignoreOverloadsWithDifferentJSDoc option ([#11381](https://github.com/typescript-eslint/typescript-eslint/pull/11381))
+
+### ❤️ Thank You
+
+- Yukihiro Hasegawa @y-hsgw
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.36.0 (2025-07-07)
+
+This was a version bump only for eslint-plugin to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.35.1 (2025-06-30)
+
+### 🩹 Fixes
+
+- remove prettier from eslint-plugin ([#11339](https://github.com/typescript-eslint/typescript-eslint/pull/11339))
+
+### ❤️ Thank You
+
+- Abhijeet Singh @cseas
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.35.0 (2025-06-23)
+
+### 🚀 Features
+
+- **eslint-plugin:** [no-base-to-string] add checkUnknown Option ([#11128](https://github.com/typescript-eslint/typescript-eslint/pull/11128))
+
+### ❤️ Thank You
+
+- Kim Sang Du @developer-bandi
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.34.1 (2025-06-16)
+
+This was a version bump only for eslint-plugin to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.34.0 (2025-06-09)
+
+### 🩹 Fixes
+
+- **typescript-estree:** add validation to interface extends ([#11271](https://github.com/typescript-eslint/typescript-eslint/pull/11271))
+
+### ❤️ Thank You
+
+- Tao
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.33.1 (2025-06-02)
+
+### 🩹 Fixes
+
+- exclude docs/ directory from eslint-plugin package ([#11251](https://github.com/typescript-eslint/typescript-eslint/pull/11251))
+
+### ❤️ Thank You
+
+- roottool
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
+## 8.33.0 (2025-05-26)
+
+This was a version bump only for eslint-plugin to align it with other projects, there were no code changes.
+
+You can read about our [versioning strategy](https://main--typescript-eslint.netlify.app/users/versioning) and [releases](https://main--typescript-eslint.netlify.app/users/releases) on our website.
+
## 8.32.1 (2025-05-12)
### 🩹 Fixes
diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md
index 75c5723d748a..1cb9c5435fa1 100644
--- a/packages/eslint-plugin/docs/rules/README.md
+++ b/packages/eslint-plugin/docs/rules/README.md
@@ -55,3 +55,16 @@ module.exports = {
```
[Search for `🧱 extension rule`s](?=extension#rules) in this page to see all extension rules.
+
+## Frozen Rules
+
+When rules are feature complete, they are marked as frozen (indicated with ❄️ in the documentation). This applies to standalone rules that are complete, as well as [extension rules](#extension-rules) whose underlying core ESLint rules are frozen. After that point, we expect users to use [disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) when they find an edge case that isn’t covered.
+
+When a rule is frozen, it means:
+
+- **Bug fixes**: We will still fix confirmed bugs.
+- **New ECMAScript features**: We will ensure compatibility with new ECMAScript features, meaning the rule will not break on new syntax.
+- **TypeScript support**: We will ensure compatibility with TypeScript syntax, meaning the rule will not break on TypeScript syntax and violations are appropriate for TypeScript.
+- **New options**: We will not add any new options unless an option is the only way to fix a bug or support a newly-added ECMAScript feature.
+
+If you find that a frozen rule would work better for you with a change, we recommend copying the rule source code and modifying it to fit your needs.
diff --git a/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx b/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx
index e2338747b707..0f162f5ee57f 100644
--- a/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx
+++ b/packages/eslint-plugin/docs/rules/ban-ts-comment.mdx
@@ -9,11 +9,11 @@ import TabItem from '@theme/TabItem';
>
> See **https://typescript-eslint.io/rules/ban-ts-comment** for documentation.
-TypeScript provides several directive comments that can be used to alter how it processes files.
+TypeScript provides several comment directives that can be used to alter how it processes files.
Using these to suppress TypeScript compiler errors reduces the effectiveness of TypeScript overall.
Instead, it's generally better to correct the types of code, to make directives unnecessary.
-The directive comments supported by TypeScript are:
+The comment directives supported by TypeScript are:
```ts
// @ts-expect-error
@@ -22,7 +22,7 @@ The directive comments supported by TypeScript are:
// @ts-check
```
-This rule lets you set which directive comments you want to allow in your codebase.
+This rule lets you set which comment directives you want to allow in your codebase.
## Options
diff --git a/packages/eslint-plugin/docs/rules/no-base-to-string.mdx b/packages/eslint-plugin/docs/rules/no-base-to-string.mdx
index 8097ca8b7f41..d1927bf69b5b 100644
--- a/packages/eslint-plugin/docs/rules/no-base-to-string.mdx
+++ b/packages/eslint-plugin/docs/rules/no-base-to-string.mdx
@@ -99,6 +99,17 @@ let text = `${value}`;
String(/regex/);
```
+### `checkUnknown`
+
+{/* insert option description */}
+
+The following patterns are considered incorrect with the options `{ checkUnknown: true }`:
+
+```ts option='{ "checkUnknown": true }' showPlaygroundButton
+declare const x: unknown;
+String(x);
+```
+
## When Not To Use It
If you don't mind a risk of `"[object Object]"` or incorrect type coercions in your values, then you will not need this rule.
diff --git a/packages/eslint-plugin/docs/rules/no-explicit-any.mdx b/packages/eslint-plugin/docs/rules/no-explicit-any.mdx
index f0c8c20c6dec..6b9a06f7538e 100644
--- a/packages/eslint-plugin/docs/rules/no-explicit-any.mdx
+++ b/packages/eslint-plugin/docs/rules/no-explicit-any.mdx
@@ -145,6 +145,86 @@ interface Garply {
}
```
+## Alternatives to `any`
+
+If you do know the properties that exist on an object value, it's generally best to use an `interface` or `type` to describe those properties.
+If a straightforward object type isn't sufficient, then you can choose between several strategies instead of `any`.
+The following headings describe some of the more common strategies.
+
+### `unknown`
+
+If you don't know the data shape of a value, the `unknown` type is safer than `any`.
+Like `any`, `unknown` indicates the value might be any kind of data with any properties.
+Unlike `any`, `unknown` doesn't allow arbitrary property accesses: it requires the value be narrowed to a more specific type before being used.
+See [The `unknown` type in TypeScript](https://mariusschulz.com/blog/the-unknown-type-in-typescript) for more information on `unknown`.
+
+### Index Signatures
+
+Some objects are used with arbitrary keys, especially in code that predates [`Map`s](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) and [`Set`s](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set).
+TypeScript interfaces may be given an _"index signature"_ to indicate arbitrary keys are allowed on objects.
+
+For example, this type defines an object that must have an `apple` property with a `number` value, and may have any other string keys with `number | undefined` values:
+
+```ts
+interface AllowsAnyStrings {
+ apple: number;
+ [i: string]: number | undefined;
+}
+
+let fruits: AllowsAnyStrings;
+
+fruits = { apple: 0 }; // Ok
+fruits.banana = 1; // Ok
+fruits.cherry = undefined; // Ok
+```
+
+See [What does a TypeScript index signature actually mean?](https://stackoverflow.com/questions/58458308/what-does-a-typescript-index-signature-actually-mean) for more information on index signatures.
+
+### Union Types
+
+Some values can be one of multiple types.
+TypeScript allows representing these with _"union"_ types: types that include a list of possible shapes for data.
+
+Union types are often used to describe "nullable" values: those that can either be a data type or `null` and/or `undefined`.
+For example, the following `StringLike` type describes data that is either a `string` or `undefined`:
+
+```ts
+type StringLike = string | undefined;
+
+let fruit: StringLike;
+
+fruit = 'apple'; // Ok
+fruit = undefined; // Ok
+```
+
+See [TypeScript Handbook: Everyday Types > Union Types](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types) for more information on union types.
+
+### Type Parameter Constraints
+
+"Generic" type parameters are often used to represent a value of an unknown type.
+It can be tempting to use `any` as a type parameter constraint, but this is not recommended.
+
+First, `extends any` on its own does nothing: `` is equivalent to ``.
+See [`@typescript-eslint/no-unnecessary-type-constraint`](./no-unnecessary-type-constraint.mdx) for more information.
+
+Within type parameters, `never` and `unknown` otherwise can generally be used instead.
+For example, the following code uses those two types in `AnyFunction` instead of `any`s to constrain `Callback` to any function type:
+
+```ts
+type AnyFunction = (...args: never[]) => unknown;
+
+function curry(greeter: Greeter, prefix: string) {
+ return (...args: Parameters) => `${prefix}: ${greeter(...args)}`;
+}
+
+const greet = (name: string) => `Hello, ${name}!`;
+const greetWithDate = curry(greet, 'Logged: ');
+
+greetWithDate('linter'); // => "Logged: Hello, linter!"
+```
+
+See [When to use `never` and `unknown` in TypeScript](https://blog.logrocket.com/when-to-use-never-unknown-typescript) for more information on those types.
+
## When Not To Use It
`any` is always a dangerous escape hatch.
diff --git a/packages/eslint-plugin/docs/rules/no-floating-promises.mdx b/packages/eslint-plugin/docs/rules/no-floating-promises.mdx
index 12bf7465b537..977b10b2a078 100644
--- a/packages/eslint-plugin/docs/rules/no-floating-promises.mdx
+++ b/packages/eslint-plugin/docs/rules/no-floating-promises.mdx
@@ -258,7 +258,7 @@ unsafe('...', () => {});
-```ts option='{"allowForKnownSafeCalls":[{"from":"file","name":"safe","path":"input.ts"}]}' skipValidation
+```ts option='{"allowForKnownSafeCalls":[{"from":"file","name":"safe","path":"input.ts"}]}'
declare function safe(...args: unknown[]): Promise;
safe('...', () => {});
diff --git a/packages/eslint-plugin/docs/rules/no-misused-spread.mdx b/packages/eslint-plugin/docs/rules/no-misused-spread.mdx
index 5b3320e1e314..2748d7cce73f 100644
--- a/packages/eslint-plugin/docs/rules/no-misused-spread.mdx
+++ b/packages/eslint-plugin/docs/rules/no-misused-spread.mdx
@@ -37,7 +37,7 @@ That includes the following cases:
declare const promise: Promise;
const spreadPromise = { ...promise };
-declare function getObject(): Record;
+declare function getObject(): Record;
const getObjectSpread = { ...getObject };
declare const map: Map;
@@ -64,7 +64,7 @@ const instanceSpread = { ...instance };
declare const promise: Promise;
const spreadPromise = { ...(await promise) };
-declare function getObject(): Record;
+declare function getObject(): Record;
const getObjectSpread = { ...getObject() };
declare const map: Map;
@@ -121,6 +121,19 @@ const spreadBrandedString = [...brandedString];
+#### Examples
+
+If you intentionally spread over strings, you can use `allow` to explicitly allowlist them:
+
+```ts option='{"allow":[{ "from": "lib", "name": "string" }]}'
+/* eslint @typescript-eslint/no-misused-spread: {"allow":[{ "from": "lib", "name": "string" }]} */
+declare const unbrandedString: string;
+
+const spreadUnbrandedString = [...unbrandedString];
+```
+
+See the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier) for more information.
+
## When Not To Use It
If your application intentionally works with raw data in unusual ways, such as directly manipulating class prototype chains, you might not want this rule.
diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx
index 55ed0d531a1e..ab7871fdcba8 100644
--- a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx
+++ b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.mdx
@@ -12,13 +12,6 @@ import TabItem from '@theme/TabItem';
Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary".
Conversely, any expression that always evaluates to truthy or always evaluates to falsy, as determined by the type of the expression, is considered unnecessary and will be flagged by this rule.
-The following expressions are checked:
-
-- Arguments to the `&&`, `||` and `?:` (ternary) operators
-- Conditions for `if`, `for`, `while`, and `do-while` statements
-- `case`s in `switch` statements
-- Base values of optional chain expressions
-
## Examples
diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx
index 2f1eb0edbf0f..f96138fc93eb 100644
--- a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx
+++ b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.mdx
@@ -65,6 +65,43 @@ arr[idx++];
+## Options
+
+### `allowOptionalChaining`
+
+{/* insert option description */}
+
+Examples of code for this rule with `{ allowOptionalChaining: true }`:
+
+
+
+
+```ts
+declare const outer: any;
+
+outer.inner;
+outer.middle.inner;
+```
+
+
+
+
+```ts option='{ "allowOptionalChaining": true }'
+declare const outer: any;
+
+outer?.inner;
+outer?.middle?.inner;
+```
+
+
+
+
+:::caution
+We only recommend using `allowOptionalChaining` to help transition an existing project towards fully enabling `no-unsafe-member-access`.
+Optional chaining makes it safer than normal property accesses in that you won't get a runtime error if the parent value is `null` or `undefined`.
+However, it still results in an `any`-typed value, which is unsafe.
+:::
+
## When Not To Use It
If your codebase has many existing `any`s or areas of unsafe code, it may be difficult to enable this rule.
diff --git a/packages/eslint-plugin/docs/rules/no-unused-vars.mdx b/packages/eslint-plugin/docs/rules/no-unused-vars.mdx
index 461cf3d93817..ea0a336a011f 100644
--- a/packages/eslint-plugin/docs/rules/no-unused-vars.mdx
+++ b/packages/eslint-plugin/docs/rules/no-unused-vars.mdx
@@ -118,3 +118,19 @@ export interface Box {
If you find yourself writing runtime values only for types, consider refactoring your code to declare types directly.
+
+### Why are variables reported as unused despite being referenced by @link in JSDoc?
+
+JSDoc references are not supported by typescript-eslint.
+You can use a rule such as [`jsdoc/no-undefined-types`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/no-undefined-types.md) to resolve variables as used in JSDoc comments.
+
+```ts
+import type { Box } from './Box';
+// ~~~
+// 'Box' is defined but never used.
+
+/**
+ * @see {@link Box}
+ */
+export function getBox() {}
+```
diff --git a/packages/eslint-plugin/docs/rules/only-throw-error.mdx b/packages/eslint-plugin/docs/rules/only-throw-error.mdx
index e30f67a0869b..f3b97a91a625 100644
--- a/packages/eslint-plugin/docs/rules/only-throw-error.mdx
+++ b/packages/eslint-plugin/docs/rules/only-throw-error.mdx
@@ -23,7 +23,7 @@ The new name is a drop-in replacement with identical functionality.
## Examples
-This rule is aimed at maintaining consistency when throwing exception by disallowing to throw literals and other expressions which cannot possibly be an `Error` object.
+This rule is aimed at maintaining consistency when throwing exceptions by disallowing throwing values that are not `Error` objects.
@@ -35,26 +35,20 @@ throw 0;
throw undefined;
-throw null;
-
-const err = new Error();
-throw 'an ' + err;
-
-const err = new Error();
-throw `${err}`;
-
-const err = '';
-throw err;
-
-function getError() {
+function getErrorString(): string {
return '';
}
-throw getError();
+throw getErrorString();
const foo = {
- bar: '',
+ bar: 'error string',
};
throw foo.bar;
+
+class SomeClass {
+ // ...
+}
+throw new SomeClass();
```
@@ -68,15 +62,6 @@ throw new Error('error');
const e = new Error('error');
throw e;
-try {
- throw new Error('error');
-} catch (e) {
- throw e;
-}
-
-const err = new Error();
-throw err;
-
function getError() {
return new Error();
}
@@ -108,16 +93,16 @@ interface Options {
allow?: (
| {
from: 'file';
- name: [string, ...string[]] | string;
+ name: string[] | string;
path?: string;
}
| {
from: 'lib';
- name: [string, ...string[]] | string;
+ name: string[] | string;
}
| {
from: 'package';
- name: [string, ...string[]] | string;
+ name: string[] | string;
package: string;
}
| string
@@ -141,10 +126,126 @@ interface Options {
const defaultOptions: Options = {
allow: [],
- allowRethrowing: false,
+ allowRethrowing: true,
allowThrowingAny: true,
allowThrowingUnknown: true,
};
```
+### allowThrowingAny
+
+When set to `true`, this option allows throwing values typed as `any`.
+
+Examples of **correct** code with `{ allowThrowingAny: true }`:
+
+```ts option='{ "allowThrowingAny": true }' showPlaygroundButton
+function throwAny(value: any) {
+ throw value;
+}
+```
+
+### allowThrowingUnknown
+
+When set to `true`, this option allows throwing values typed as `unknown`.
+
+Examples of **correct** code with `{ allowThrowingUnknown: true }`:
+
+```ts option='{ "allowThrowingUnknown": true }' showPlaygroundButton
+function throwUnknown(value: unknown) {
+ throw value;
+}
+```
+
+### allowRethrowing
+
+When set to `true`, this option allows throwing caught values.
+This is intended to be used in order to make patterns involving rethrowing exceptions less painful for users who set `allowThrowingAny`/`allowThrowingUnknown` to `false`.
+
+Examples of **correct** code with `{ allowRethrowing: true, allowThrowingAny: false, allowThrowingUnknown: false }`:
+
+```ts option='{ "allowRethrowing": true, "allowThrowingAny": false, "allowThrowingUnknown": false }' showPlaygroundButton
+declare function mightThrow(): void;
+declare class SomeSpecificError extends Error {
+ // ...
+}
+
+function foo() {
+ try {
+ mightThrow();
+ } catch (e) {
+ if (e instanceof SomeSpecificError) {
+ // handle specific error ...
+ return;
+ }
+
+ // unexpected error that we shouldn't catch.
+ throw e;
+ }
+}
+
+declare function mightReject(): Promise;
+
+mightReject().catch(e => {
+ if (e instanceof SomeSpecificError) {
+ // handle specific error ...
+ return;
+ }
+
+ // unexpected error that we can't handle
+ throw e;
+});
+
+declare function log(message: string): void;
+
+function bar() {
+ log('starting bar()');
+ let wasError = false;
+ try {
+ // ...
+ } catch (e) {
+ wasError = true;
+ throw e;
+ } finally {
+ log(`completed bar() ${wasError ? 'with error' : 'successfully'}`);
+ }
+}
+```
+
+:::note
+
+While it makes sense to rethrow errors in some cases, it is likely more common that one would want to create a new `Error` and set its [`cause`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/cause) appropriately.
+
+```ts
+function foo() {
+ try {
+ // ...
+ } catch (e) {
+ throw new Error('Could not complete foo()', { cause: e });
+ }
+}
+```
+
+:::
+
+### allow
+
+This option takes the shared [`TypeOrValueSpecifier` format](/packages/type-utils/type-or-value-specifier) to allow throwing values that are not `Error` objects.
+While we strongly recommend that you only create custom error classes that extend `Error`, this option can be useful for throwing errors defined by libraries that do not follow this convention.
+
+Examples of code for this rule with:
+
+```jsonc
+{
+ "allow": [{ "from": "file", "name": "CustomError" }],
+}
+```
+
+```ts option='{ "allow": [{ "from": "file", "name": "CustomError" }] }' showPlaygroundButton
+class CustomError /* does NOT extend Error */ {
+ // ...
+}
+
+throw new CustomError();
+```
+
{/* Intentionally Omitted: When Not To Use It */}
diff --git a/packages/eslint-plugin/docs/rules/prefer-for-of.mdx b/packages/eslint-plugin/docs/rules/prefer-for-of.mdx
index 0399c781ddd7..668023249c9c 100644
--- a/packages/eslint-plugin/docs/rules/prefer-for-of.mdx
+++ b/packages/eslint-plugin/docs/rules/prefer-for-of.mdx
@@ -47,4 +47,24 @@ for (let i = 0; i < array.length; i++) {
-{/* Intentionally Omitted: When Not To Use It */}
+## DOM Elements
+
+By default, TypeScript's type checking only allows `for-of` loops over DOM iterables such as `HTMLCollectionOf` when the `dom.iterable` `lib` option is enabled.
+If you are using this rule in a project that works with DOM elements, be sure to enable `dom.iterable` in your TSConfig `lib`.
+See [aka.ms/tsconfig#lib](http://aka.ms/tsconfig#lib) for more information.
+
+```json
+{
+ "compilerOptions": {
+ "strict": true,
+ "lib": ["esnext", "dom", "dom.iterable"]
+ }
+}
+```
+
+## When Not To Use It
+
+Note that this rule does not use type information to determine whether iterated elements are arrays.
+It only checks if a `.length` property is used in a loop.
+If your project loops over objects that happen to have `.length`, this rule may report false positives.
+You might consider using [ESLint disable comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments-1) for those specific situations instead of completely disabling this rule.
diff --git a/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx b/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx
index 777c80068e69..e63c2d819939 100644
--- a/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx
+++ b/packages/eslint-plugin/docs/rules/prefer-optional-chain.mdx
@@ -35,12 +35,7 @@ foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method();
!foo || !foo.bar || !foo.bar.baz || !foo.bar.baz();
// this rule also supports converting chained strict nullish checks:
-foo &&
- foo.a != null &&
- foo.a.b !== null &&
- foo.a.b.c != undefined &&
- foo.a.b.c.d !== undefined &&
- foo.a.b.c.d.e;
+foo.a !== null && foo.a !== undefined && foo.a.b;
```
@@ -56,6 +51,8 @@ foo?.a?.b?.c?.d?.e;
!foo?.bar;
!foo?.[bar];
!foo?.bar?.baz?.();
+
+foo?.a != null;
```
diff --git a/packages/eslint-plugin/docs/rules/typedef.mdx b/packages/eslint-plugin/docs/rules/typedef.mdx
index 8af5c045244a..827936d63329 100644
--- a/packages/eslint-plugin/docs/rules/typedef.mdx
+++ b/packages/eslint-plugin/docs/rules/typedef.mdx
@@ -9,6 +9,18 @@ import TabItem from '@theme/TabItem';
>
> See **https://typescript-eslint.io/rules/typedef** for documentation.
+:::caution
+
+This is an old, deprecated rule.
+It will be removed in a future major version of typescript-eslint.
+
+Requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability.
+TypeScript is often better at inferring types than easily written type annotations would allow.
+
+**Instead of enabling `typedef`, it is generally recommended to use the `--noImplicitAny` and `--strictPropertyInitialization` compiler options to enforce type annotations only when useful.**
+
+:::
+
TypeScript cannot always infer types for all places in code.
Some locations require type annotations for their types to be inferred.
@@ -30,15 +42,6 @@ class ContainsText {
> To enforce type definitions existing on call signatures, use [`explicit-function-return-type`](./explicit-function-return-type.mdx), or [`explicit-module-boundary-types`](./explicit-module-boundary-types.mdx).
-:::caution
-
-Requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability.
-TypeScript is often better at inferring types than easily written type annotations would allow.
-
-**Instead of enabling `typedef`, it is generally recommended to use the `--noImplicitAny` and `--strictPropertyInitialization` compiler options to enforce type annotations only when useful.**
-
-:::
-
## Options
For example, with the following configuration:
diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json
index c27d09067eab..14aab4ecfd9b 100644
--- a/packages/eslint-plugin/package.json
+++ b/packages/eslint-plugin/package.json
@@ -1,16 +1,15 @@
{
"name": "@typescript-eslint/eslint-plugin",
- "version": "8.32.1",
+ "version": "8.46.4",
"description": "TypeScript plugin for ESLint",
"files": [
"dist",
"!*.tsbuildinfo",
- "docs",
"index.d.ts",
"raw-plugin.d.ts",
"rules.d.ts",
"package.json",
- "README.md",
+ "./README.md",
"LICENSE"
],
"type": "commonjs",
@@ -49,22 +48,21 @@
"typescript"
],
"scripts": {
- "build": "tsc -b tsconfig.build.json",
+ "build": "yarn run -BT nx build",
"clean": "rimraf dist/ coverage/",
- "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
- "generate:breaking-changes": "tsx tools/generate-breaking-changes.mts",
- "generate:configs": "npx nx generate-configs repo",
- "lint": "npx nx lint",
- "test": "vitest --run --config=$INIT_CWD/vitest.config.mts",
- "test-single": "vitest --run --config=$INIT_CWD/vitest.config.mts --no-coverage",
- "check-types": "npx nx typecheck"
+ "format": "yarn run -T format",
+ "generate-breaking-changes": "yarn run -BT nx generate-breaking-changes",
+ "generate-configs": "yarn run -BT nx generate-configs repo",
+ "lint": "yarn run -BT nx lint",
+ "test": "yarn run -BT nx test",
+ "typecheck": "yarn run -BT nx typecheck"
},
"dependencies": {
"@eslint-community/regexpp": "^4.10.0",
- "@typescript-eslint/scope-manager": "8.32.1",
- "@typescript-eslint/type-utils": "8.32.1",
- "@typescript-eslint/utils": "8.32.1",
- "@typescript-eslint/visitor-keys": "8.32.1",
+ "@typescript-eslint/scope-manager": "8.46.4",
+ "@typescript-eslint/type-utils": "8.46.4",
+ "@typescript-eslint/utils": "8.46.4",
+ "@typescript-eslint/visitor-keys": "8.46.4",
"graphemer": "^1.4.0",
"ignore": "^7.0.0",
"natural-compare": "^1.4.0",
@@ -73,8 +71,8 @@
"devDependencies": {
"@types/mdast": "^4.0.3",
"@types/natural-compare": "*",
- "@typescript-eslint/rule-schema-to-typescript-types": "8.32.1",
- "@typescript-eslint/rule-tester": "8.32.1",
+ "@typescript-eslint/rule-schema-to-typescript-types": "8.46.4",
+ "@typescript-eslint/rule-tester": "8.46.4",
"@vitest/coverage-v8": "^3.1.3",
"ajv": "^6.12.6",
"cross-fetch": "*",
@@ -85,7 +83,7 @@
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-mdx": "^3.0.0",
"micromark-extension-mdxjs": "^3.0.0",
- "prettier": "^3.2.5",
+ "prettier": "3.6.2",
"rimraf": "*",
"title-case": "^4.0.0",
"tsx": "*",
@@ -94,12 +92,32 @@
"vitest": "^3.1.3"
},
"peerDependencies": {
- "@typescript-eslint/parser": "^8.0.0 || ^8.0.0-alpha.0",
+ "@typescript-eslint/parser": "^8.46.4",
"eslint": "^8.57.0 || ^9.0.0",
- "typescript": ">=4.8.4 <5.9.0"
+ "typescript": ">=4.8.4 <6.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
+ },
+ "nx": {
+ "name": "eslint-plugin",
+ "includedScripts": [
+ "clean"
+ ],
+ "targets": {
+ "generate-breaking-changes": {
+ "command": "tsx tools/generate-breaking-changes.mts",
+ "options": {
+ "cwd": "{projectRoot}"
+ },
+ "dependsOn": [
+ "type-utils:build"
+ ]
+ },
+ "lint": {
+ "command": "eslint"
+ }
+ }
}
}
diff --git a/packages/eslint-plugin/project.json b/packages/eslint-plugin/project.json
deleted file mode 100644
index 3dbae67d7435..000000000000
--- a/packages/eslint-plugin/project.json
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- "name": "eslint-plugin",
- "$schema": "../../node_modules/nx/schemas/project-schema.json",
- "projectType": "library",
- "root": "packages/eslint-plugin",
- "sourceRoot": "packages/eslint-plugin/src",
- "targets": {
- "lint": {
- "executor": "@nx/eslint:lint"
- },
- "test-single": {
- "executor": "@nx/vite:test",
- "cache": false,
- "options": {
- "coverage": false
- }
- },
- "test": {
- "executor": "@nx/vite:test"
- },
- "generate-breaking-changes": {
- "executor": "nx:run-script",
- "options": {
- "script": "generate:breaking-changes"
- }
- }
- }
-}
diff --git a/packages/eslint-plugin/src/configs/eslintrc/all.ts b/packages/eslint-plugin/src/configs/eslintrc/all.ts
index 3d25e79e33db..34f7fd540450 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/all.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/all.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
@@ -156,7 +156,6 @@ export = {
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
- '@typescript-eslint/typedef': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
diff --git a/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts
index 9dd6c95c929e..6853a151722d 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/disable-type-checked.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts b/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts
index 0936657b5d23..ba352ceb281b 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked-only.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts
index 73eda5db7b43..bae9c46a5c3f 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/recommended-type-checked.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/eslintrc/recommended.ts b/packages/eslint-plugin/src/configs/eslintrc/recommended.ts
index c5476c5ec6e0..8b3f99dbfd59 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/recommended.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/recommended.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts
index 00e4ca12f8a4..a2b5b457d01e 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked-only.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
@@ -30,6 +30,7 @@ export = {
'@typescript-eslint/no-unnecessary-template-expression': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
+ '@typescript-eslint/no-unnecessary-type-conversion': 'error',
'@typescript-eslint/no-unnecessary-type-parameters': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
diff --git a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts
index 43d1df44b53b..ec1523d8b48e 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/strict-type-checked.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
@@ -51,6 +51,7 @@ export = {
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
+ '@typescript-eslint/no-unnecessary-type-conversion': 'error',
'@typescript-eslint/no-unnecessary-type-parameters': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
diff --git a/packages/eslint-plugin/src/configs/eslintrc/strict.ts b/packages/eslint-plugin/src/configs/eslintrc/strict.ts
index 1677fdabffb6..9e081af8a85e 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/strict.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/strict.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts
index d3cbbfc3ea9a..eb4765a87b3a 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked-only.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts
index b77f94794f2f..7a6759d8032d 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/stylistic-type-checked.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts b/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts
index fe4a00ffe7c1..e81313ee0185 100644
--- a/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts
+++ b/packages/eslint-plugin/src/configs/eslintrc/stylistic.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { ClassicConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/flat/all.ts b/packages/eslint-plugin/src/configs/flat/all.ts
index dc40d391e4fd..777028d8580c 100644
--- a/packages/eslint-plugin/src/configs/flat/all.ts
+++ b/packages/eslint-plugin/src/configs/flat/all.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
@@ -170,7 +170,6 @@ export default (
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'error',
'@typescript-eslint/triple-slash-reference': 'error',
- '@typescript-eslint/typedef': 'error',
'@typescript-eslint/unbound-method': 'error',
'@typescript-eslint/unified-signatures': 'error',
'@typescript-eslint/use-unknown-in-catch-callback-variable': 'error',
diff --git a/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts b/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts
index 15c5bb0e3dcf..5a48e1722775 100644
--- a/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts
+++ b/packages/eslint-plugin/src/configs/flat/disable-type-checked.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/flat/recommended-type-checked-only.ts b/packages/eslint-plugin/src/configs/flat/recommended-type-checked-only.ts
index 0e417f24e0a5..fc985169efc6 100644
--- a/packages/eslint-plugin/src/configs/flat/recommended-type-checked-only.ts
+++ b/packages/eslint-plugin/src/configs/flat/recommended-type-checked-only.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/flat/recommended-type-checked.ts b/packages/eslint-plugin/src/configs/flat/recommended-type-checked.ts
index bb46e4cb4238..c92de2abf739 100644
--- a/packages/eslint-plugin/src/configs/flat/recommended-type-checked.ts
+++ b/packages/eslint-plugin/src/configs/flat/recommended-type-checked.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/flat/recommended.ts b/packages/eslint-plugin/src/configs/flat/recommended.ts
index f94d6606637d..51f845362835 100644
--- a/packages/eslint-plugin/src/configs/flat/recommended.ts
+++ b/packages/eslint-plugin/src/configs/flat/recommended.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts b/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts
index 4d424ec0968f..043f1aad0cd5 100644
--- a/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts
+++ b/packages/eslint-plugin/src/configs/flat/strict-type-checked-only.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
@@ -43,6 +43,7 @@ export default (
'@typescript-eslint/no-unnecessary-template-expression': 'error',
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
+ '@typescript-eslint/no-unnecessary-type-conversion': 'error',
'@typescript-eslint/no-unnecessary-type-parameters': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
diff --git a/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts b/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts
index 8753687ce006..b3c0a2391178 100644
--- a/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts
+++ b/packages/eslint-plugin/src/configs/flat/strict-type-checked.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
@@ -64,6 +64,7 @@ export default (
'@typescript-eslint/no-unnecessary-type-arguments': 'error',
'@typescript-eslint/no-unnecessary-type-assertion': 'error',
'@typescript-eslint/no-unnecessary-type-constraint': 'error',
+ '@typescript-eslint/no-unnecessary-type-conversion': 'error',
'@typescript-eslint/no-unnecessary-type-parameters': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
diff --git a/packages/eslint-plugin/src/configs/flat/strict.ts b/packages/eslint-plugin/src/configs/flat/strict.ts
index 0afa85b9f088..0d942ad5b86b 100644
--- a/packages/eslint-plugin/src/configs/flat/strict.ts
+++ b/packages/eslint-plugin/src/configs/flat/strict.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts
index 2c132123f0ba..cc8a23f738ea 100644
--- a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts
+++ b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked-only.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts
index 22113f880802..c3b76192bb57 100644
--- a/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts
+++ b/packages/eslint-plugin/src/configs/flat/stylistic-type-checked.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/configs/flat/stylistic.ts b/packages/eslint-plugin/src/configs/flat/stylistic.ts
index 26771ce80895..b336aeebcfe8 100644
--- a/packages/eslint-plugin/src/configs/flat/stylistic.ts
+++ b/packages/eslint-plugin/src/configs/flat/stylistic.ts
@@ -3,7 +3,7 @@
// SEE https://typescript-eslint.io/users/configs
//
// For developers working in the typescript-eslint monorepo:
-// You can regenerate it using `yarn generate:configs`
+// You can regenerate it using `yarn generate-configs`
import type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts
index 2375138d17fc..f53b61ce5bbe 100644
--- a/packages/eslint-plugin/src/rules/array-type.ts
+++ b/packages/eslint-plugin/src/rules/array-type.ts
@@ -242,7 +242,7 @@ export default createRule({
? 'errorStringArraySimpleReadonly'
: 'errorStringArraySimple';
- if (!typeParams || typeParams.length === 0) {
+ if (!typeParams) {
// Create an 'any' array
context.report({
node,
diff --git a/packages/eslint-plugin/src/rules/await-thenable.ts b/packages/eslint-plugin/src/rules/await-thenable.ts
index 2ba4efbd0b06..70c87cc5d918 100644
--- a/packages/eslint-plugin/src/rules/await-thenable.ts
+++ b/packages/eslint-plugin/src/rules/await-thenable.ts
@@ -1,10 +1,13 @@
-import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
+import type { TSESLint } from '@typescript-eslint/utils';
+import type * as ts from 'typescript';
+import { TSESTree } from '@typescript-eslint/utils';
import * as tsutils from 'ts-api-utils';
import {
Awaitable,
createRule,
+ getConstrainedTypeAtLocation,
getFixOrSuggest,
getParserServices,
isAwaitKeyword,
@@ -14,12 +17,14 @@ import {
NullThrowsReasons,
} from '../util';
import { getForStatementHeadLoc } from '../util/getForStatementHeadLoc';
+import { isPromiseAggregatorMethod } from '../util/isPromiseAggregatorMethod';
export type MessageId =
| 'await'
| 'awaitUsingOfNonAsyncDisposable'
| 'convertToOrdinaryFor'
| 'forAwaitOfNonAsyncIterable'
+ | 'invalidPromiseAggregatorInput'
| 'removeAwait';
export default createRule<[], MessageId>({
@@ -39,6 +44,8 @@ export default createRule<[], MessageId>({
convertToOrdinaryFor: 'Convert to an ordinary `for...of` loop.',
forAwaitOfNonAsyncIterable:
'Unexpected `for await...of` of a value that is not async iterable.',
+ invalidPromiseAggregatorInput:
+ 'Unexpected iterable of non-Promise (non-"Thenable") values passed to promise aggregator.',
removeAwait: 'Remove unnecessary `await`.',
},
schema: [],
@@ -84,6 +91,53 @@ export default createRule<[], MessageId>({
}
},
+ CallExpression(node: TSESTree.CallExpression): void {
+ if (!isPromiseAggregatorMethod(context, services, node)) {
+ return;
+ }
+
+ const argument = node.arguments.at(0);
+
+ if (argument == null) {
+ return;
+ }
+
+ if (argument.type === TSESTree.AST_NODE_TYPES.ArrayExpression) {
+ for (const element of argument.elements) {
+ if (element == null) {
+ continue;
+ }
+
+ const type = getConstrainedTypeAtLocation(services, element);
+ const tsNode = services.esTreeNodeToTSNodeMap.get(element);
+
+ if (isAlwaysNonAwaitableType(type, tsNode, checker)) {
+ context.report({
+ node: element,
+ messageId: 'invalidPromiseAggregatorInput',
+ });
+ }
+ }
+
+ return;
+ }
+
+ const type = getConstrainedTypeAtLocation(services, argument);
+
+ if (
+ isInvalidPromiseAggregatorInput(
+ checker,
+ services.esTreeNodeToTSNodeMap.get(argument),
+ type,
+ )
+ ) {
+ context.report({
+ node: argument,
+ messageId: 'invalidPromiseAggregatorInput',
+ });
+ }
+ },
+
'ForOfStatement[await=true]'(node: TSESTree.ForOfStatement): void {
const type = services.getTypeAtLocation(node.right);
if (isTypeAnyType(type)) {
@@ -176,3 +230,88 @@ export default createRule<[], MessageId>({
};
},
});
+
+function isInvalidPromiseAggregatorInput(
+ checker: ts.TypeChecker,
+ node: ts.Node,
+ type: ts.Type,
+): boolean {
+ // non array/tuple/iterable types already show up as a type error
+ if (!isIterable(type, checker)) {
+ return false;
+ }
+
+ for (const part of tsutils.unionConstituents(type)) {
+ const valueTypes = getValueTypesOfArrayLike(part, checker);
+
+ if (valueTypes != null) {
+ for (const typeArgument of valueTypes) {
+ if (containsNonAwaitableType(typeArgument, node, checker)) {
+ return true;
+ }
+ }
+ }
+ }
+
+ return false;
+}
+
+function getValueTypesOfArrayLike(
+ type: ts.Type,
+ checker: ts.TypeChecker,
+): readonly ts.Type[] | null {
+ if (checker.isTupleType(type)) {
+ return checker.getTypeArguments(type);
+ }
+
+ if (checker.isArrayLikeType(type)) {
+ return [
+ nullThrows(
+ type.getNumberIndexType(),
+ 'number index type should exist on an array-like',
+ ),
+ ];
+ }
+
+ // `Iterable<...>`
+ if (tsutils.isTypeReference(type)) {
+ return checker.getTypeArguments(type).slice(0, 1);
+ }
+
+ return null;
+}
+
+function isAlwaysNonAwaitableType(
+ type: ts.Type,
+ node: ts.Node,
+ checker: ts.TypeChecker,
+): boolean {
+ return tsutils
+ .unionConstituents(type)
+ .every(
+ typeArgumentPart =>
+ needsToBeAwaited(checker, node, typeArgumentPart) === Awaitable.Never,
+ );
+}
+
+function containsNonAwaitableType(
+ type: ts.Type,
+ node: ts.Node,
+ checker: ts.TypeChecker,
+): boolean {
+ return tsutils
+ .unionConstituents(type)
+ .some(
+ typeArgumentPart =>
+ needsToBeAwaited(checker, node, typeArgumentPart) === Awaitable.Never,
+ );
+}
+
+function isIterable(type: ts.Type, checker: ts.TypeChecker): boolean {
+ return tsutils
+ .unionConstituents(type)
+ .every(
+ part =>
+ !!tsutils.getWellKnownSymbolPropertyOfType(part, 'iterator', checker),
+ );
+}
diff --git a/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/packages/eslint-plugin/src/rules/ban-ts-comment.ts
index d041e34266af..7cd707ed742b 100644
--- a/packages/eslint-plugin/src/rules/ban-ts-comment.ts
+++ b/packages/eslint-plugin/src/rules/ban-ts-comment.ts
@@ -86,14 +86,29 @@ export default createRule({
properties: {
minimumDescriptionLength: {
type: 'number',
- default: defaultMinimumDescriptionLength,
description:
'A minimum character length for descriptions when `allow-with-description` is enabled.',
},
- 'ts-check': { $ref: '#/items/0/$defs/directiveConfigSchema' },
- 'ts-expect-error': { $ref: '#/items/0/$defs/directiveConfigSchema' },
- 'ts-ignore': { $ref: '#/items/0/$defs/directiveConfigSchema' },
- 'ts-nocheck': { $ref: '#/items/0/$defs/directiveConfigSchema' },
+ 'ts-check': {
+ $ref: '#/items/0/$defs/directiveConfigSchema',
+ description:
+ 'Whether allow ts-check directives, and with which restrictions.',
+ },
+ 'ts-expect-error': {
+ $ref: '#/items/0/$defs/directiveConfigSchema',
+ description:
+ 'Whether and when expect-error directives, and with which restrictions.',
+ },
+ 'ts-ignore': {
+ $ref: '#/items/0/$defs/directiveConfigSchema',
+ description:
+ 'Whether allow ts-ignore directives, and with which restrictions.',
+ },
+ 'ts-nocheck': {
+ $ref: '#/items/0/$defs/directiveConfigSchema',
+ description:
+ 'Whether allow ts-nocheck directives, and with which restrictions.',
+ },
},
},
],
diff --git a/packages/eslint-plugin/src/rules/class-methods-use-this.ts b/packages/eslint-plugin/src/rules/class-methods-use-this.ts
index 773a658ef133..f0757f628af1 100644
--- a/packages/eslint-plugin/src/rules/class-methods-use-this.ts
+++ b/packages/eslint-plugin/src/rules/class-methods-use-this.ts
@@ -38,7 +38,6 @@ export default createRule({
properties: {
enforceForClassFields: {
type: 'boolean',
- default: true,
description:
'Enforces that functions used as instance field initializers utilize `this`.',
},
diff --git a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts
index f2a4808d25dd..a26f1422460e 100644
--- a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts
+++ b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts
@@ -123,7 +123,8 @@ export default createRule({
return;
}
- if (lhs?.typeArguments && !rhs.typeArguments) {
+ const isolatedDeclarations = context.parserOptions.isolatedDeclarations;
+ if (!isolatedDeclarations && lhs?.typeArguments && !rhs.typeArguments) {
const hasParens =
context.sourceCode.getTokenAfter(rhs.callee)?.value === '(';
const extraComments = new Set(
diff --git a/packages/eslint-plugin/src/rules/consistent-type-exports.ts b/packages/eslint-plugin/src/rules/consistent-type-exports.ts
index 324a622255d7..f70d59618514 100644
--- a/packages/eslint-plugin/src/rules/consistent-type-exports.ts
+++ b/packages/eslint-plugin/src/rules/consistent-type-exports.ts
@@ -1,7 +1,6 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils';
-import * as tsutils from 'ts-api-utils';
import * as ts from 'typescript';
import {
@@ -91,22 +90,18 @@ export default createRule({
function isSymbolTypeBased(
symbol: ts.Symbol | undefined,
): boolean | undefined {
- if (!symbol) {
- return undefined;
+ while (symbol && symbol.flags & ts.SymbolFlags.Alias) {
+ symbol = checker.getAliasedSymbol(symbol);
+ if (
+ symbol.getDeclarations()?.find(ts.isTypeOnlyImportOrExportDeclaration)
+ ) {
+ return true;
+ }
}
-
- const aliasedSymbol = tsutils.isSymbolFlagSet(
- symbol,
- ts.SymbolFlags.Alias,
- )
- ? checker.getAliasedSymbol(symbol)
- : symbol;
-
- if (checker.isUnknownSymbol(aliasedSymbol)) {
+ if (!symbol || checker.isUnknownSymbol(symbol)) {
return undefined;
}
-
- return !(aliasedSymbol.flags & ts.SymbolFlags.Value);
+ return !(symbol.flags & ts.SymbolFlags.Value);
}
return {
diff --git a/packages/eslint-plugin/src/rules/default-param-last.ts b/packages/eslint-plugin/src/rules/default-param-last.ts
index 1d120720d26c..edfa85842df8 100644
--- a/packages/eslint-plugin/src/rules/default-param-last.ts
+++ b/packages/eslint-plugin/src/rules/default-param-last.ts
@@ -11,6 +11,7 @@ export default createRule({
docs: {
description: 'Enforce default parameters to be last',
extendsBaseRule: true,
+ frozen: true,
},
messages: {
shouldBeLast: 'Default parameters should be last.',
diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts
index 69d53170c70e..98caa79f7328 100644
--- a/packages/eslint-plugin/src/rules/dot-notation.ts
+++ b/packages/eslint-plugin/src/rules/dot-notation.ts
@@ -35,6 +35,7 @@ export default createRule({
docs: {
description: 'Enforce dot notation whenever possible',
extendsBaseRule: true,
+ frozen: true,
recommended: 'stylistic',
requiresTypeChecking: true,
},
@@ -48,29 +49,24 @@ export default createRule({
properties: {
allowIndexSignaturePropertyAccess: {
type: 'boolean',
- default: false,
description:
'Whether to allow accessing properties matching an index signature with array notation.',
},
allowKeywords: {
type: 'boolean',
- default: true,
description: 'Whether to allow keywords such as ["class"]`.',
},
allowPattern: {
type: 'string',
- default: '',
description: 'Regular expression of names to allow.',
},
allowPrivateClassPropertyAccess: {
type: 'boolean',
- default: false,
description:
'Whether to allow accessing class members marked as `private` with array notation.',
},
allowProtectedClassPropertyAccess: {
type: 'boolean',
- default: false,
description:
'Whether to allow accessing class members marked as `protected` with array notation.',
},
diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
index a7c8b991ed53..d1b6f8ea3422 100644
--- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
+++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts
@@ -100,13 +100,31 @@ export default createRule({
description:
'Changes to required accessibility modifiers for specific kinds of class members.',
properties: {
- accessors: { $ref: '#/items/0/$defs/accessibilityLevel' },
- constructors: { $ref: '#/items/0/$defs/accessibilityLevel' },
- methods: { $ref: '#/items/0/$defs/accessibilityLevel' },
+ accessors: {
+ $ref: '#/items/0/$defs/accessibilityLevel',
+ description:
+ 'Which member accessibility modifier requirements to apply for accessors.',
+ },
+ constructors: {
+ $ref: '#/items/0/$defs/accessibilityLevel',
+ description:
+ 'Which member accessibility modifier requirements to apply for constructors.',
+ },
+ methods: {
+ $ref: '#/items/0/$defs/accessibilityLevel',
+ description:
+ 'Which member accessibility modifier requirements to apply for methods.',
+ },
parameterProperties: {
$ref: '#/items/0/$defs/accessibilityLevel',
+ description:
+ 'Which member accessibility modifier requirements to apply for parameterProperties.',
+ },
+ properties: {
+ $ref: '#/items/0/$defs/accessibilityLevel',
+ description:
+ 'Which member accessibility modifier requirements to apply for properties.',
},
- properties: { $ref: '#/items/0/$defs/accessibilityLevel' },
},
},
},
@@ -214,14 +232,14 @@ export default createRule({
token.value === 'public'
) {
keywordRange = structuredClone(token.range);
- const commensAfterPublicKeyword =
+ const commentsAfterPublicKeyword =
context.sourceCode.getCommentsAfter(token);
- if (commensAfterPublicKeyword.length) {
+ if (commentsAfterPublicKeyword.length) {
// public /* Hi there! */ static foo()
// ^^^^^^^
rangeToRemove = [
token.range[0],
- commensAfterPublicKeyword[0].range[0],
+ commentsAfterPublicKeyword[0].range[0],
];
break;
} else {
diff --git a/packages/eslint-plugin/src/rules/init-declarations.ts b/packages/eslint-plugin/src/rules/init-declarations.ts
index 16b3f87e713c..fafc9a404f12 100644
--- a/packages/eslint-plugin/src/rules/init-declarations.ts
+++ b/packages/eslint-plugin/src/rules/init-declarations.ts
@@ -24,6 +24,7 @@ export default createRule({
description:
'Require or disallow initialization in variable declarations',
extendsBaseRule: true,
+ frozen: true,
},
hasSuggestions: baseRule.meta.hasSuggestions,
messages: baseRule.meta.messages,
diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts
index 7ae9ec7627cf..e0d1d387baed 100644
--- a/packages/eslint-plugin/src/rules/member-ordering.ts
+++ b/packages/eslint-plugin/src/rules/member-ordering.ts
@@ -728,6 +728,7 @@ export default createRule({
type: 'suggestion',
docs: {
description: 'Require a consistent member declaration order',
+ frozen: true,
},
messages: {
incorrectGroupOrder:
@@ -789,18 +790,23 @@ export default createRule({
properties: {
classes: {
$ref: '#/items/0/$defs/baseConfig',
+ description: 'Which ordering to enforce for classes.',
},
classExpressions: {
$ref: '#/items/0/$defs/baseConfig',
+ description: 'Which ordering to enforce for classExpressions.',
},
default: {
$ref: '#/items/0/$defs/baseConfig',
+ description: 'Which ordering to enforce for default.',
},
interfaces: {
$ref: '#/items/0/$defs/typesConfig',
+ description: 'Which ordering to enforce for interfaces.',
},
typeLiterals: {
$ref: '#/items/0/$defs/typesConfig',
+ description: 'Which ordering to enforce for typeLiterals.',
},
},
},
diff --git a/packages/eslint-plugin/src/rules/method-signature-style.ts b/packages/eslint-plugin/src/rules/method-signature-style.ts
index 1d7826402d3f..c4e76b0593a4 100644
--- a/packages/eslint-plugin/src/rules/method-signature-style.ts
+++ b/packages/eslint-plugin/src/rules/method-signature-style.ts
@@ -31,6 +31,7 @@ export default createRule({
schema: [
{
type: 'string',
+ description: 'The method signature style to enforce using.',
enum: ['property', 'method'],
},
],
diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts
index 83bf51a0ecfb..669f44e12f86 100644
--- a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts
@@ -4,7 +4,7 @@ import type * as ts from 'typescript';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import type { SelectorsString } from './enums';
-import type { Context, NormalizedSelector } from './types';
+import type { Context, NormalizedSelector, ValidatorFunction } from './types';
import { getParserServices } from '../../util';
import {
@@ -26,9 +26,7 @@ export function createValidator(
type: SelectorsString,
context: Context,
allConfigs: NormalizedSelector[],
-): (
- node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier,
-) => void {
+): ValidatorFunction {
// make sure the "highest priority" configs are checked first
const selectorType = Selectors[type];
const configs = allConfigs
@@ -72,10 +70,7 @@ export function createValidator(
return b.selector - a.selector;
});
- return (
- node: TSESTree.Identifier | TSESTree.Literal | TSESTree.PrivateIdentifier,
- modifiers: Set = new Set(),
- ): void => {
+ return (node, modifiers = new Set()): void => {
const originalName =
node.type === AST_NODE_TYPES.Identifier ||
node.type === AST_NODE_TYPES.PrivateIdentifier
diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts
index 03500d825163..17ba46233b45 100644
--- a/packages/eslint-plugin/src/rules/naming-convention.ts
+++ b/packages/eslint-plugin/src/rules/naming-convention.ts
@@ -70,6 +70,7 @@ export default createRule({
description:
'Enforce naming conventions for everything across a codebase',
// technically only requires type checking if the user uses "type" modifiers
+ frozen: true,
requiresTypeChecking: true,
},
messages: {
@@ -631,11 +632,8 @@ export default createRule({
// #region interface
- 'TSEnumMember[computed != true]': {
- handler: (
- node: TSESTree.TSEnumMemberNonComputedName,
- validator,
- ): void => {
+ TSEnumMember: {
+ handler: (node: TSESTree.TSEnumMember, validator): void => {
const id = node.id;
const modifiers = new Set();
diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts
index 6617c8d1dea2..48fca65676ed 100644
--- a/packages/eslint-plugin/src/rules/no-base-to-string.ts
+++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts
@@ -21,9 +21,17 @@ enum Usefulness {
export type Options = [
{
ignoredTypeNames?: string[];
+ checkUnknown?: boolean;
},
];
export type MessageIds = 'baseArrayJoin' | 'baseToString';
+const canHaveTypeParameters = (declaration: ts.Declaration) => {
+ return (
+ ts.isTypeAliasDeclaration(declaration) ||
+ ts.isInterfaceDeclaration(declaration) ||
+ ts.isClassDeclaration(declaration)
+ );
+};
export default createRule({
name: 'no-base-to-string',
@@ -46,10 +54,13 @@ export default createRule({
type: 'object',
additionalProperties: false,
properties: {
+ checkUnknown: {
+ type: 'boolean',
+ description: 'Whether to also check values of type `unknown`',
+ },
ignoredTypeNames: {
type: 'array',
- description:
- 'Stringified regular expressions of type names to ignore.',
+ description: 'Stringified type names to ignore.',
items: {
type: 'string',
},
@@ -60,6 +71,7 @@ export default createRule({
},
defaultOptions: [
{
+ checkUnknown: false,
ignoredTypeNames: ['Error', 'RegExp', 'URL', 'URLSearchParams'],
},
],
@@ -76,6 +88,7 @@ export default createRule({
type ?? services.getTypeAtLocation(node),
new Set(),
);
+
if (certainty === Usefulness.Always) {
return;
}
@@ -198,6 +211,36 @@ export default createRule({
return Usefulness.Always;
}
+ function hasBaseTypes(type: ts.Type): type is ts.InterfaceType {
+ return (
+ tsutils.isObjectType(type) &&
+ tsutils.isObjectFlagSet(
+ type,
+ ts.ObjectFlags.Interface | ts.ObjectFlags.Class,
+ )
+ );
+ }
+
+ function isIgnoredTypeOrBase(
+ type: ts.Type,
+ seen = new Set(),
+ ): boolean {
+ if (seen.has(type)) {
+ return false;
+ }
+
+ seen.add(type);
+
+ const typeName = getTypeName(checker, type);
+ return (
+ ignoredTypeNames.includes(typeName) ||
+ (hasBaseTypes(type) &&
+ checker
+ .getBaseTypes(type)
+ .some(base => isIgnoredTypeOrBase(base, seen)))
+ );
+ }
+
function collectToStringCertainty(
type: ts.Type,
visited: Set,
@@ -213,7 +256,7 @@ export default createRule({
return collectToStringCertainty(constraint, visited);
}
// unconstrained generic means `unknown`
- return Usefulness.Always;
+ return option.checkUnknown ? Usefulness.Sometimes : Usefulness.Always;
}
// the Boolean type definition missing toString()
@@ -224,7 +267,18 @@ export default createRule({
return Usefulness.Always;
}
- if (ignoredTypeNames.includes(getTypeName(checker, type))) {
+ const symbol = type.aliasSymbol ?? type.getSymbol();
+ const decl = symbol?.getDeclarations()?.[0];
+ if (
+ decl &&
+ canHaveTypeParameters(decl) &&
+ decl.typeParameters &&
+ ignoredTypeNames.includes(symbol.name)
+ ) {
+ return Usefulness.Always;
+ }
+
+ if (isIgnoredTypeOrBase(type)) {
return Usefulness.Always;
}
@@ -251,13 +305,19 @@ export default createRule({
const toString =
checker.getPropertyOfType(type, 'toString') ??
checker.getPropertyOfType(type, 'toLocaleString');
+
if (!toString) {
- // e.g. any/unknown
+ // unknown
+ if (option.checkUnknown && type.flags === ts.TypeFlags.Unknown) {
+ return Usefulness.Sometimes;
+ }
+ // e.g. any
return Usefulness.Always;
}
const declarations = toString.getDeclarations();
+ // eslint-disable-next-line @typescript-eslint/prefer-optional-chain
if (declarations == null || declarations.length !== 1) {
// If there are multiple declarations, at least one of them must not be
// the default object toString.
diff --git a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts
index 1efacdaf5ae1..9534acef8ee2 100644
--- a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts
+++ b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts
@@ -1,4 +1,8 @@
-import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
+import type {
+ NodeWithParent,
+ TSESLint,
+ TSESTree,
+} from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as tsutils from 'ts-api-utils';
@@ -300,8 +304,8 @@ export default createRule({
* @param node The void expression node to check.
* @returns Invalid ancestor node if it was found. `null` otherwise.
*/
- function findInvalidAncestor(node: TSESTree.Node): InvalidAncestor | null {
- const parent = nullThrows(node.parent, NullThrowsReasons.MissingParent);
+ function findInvalidAncestor(node: NodeWithParent): InvalidAncestor | null {
+ const parent = node.parent;
if (
parent.type === AST_NODE_TYPES.SequenceExpression &&
node !== parent.expressions[parent.expressions.length - 1]
@@ -365,17 +369,14 @@ export default createRule({
/** Checks whether the return statement is the last statement in a function body. */
function isFinalReturn(node: TSESTree.ReturnStatement): boolean {
// the parent must be a block
- const block = nullThrows(node.parent, NullThrowsReasons.MissingParent);
+ const block = node.parent;
if (block.type !== AST_NODE_TYPES.BlockStatement) {
// e.g. `if (cond) return;` (not in a block)
return false;
}
// the block's parent must be a function
- const blockParent = nullThrows(
- block.parent,
- NullThrowsReasons.MissingParent,
- );
+ const blockParent = block.parent;
if (
![
AST_NODE_TYPES.ArrowFunctionExpression,
diff --git a/packages/eslint-plugin/src/rules/no-deprecated.ts b/packages/eslint-plugin/src/rules/no-deprecated.ts
index 725ddaf3fce9..cc6bb70be9c4 100644
--- a/packages/eslint-plugin/src/rules/no-deprecated.ts
+++ b/packages/eslint-plugin/src/rules/no-deprecated.ts
@@ -12,6 +12,7 @@ import {
nullThrows,
typeOrValueSpecifiersSchema,
typeMatchesSomeSpecifier,
+ valueMatchesSomeSpecifier,
} from '../util';
type IdentifierLike =
@@ -156,22 +157,26 @@ export default createRule({
case AST_NODE_TYPES.TSTypeParameter:
return true;
+ // treat `export import Bar = Foo;` (and `import Foo = require('...')`) as declarations
+ case AST_NODE_TYPES.TSImportEqualsDeclaration:
+ return parent.id === node;
+
default:
return false;
}
}
- function isInsideExportOrImport(node: TSESTree.Node): boolean {
+ function isInsideImport(node: TSESTree.Node): boolean {
let current = node;
while (true) {
switch (current.type) {
- case AST_NODE_TYPES.ExportAllDeclaration:
- case AST_NODE_TYPES.ExportNamedDeclaration:
case AST_NODE_TYPES.ImportDeclaration:
return true;
case AST_NODE_TYPES.ArrowFunctionExpression:
+ case AST_NODE_TYPES.ExportAllDeclaration:
+ case AST_NODE_TYPES.ExportNamedDeclaration:
case AST_NODE_TYPES.BlockStatement:
case AST_NODE_TYPES.ClassDeclaration:
case AST_NODE_TYPES.TSInterfaceDeclaration:
@@ -365,17 +370,21 @@ export default createRule({
}
function checkIdentifier(node: IdentifierLike): void {
- if (isDeclaration(node) || isInsideExportOrImport(node)) {
+ if (isDeclaration(node) || isInsideImport(node)) {
return;
}
const reason = getDeprecationReason(node);
+
if (reason == null) {
return;
}
const type = services.getTypeAtLocation(node);
- if (typeMatchesSomeSpecifier(type, allow, services.program)) {
+ if (
+ typeMatchesSomeSpecifier(type, allow, services.program) ||
+ valueMatchesSomeSpecifier(node, allow, services.program, type)
+ ) {
return;
}
@@ -436,7 +445,42 @@ export default createRule({
}
return {
- Identifier: checkIdentifier,
+ Identifier(node): void {
+ const { parent } = node;
+
+ if (
+ parent.type === AST_NODE_TYPES.ExportNamedDeclaration ||
+ parent.type === AST_NODE_TYPES.ExportAllDeclaration
+ ) {
+ return;
+ }
+
+ // Computed identifier expressions are handled by checkMemberExpression
+ if (
+ parent.type === AST_NODE_TYPES.MemberExpression &&
+ parent.computed &&
+ parent.property === node
+ ) {
+ return;
+ }
+
+ if (parent.type === AST_NODE_TYPES.ExportSpecifier) {
+ // only deal with the alias (exported) side, not the local binding
+ if (parent.exported !== node) {
+ return;
+ }
+
+ const symbol = services.getSymbolAtLocation(node);
+ const aliasDeprecation = getJsDocDeprecation(symbol);
+
+ if (aliasDeprecation != null) {
+ return;
+ }
+ }
+
+ // whether it's a plain identifier or the exported alias
+ checkIdentifier(node);
+ },
JSXIdentifier(node): void {
if (node.parent.type !== AST_NODE_TYPES.JSXClosingElement) {
checkIdentifier(node);
diff --git a/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts b/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts
index c5a858dbdcaa..b9c6fe08d6e6 100644
--- a/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts
+++ b/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts
@@ -36,6 +36,15 @@ export default createRule({
);
}
+ function isSupportedUnary(
+ node: TSESTree.Expression,
+ ): node is TSESTree.UnaryExpression {
+ return (
+ node.type === AST_NODE_TYPES.UnaryExpression &&
+ ['-', '+'].includes(node.operator)
+ );
+ }
+
function isStaticTemplateLiteral(
node: TSESTree.Expression,
): node is TSESTree.TemplateLiteral {
@@ -46,30 +55,47 @@ export default createRule({
);
}
+ function getMemberValue(
+ initializer: TSESTree.Expression,
+ ): number | string | undefined {
+ switch (true) {
+ case isStringLiteral(initializer):
+ case isNumberLiteral(initializer):
+ return initializer.value;
+ case isSupportedUnary(initializer): {
+ const inner = Number(getMemberValue(initializer.argument));
+ if (Number.isNaN(inner)) {
+ return undefined;
+ }
+
+ return initializer.operator === '-' ? -inner : inner;
+ }
+ case isStaticTemplateLiteral(initializer):
+ return initializer.quasis[0].value.cooked;
+ default:
+ return undefined;
+ }
+ }
+
return {
TSEnumDeclaration(node: TSESTree.TSEnumDeclaration): void {
const enumMembers = node.body.members;
- const seenValues = new Set();
+ const seenValues: (number | string)[] = [];
enumMembers.forEach(member => {
if (member.initializer == null) {
return;
}
- let value: number | string | undefined;
- if (isStringLiteral(member.initializer)) {
- value = member.initializer.value;
- } else if (isNumberLiteral(member.initializer)) {
- value = member.initializer.value;
- } else if (isStaticTemplateLiteral(member.initializer)) {
- value = member.initializer.quasis[0].value.cooked;
- }
-
+ const value = getMemberValue(member.initializer);
if (value == null) {
return;
}
- if (seenValues.has(value)) {
+ const isAlreadyPresent = seenValues.some(seenValue =>
+ Object.is(seenValue, value),
+ );
+ if (isAlreadyPresent) {
context.report({
node: member,
messageId: 'duplicateValue',
@@ -78,7 +104,7 @@ export default createRule({
},
});
} else {
- seenValues.add(value);
+ seenValues.push(value);
}
});
},
diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts
index 50965093ee98..b040d1c82122 100644
--- a/packages/eslint-plugin/src/rules/no-floating-promises.ts
+++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts
@@ -1,21 +1,23 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
+import type * as ts from 'typescript';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import * as tsutils from 'ts-api-utils';
-import * as ts from 'typescript';
import type { TypeOrValueSpecifier } from '../util';
import {
createRule,
- getOperatorPrecedence,
+ getOperatorPrecedenceForNode,
getParserServices,
isBuiltinSymbolLike,
+ isParenthesized,
OperatorPrecedence,
readonlynessOptionsDefaults,
readonlynessOptionsSchema,
skipChainExpression,
typeMatchesSomeSpecifier,
+ valueMatchesSomeSpecifier,
} from '../util';
import {
parseCatchCall,
@@ -142,7 +144,7 @@ export default createRule({
const expression = skipChainExpression(node.expression);
- if (isKnownSafePromiseReturn(expression)) {
+ if (isKnownSafePromiseCall(expression)) {
return;
}
@@ -167,10 +169,11 @@ export default createRule({
{
messageId: 'floatingFixVoid',
fix(fixer): TSESLint.RuleFix | TSESLint.RuleFix[] {
- const tsNode = services.esTreeNodeToTSNodeMap.get(
- node.expression,
- );
- if (isHigherPrecedenceThanUnary(tsNode)) {
+ if (
+ isParenthesized(expression, context.sourceCode) ||
+ getOperatorPrecedenceForNode(expression) >
+ OperatorPrecedence.Unary
+ ) {
return fixer.insertTextBefore(node, 'void ');
}
return [
@@ -222,8 +225,10 @@ export default createRule({
'await',
);
}
- const tsNode = services.esTreeNodeToTSNodeMap.get(node.expression);
- if (isHigherPrecedenceThanUnary(tsNode)) {
+ if (
+ isParenthesized(expression, context.sourceCode) ||
+ getOperatorPrecedenceForNode(expression) > OperatorPrecedence.Unary
+ ) {
return fixer.insertTextBefore(node, 'await ');
}
return [
@@ -235,13 +240,24 @@ export default createRule({
];
}
- function isKnownSafePromiseReturn(node: TSESTree.Node): boolean {
+ function isKnownSafePromiseCall(node: TSESTree.Node): boolean {
if (node.type !== AST_NODE_TYPES.CallExpression) {
return false;
}
const type = services.getTypeAtLocation(node.callee);
+ if (
+ valueMatchesSomeSpecifier(
+ node.callee,
+ allowForKnownSafeCalls,
+ services.program,
+ type,
+ )
+ ) {
+ return true;
+ }
+
return typeMatchesSomeSpecifier(
type,
allowForKnownSafeCalls,
@@ -249,14 +265,6 @@ export default createRule({
);
}
- function isHigherPrecedenceThanUnary(node: ts.Node): boolean {
- const operator = ts.isBinaryExpression(node)
- ? node.operatorToken.kind
- : ts.SyntaxKind.Unknown;
- const nodePrecedence = getOperatorPrecedence(node.kind, operator);
- return nodePrecedence > OperatorPrecedence.Unary;
- }
-
function isAsyncIife(node: TSESTree.ExpressionStatement): boolean {
if (node.expression.type !== AST_NODE_TYPES.CallExpression) {
return false;
diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts
index 6ecddefd0645..04b48b3a1daa 100644
--- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts
+++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts
@@ -53,6 +53,7 @@ export default createRule({
docs: {
description: 'Disallow magic numbers',
extendsBaseRule: true,
+ frozen: true,
},
messages: baseRule.meta.messages,
schema: [schema],
diff --git a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts
index 68cc840fa84b..6ad9d40c58b1 100644
--- a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts
+++ b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts
@@ -36,7 +36,6 @@ export default createRule({
properties: {
checkNever: {
type: 'boolean',
- default: false,
description:
'Whether to suggest removing `void` when the argument has type `never`.',
},
diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts
index aa225d4e0aa2..d491da6227d4 100644
--- a/packages/eslint-plugin/src/rules/no-misused-promises.ts
+++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts
@@ -6,14 +6,17 @@ import * as ts from 'typescript';
import {
createRule,
+ getConstrainedTypeAtLocation,
getFunctionHeadLoc,
getParserServices,
isArrayMethodCallWithPredicate,
isFunction,
+ isPromiseLike,
isRestParameterDeclaration,
nullThrows,
NullThrowsReasons,
} from '../util';
+import { parseFinallyCall } from '../util/promiseUtils';
export type Options = [
{
@@ -85,7 +88,7 @@ export default createRule({
messages: {
conditional: 'Expected non-Promise value in a boolean conditional.',
predicate: 'Expected a non-Promise value to be returned.',
- spread: 'Expected a non-Promise value to be spreaded in an object.',
+ spread: 'Expected a non-Promise value to be spread in an object.',
voidReturnArgument:
'Promise returned in function argument where a void return was expected.',
voidReturnAttribute:
@@ -360,6 +363,13 @@ export default createRule({
function checkArguments(
node: TSESTree.CallExpression | TSESTree.NewExpression,
): void {
+ if (
+ node.type === AST_NODE_TYPES.CallExpression &&
+ isPromiseFinallyMethod(node)
+ ) {
+ return;
+ }
+
const tsNode = services.esTreeNodeToTSNodeMap.get(node);
const voidArgs = voidFunctionArguments(checker, tsNode);
if (voidArgs.size === 0) {
@@ -492,10 +502,10 @@ export default createRule({
if (objType == null) {
return;
}
- const propertySymbol = checker.getPropertyOfType(
- objType,
- tsNode.name.text,
- );
+ const propertySymbol = tsutils
+ .unionConstituents(objType)
+ .map(t => checker.getPropertyOfType(t, tsNode.name.getText()))
+ .find(p => p);
if (propertySymbol == null) {
return;
}
@@ -563,6 +573,18 @@ export default createRule({
}
}
+ function isPromiseFinallyMethod(node: TSESTree.CallExpression): boolean {
+ const promiseFinallyCall = parseFinallyCall(node, context);
+
+ return (
+ promiseFinallyCall != null &&
+ isPromiseLike(
+ services.program,
+ getConstrainedTypeAtLocation(services, promiseFinallyCall.object),
+ )
+ );
+ }
+
function checkClassLikeOrInterfaceNode(
node:
| TSESTree.ClassDeclaration
diff --git a/packages/eslint-plugin/src/rules/no-misused-spread.ts b/packages/eslint-plugin/src/rules/no-misused-spread.ts
index fab84902e9e1..34ce3fa9db52 100644
--- a/packages/eslint-plugin/src/rules/no-misused-spread.ts
+++ b/packages/eslint-plugin/src/rules/no-misused-spread.ts
@@ -154,7 +154,7 @@ export default createRule({
function getPromiseSpreadSuggestions(
node: TSESTree.Expression,
): TSESLint.ReportSuggestionArray {
- const isHighPrecendence = isHigherPrecedenceThanAwait(
+ const isHighPrecedence = isHigherPrecedenceThanAwait(
services.esTreeNodeToTSNodeMap.get(node),
);
@@ -162,7 +162,7 @@ export default createRule({
{
messageId: 'addAwait',
fix: fixer =>
- isHighPrecendence
+ isHighPrecedence
? fixer.insertTextBefore(node, 'await ')
: [
fixer.insertTextBefore(node, 'await ('),
diff --git a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts
index fd66c1cef9b0..bc7c9ecf226e 100644
--- a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts
+++ b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts
@@ -4,6 +4,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import {
createRule,
+ isAssignee,
isNonNullAssertionPunctuator,
nullThrows,
NullThrowsReasons,
@@ -53,7 +54,8 @@ export default createRule<[], MessageIds>({
if (
node.parent.type === AST_NODE_TYPES.MemberExpression &&
- node.parent.object === node
+ node.parent.object === node &&
+ !isAssignee(node.parent)
) {
if (!node.parent.optional) {
if (node.parent.computed) {
diff --git a/packages/eslint-plugin/src/rules/no-restricted-types.ts b/packages/eslint-plugin/src/rules/no-restricted-types.ts
index b4d9e427c07f..2901ac5a9cf5 100644
--- a/packages/eslint-plugin/src/rules/no-restricted-types.ts
+++ b/packages/eslint-plugin/src/rules/no-restricted-types.ts
@@ -36,7 +36,7 @@ function stringifyNode(
}
function getCustomMessage(
- bannedType: string | { fixWith?: string; message?: string } | true | null,
+ bannedType: string | true | { fixWith?: string; message?: string } | null,
): string {
if (!bannedType || bannedType === true) {
return '';
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
index 387bf5f2da33..b9a1ebb9a4bf 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts
@@ -200,9 +200,12 @@ export default createRule({
oneOf: [
{
type: 'boolean',
+ description: 'Always ignore or not ignore the loop conditions',
},
{
type: 'string',
+ description:
+ 'Which situations to ignore constant conditions in.',
enum: ['always', 'never', 'only-allowed-literals'],
},
],
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts b/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts
index 4f184af39f15..361300e1e3a1 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-template-expression.ts
@@ -193,7 +193,7 @@ export default createRule<[], MessageId>({
});
}
- function isUnncessaryValueInterpolation({
+ function isUnnecessaryValueInterpolation({
interpolation,
nextQuasi,
prevQuasi,
@@ -432,7 +432,7 @@ export default createRule<[], MessageId>({
}
const infos = getInterpolationInfos(node).filter(
- isUnncessaryValueInterpolation,
+ isUnnecessaryValueInterpolation,
);
for (const reportDescriptor of getReportDescriptors(infos)) {
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts
index 945614ae618f..708879be502f 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts
@@ -169,11 +169,11 @@ function getTypeParametersFromType(
return undefined;
}
- const sortedDeclaraions = sortDeclarationsByTypeValueContext(
+ const sortedDeclarations = sortDeclarationsByTypeValueContext(
node,
declarations,
);
- return findFirstResult(sortedDeclaraions, decl => {
+ return findFirstResult(sortedDeclarations, decl => {
if (
ts.isTypeAliasDeclaration(decl) ||
ts.isInterfaceDeclaration(decl) ||
diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts
index b9471c87d2bd..d18f7617acfc 100644
--- a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts
+++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts
@@ -19,6 +19,18 @@ type MessageIds =
| 'suggestSatisfies'
| 'unnecessaryTypeConversion';
+function isEnumType(type: ts.Type): boolean {
+ return (type.getFlags() & ts.TypeFlags.EnumLike) !== 0;
+}
+
+function isEnumMemberType(type: ts.Type): boolean {
+ const symbol = type.getSymbol();
+ if (!symbol) {
+ return false;
+ }
+ return (symbol.flags & ts.SymbolFlags.EnumMember) !== 0;
+}
+
export default createRule({
name: 'no-unnecessary-type-conversion',
meta: {
@@ -26,6 +38,7 @@ export default createRule({
docs: {
description:
'Disallow conversion idioms when they do not change the type or value of the expression',
+ recommended: 'strict',
requiresTypeChecking: true,
},
hasSuggestions: true,
@@ -56,7 +69,7 @@ export default createRule({
typeFlag: ts.TypeFlags,
typeString: 'boolean' | 'number',
violation: string,
- isDoubleOperator: boolean, // !! or ~~
+ isDoubleOperator: boolean, // !!
) {
const outerNode = isDoubleOperator ? node.parent : node;
const type = services.getTypeAtLocation(node.argument);
@@ -293,6 +306,11 @@ export default createRule({
): void {
const memberExpr = node.parent as TSESTree.MemberExpression;
const type = getConstrainedTypeAtLocation(services, memberExpr.object);
+
+ if (isEnumType(type) || isEnumMemberType(type)) {
+ return;
+ }
+
if (doesUnderlyingTypeMatchFlag(type, ts.TypeFlags.StringLike)) {
const wrappingFixerParams = {
node: memberExpr.parent,
@@ -350,13 +368,49 @@ export default createRule({
'UnaryExpression[operator = "~"] > UnaryExpression[operator = "~"]'(
node: TSESTree.UnaryExpression,
): void {
- handleUnaryOperator(
- node,
- ts.TypeFlags.NumberLike,
- 'number',
- 'Using ~~ on a number',
- true,
- );
+ const outerNode = node.parent;
+ const type = services.getTypeAtLocation(node.argument);
+
+ if (
+ tsutils.unionConstituents(type).every(t => {
+ return (
+ isTypeFlagSet(t, ts.TypeFlags.NumberLiteral) &&
+ Number.isInteger((t as ts.NumberLiteralType).value)
+ );
+ })
+ ) {
+ const wrappingFixerParams = {
+ node: outerNode,
+ innerNode: [node.argument],
+ sourceCode: context.sourceCode,
+ };
+
+ context.report({
+ loc: {
+ start: outerNode.loc.start,
+ end: {
+ column: node.loc.start.column + 1,
+ line: node.loc.start.line,
+ },
+ },
+ messageId: 'unnecessaryTypeConversion',
+ data: { type: 'number', violation: 'Using ~~ on an integer' },
+ suggest: [
+ {
+ messageId: 'suggestRemove',
+ fix: getWrappingFixer(wrappingFixerParams),
+ },
+ {
+ messageId: 'suggestSatisfies',
+ data: { type: 'number' },
+ fix: getWrappingFixer({
+ ...wrappingFixerParams,
+ wrap: expr => `${expr} satisfies number`,
+ }),
+ },
+ ],
+ });
+ }
},
};
},
diff --git a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts
index 2dd9ca6b5d2e..6b3e47e3a3b4 100644
--- a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts
+++ b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts
@@ -50,6 +50,8 @@ export default createRule({
unsafeArraySpread: 'Unsafe spread of an {{sender}} value in an array.',
unsafeAssignment:
'Unsafe assignment of type {{sender}} to a variable of type {{receiver}}.',
+ unsafeObjectPattern:
+ 'Unsafe object destructuring of a property with an {{sender}} value.',
},
schema: [],
},
@@ -215,7 +217,7 @@ export default createRule({
if (isTypeAnyType(senderType)) {
context.report({
node: receiverProperty.value,
- messageId: 'unsafeArrayPatternFromTuple',
+ messageId: 'unsafeObjectPattern',
data: createData(senderType),
});
didReport = true;
diff --git a/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts b/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts
index c5f457db3618..051a827ee720 100644
--- a/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts
+++ b/packages/eslint-plugin/src/rules/no-unsafe-enum-comparison.ts
@@ -23,25 +23,33 @@ function typeViolates(leftTypeParts: ts.Type[], rightType: ts.Type): boolean {
}
function isNumberLike(type: ts.Type): boolean {
- const typeParts = tsutils.intersectionConstituents(type);
-
- return typeParts.some(typePart => {
- return tsutils.isTypeFlagSet(
- typePart,
- ts.TypeFlags.Number | ts.TypeFlags.NumberLike,
+ return tsutils
+ .unionConstituents(type)
+ .every(unionPart =>
+ tsutils
+ .intersectionConstituents(unionPart)
+ .some(intersectionPart =>
+ tsutils.isTypeFlagSet(
+ intersectionPart,
+ ts.TypeFlags.Number | ts.TypeFlags.NumberLike,
+ ),
+ ),
);
- });
}
function isStringLike(type: ts.Type): boolean {
- const typeParts = tsutils.intersectionConstituents(type);
-
- return typeParts.some(typePart => {
- return tsutils.isTypeFlagSet(
- typePart,
- ts.TypeFlags.String | ts.TypeFlags.StringLike,
+ return tsutils
+ .unionConstituents(type)
+ .every(unionPart =>
+ tsutils
+ .intersectionConstituents(unionPart)
+ .some(intersectionPart =>
+ tsutils.isTypeFlagSet(
+ intersectionPart,
+ ts.TypeFlags.String | ts.TypeFlags.StringLike,
+ ),
+ ),
);
- });
}
/**
diff --git a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
index 6cf16d5211e4..510d53c5e3e3 100644
--- a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
+++ b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts
@@ -15,6 +15,7 @@ import {
const enum State {
Unsafe = 1,
Safe = 2,
+ Chained = 3,
}
function createDataType(type: ts.Type): '`any`' | '`error` typed' {
@@ -22,7 +23,18 @@ function createDataType(type: ts.Type): '`any`' | '`error` typed' {
return isErrorType ? '`error` typed' : '`any`';
}
-export default createRule({
+export type Options = [
+ {
+ allowOptionalChaining?: boolean;
+ },
+];
+
+export type MessageIds =
+ | 'unsafeComputedMemberAccess'
+ | 'unsafeMemberExpression'
+ | 'unsafeThisMemberExpression';
+
+export default createRule({
name: 'no-unsafe-member-access',
meta: {
type: 'problem',
@@ -41,10 +53,26 @@ export default createRule({
'You can try to fix this by turning on the `noImplicitThis` compiler option, or adding a `this` parameter to the function.',
].join('\n'),
},
- schema: [],
+ schema: [
+ {
+ type: 'object',
+ additionalProperties: false,
+ properties: {
+ allowOptionalChaining: {
+ type: 'boolean',
+ description:
+ 'Whether to allow `?.` optional chains on `any` values.',
+ },
+ },
+ },
+ ],
},
- defaultOptions: [],
- create(context) {
+ defaultOptions: [
+ {
+ allowOptionalChaining: false,
+ },
+ ],
+ create(context, [{ allowOptionalChaining }]) {
const services = getParserServices(context);
const compilerOptions = services.program.getCompilerOptions();
const isNoImplicitThis = tsutils.isStrictCompilerOptionEnabled(
@@ -54,7 +82,20 @@ export default createRule({
const stateCache = new Map();
+ // Case notes:
+ // value?.outer.middle.inner
+ // The ChainExpression is a child of the root expression, and a parent of all the MemberExpressions.
+ // But the left-most expression is what we want to report on: the inner-most expressions.
+ // In fact, this is true even if the chain is on the inside!
+ // value.outer.middle?.inner;
+ // It was already true that every `object` (MemberExpression) has optional: boolean
+
function checkMemberExpression(node: TSESTree.MemberExpression): State {
+ if (allowOptionalChaining && node.optional) {
+ stateCache.set(node, State.Chained);
+ return State.Chained;
+ }
+
const cachedState = stateCache.get(node);
if (cachedState) {
return cachedState;
@@ -77,8 +118,7 @@ export default createRule({
if (state === State.Unsafe) {
const propertyName = context.sourceCode.getText(node.property);
- let messageId: 'unsafeMemberExpression' | 'unsafeThisMemberExpression' =
- 'unsafeMemberExpression';
+ let messageId: MessageIds = 'unsafeMemberExpression';
if (!isNoImplicitThis) {
// `this.foo` or `this.foo[bar]`
@@ -114,6 +154,13 @@ export default createRule({
'MemberExpression[computed = true] > *.property'(
node: TSESTree.Expression,
): void {
+ if (
+ allowOptionalChaining &&
+ (node.parent as TSESTree.MemberExpression).optional
+ ) {
+ return;
+ }
+
if (
// x[1]
node.type === AST_NODE_TYPES.Literal ||
diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts
index f2bfa26bb1a8..ce8e0abc3340 100644
--- a/packages/eslint-plugin/src/rules/no-unused-vars.ts
+++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts
@@ -35,6 +35,7 @@ export type Options = [
destructuredArrayIgnorePattern?: string;
ignoreClassWithStaticInitBlock?: boolean;
ignoreRestSiblings?: boolean;
+ ignoreUsingDeclarations?: boolean;
reportUsedIgnorePattern?: boolean;
vars?: 'all' | 'local';
varsIgnorePattern?: string;
@@ -49,6 +50,7 @@ interface TranslatedOptions {
destructuredArrayIgnorePattern?: RegExp;
ignoreClassWithStaticInitBlock: boolean;
ignoreRestSiblings: boolean;
+ ignoreUsingDeclarations: boolean;
reportUsedIgnorePattern: boolean;
vars: 'all' | 'local';
varsIgnorePattern?: RegExp;
@@ -86,6 +88,7 @@ export default createRule({
oneOf: [
{
type: 'string',
+ description: 'Broad setting for unused variables to target.',
enum: ['all', 'local'],
},
{
@@ -127,6 +130,11 @@ export default createRule({
description:
'Whether to ignore sibling properties in `...` destructurings.',
},
+ ignoreUsingDeclarations: {
+ type: 'boolean',
+ description:
+ 'Whether to ignore using or await using declarations.',
+ },
reportUsedIgnorePattern: {
type: 'boolean',
description:
@@ -162,6 +170,7 @@ export default createRule({
caughtErrors: 'all',
ignoreClassWithStaticInitBlock: false,
ignoreRestSiblings: false,
+ ignoreUsingDeclarations: false,
reportUsedIgnorePattern: false,
vars: 'all',
};
@@ -173,6 +182,9 @@ export default createRule({
options.args = firstOption.args ?? options.args;
options.ignoreRestSiblings =
firstOption.ignoreRestSiblings ?? options.ignoreRestSiblings;
+ options.ignoreUsingDeclarations =
+ firstOption.ignoreUsingDeclarations ??
+ options.ignoreUsingDeclarations;
options.caughtErrors = firstOption.caughtErrors ?? options.caughtErrors;
options.ignoreClassWithStaticInitBlock =
firstOption.ignoreClassWithStaticInitBlock ??
@@ -548,6 +560,14 @@ export default createRule({
continue;
}
+ if (
+ def.type === TSESLint.Scope.DefinitionType.Variable &&
+ options.ignoreUsingDeclarations &&
+ (def.parent.kind === 'await using' || def.parent.kind === 'using')
+ ) {
+ continue;
+ }
+
if (hasRestSpreadSibling(variable)) {
continue;
}
diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts
index e0dcef814cc7..11e51f0d5ee5 100644
--- a/packages/eslint-plugin/src/rules/no-use-before-define.ts
+++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts
@@ -231,6 +231,8 @@ export default createRule({
oneOf: [
{
type: 'string',
+ description:
+ 'Broadly set functions and allowNamedExports to false.',
enum: ['nofunc'],
},
{
diff --git a/packages/eslint-plugin/src/rules/only-throw-error.ts b/packages/eslint-plugin/src/rules/only-throw-error.ts
index 187e6ac5e5b1..ec5de09d13f0 100644
--- a/packages/eslint-plugin/src/rules/only-throw-error.ts
+++ b/packages/eslint-plugin/src/rules/only-throw-error.ts
@@ -143,13 +143,6 @@ export default createRule({
}
function checkThrowArgument(node: TSESTree.Node): void {
- if (
- node.type === AST_NODE_TYPES.AwaitExpression ||
- node.type === AST_NODE_TYPES.YieldExpression
- ) {
- return;
- }
-
if (options.allowRethrowing && isRethrownError(node)) {
return;
}
diff --git a/packages/eslint-plugin/src/rules/prefer-destructuring.ts b/packages/eslint-plugin/src/rules/prefer-destructuring.ts
index 5934573e3350..40c0de88ba40 100644
--- a/packages/eslint-plugin/src/rules/prefer-destructuring.ts
+++ b/packages/eslint-plugin/src/rules/prefer-destructuring.ts
@@ -52,6 +52,7 @@ const schema: readonly JSONSchema4[] = [
},
{
type: 'object',
+ additionalProperties: false,
properties: {
enforceForDeclarationWithTypeAnnotation: {
type: 'boolean',
@@ -75,6 +76,7 @@ export default createRule({
docs: {
description: 'Require destructuring from arrays and/or objects',
extendsBaseRule: true,
+ frozen: true,
requiresTypeChecking: true,
},
fixable: baseRule.meta.fixable,
diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts
index 6825fc042a6d..4da95f8f9866 100644
--- a/packages/eslint-plugin/src/rules/prefer-includes.ts
+++ b/packages/eslint-plugin/src/rules/prefer-includes.ts
@@ -39,7 +39,7 @@ export default createRule({
function isNumber(node: TSESTree.Node, value: number): boolean {
const evaluated = getStaticValue(node, globalScope);
- return evaluated != null && evaluated.value === value;
+ return evaluated?.value === value;
}
function isPositiveCheck(node: TSESTree.BinaryExpression): boolean {
diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts
index d846b0bbc59b..0956b558b10a 100644
--- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts
+++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts
@@ -47,13 +47,13 @@ export type Options = [
ignoreIfStatements?: boolean;
ignoreMixedLogicalExpressions?: boolean;
ignorePrimitives?:
+ | true
| {
bigint?: boolean;
boolean?: boolean;
number?: boolean;
string?: boolean;
- }
- | true;
+ };
ignoreTernaryTests?: boolean;
},
];
@@ -123,6 +123,7 @@ export default createRule({
oneOf: [
{
type: 'object',
+ additionalProperties: false,
description: 'Which primitives types may be ignored.',
properties: {
bigint: {
@@ -300,7 +301,11 @@ export default createRule({
if (
ignoreBooleanCoercion === true &&
- isBooleanConstructorContext(node, context)
+ isBooleanConstructorContext(node, context) &&
+ !(
+ node.type === AST_NODE_TYPES.ConditionalExpression &&
+ node.parent.type === AST_NODE_TYPES.CallExpression
+ )
) {
return false;
}
diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts
index c4364765f92c..a2b11134e540 100644
--- a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts
+++ b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/analyzeChain.ts
@@ -13,7 +13,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import { unionConstituents } from 'ts-api-utils';
import * as ts from 'typescript';
-import type { ValidOperand } from './gatherLogicalOperands';
+import type { LastChainOperand, ValidOperand } from './gatherLogicalOperands';
import type {
PreferOptionalChainMessageIds,
PreferOptionalChainOptions,
@@ -31,7 +31,7 @@ import {
} from '../../util';
import { checkNullishAndReport } from './checkNullishAndReport';
import { compareNodes, NodeComparisonResult } from './compareNodes';
-import { NullishComparisonType } from './gatherLogicalOperands';
+import { ComparisonType, NullishComparisonType } from './gatherLogicalOperands';
function includesType(
parserServices: ParserServicesWithTypeInformation,
@@ -48,6 +48,75 @@ function includesType(
return false;
}
+function isValidAndLastChainOperand(
+ ComparisonValueType: TSESTree.Node,
+ comparisonType: ComparisonType,
+ parserServices: ParserServicesWithTypeInformation,
+) {
+ const type = parserServices.getTypeAtLocation(ComparisonValueType);
+ const ANY_UNKNOWN_FLAGS = ts.TypeFlags.Any | ts.TypeFlags.Unknown;
+
+ const types = unionConstituents(type);
+ switch (comparisonType) {
+ case ComparisonType.Equal: {
+ const isNullish = types.some(t =>
+ isTypeFlagSet(
+ t,
+ ANY_UNKNOWN_FLAGS | ts.TypeFlags.Null | ts.TypeFlags.Undefined,
+ ),
+ );
+ return !isNullish;
+ }
+ case ComparisonType.StrictEqual: {
+ const isUndefined = types.some(t =>
+ isTypeFlagSet(t, ANY_UNKNOWN_FLAGS | ts.TypeFlags.Undefined),
+ );
+ return !isUndefined;
+ }
+ case ComparisonType.NotStrictEqual: {
+ return types.every(t => isTypeFlagSet(t, ts.TypeFlags.Undefined));
+ }
+ case ComparisonType.NotEqual: {
+ return types.every(t =>
+ isTypeFlagSet(t, ts.TypeFlags.Undefined | ts.TypeFlags.Null),
+ );
+ }
+ }
+}
+function isValidOrLastChainOperand(
+ ComparisonValueType: TSESTree.Node,
+ comparisonType: ComparisonType,
+ parserServices: ParserServicesWithTypeInformation,
+) {
+ const type = parserServices.getTypeAtLocation(ComparisonValueType);
+ const ANY_UNKNOWN_FLAGS = ts.TypeFlags.Any | ts.TypeFlags.Unknown;
+
+ const types = unionConstituents(type);
+ switch (comparisonType) {
+ case ComparisonType.NotEqual: {
+ const isNullish = types.some(t =>
+ isTypeFlagSet(
+ t,
+ ANY_UNKNOWN_FLAGS | ts.TypeFlags.Null | ts.TypeFlags.Undefined,
+ ),
+ );
+ return !isNullish;
+ }
+ case ComparisonType.NotStrictEqual: {
+ const isUndefined = types.some(t =>
+ isTypeFlagSet(t, ANY_UNKNOWN_FLAGS | ts.TypeFlags.Undefined),
+ );
+ return !isUndefined;
+ }
+ case ComparisonType.Equal:
+ return types.every(t =>
+ isTypeFlagSet(t, ts.TypeFlags.Undefined | ts.TypeFlags.Null),
+ );
+ case ComparisonType.StrictEqual:
+ return types.every(t => isTypeFlagSet(t, ts.TypeFlags.Undefined));
+ }
+}
+
// I hate that these functions are identical aside from the enum values used
// I can't think of a good way to reuse the code here in a way that will preserve
// the type safety and simplicity.
@@ -65,18 +134,7 @@ const analyzeAndChainOperand: OperandAnalyzer = (
chain,
) => {
switch (operand.comparisonType) {
- case NullishComparisonType.Boolean: {
- const nextOperand = chain.at(index + 1);
- if (
- nextOperand?.comparisonType ===
- NullishComparisonType.NotStrictEqualNull &&
- operand.comparedName.type === AST_NODE_TYPES.Identifier
- ) {
- return null;
- }
- return [operand];
- }
-
+ case NullishComparisonType.Boolean:
case NullishComparisonType.NotEqualNullOrUndefined:
return [operand];
@@ -92,7 +150,8 @@ const analyzeAndChainOperand: OperandAnalyzer = (
return [operand, nextOperand];
}
if (
- includesType(
+ nextOperand &&
+ !includesType(
parserServices,
operand.comparedName,
ts.TypeFlags.Undefined,
@@ -101,10 +160,9 @@ const analyzeAndChainOperand: OperandAnalyzer = (
// we know the next operand is not an `undefined` check and that this
// operand includes `undefined` - which means that making this an
// optional chain would change the runtime behavior of the expression
- return null;
+ return [operand];
}
-
- return [operand];
+ return null;
}
case NullishComparisonType.NotStrictEqualUndefined: {
@@ -156,6 +214,7 @@ const analyzeOrChainOperand: OperandAnalyzer = (
) {
return [operand, nextOperand];
}
+
if (
includesType(
parserServices,
@@ -168,7 +227,6 @@ const analyzeOrChainOperand: OperandAnalyzer = (
// optional chain would change the runtime behavior of the expression
return null;
}
-
return [operand];
}
@@ -207,7 +265,7 @@ const analyzeOrChainOperand: OperandAnalyzer = (
* @returns The range to report.
*/
function getReportRange(
- chain: ValidOperand[],
+ chain: { node: TSESTree.Expression }[],
boundary: TSESTree.Range,
sourceCode: SourceCode,
): TSESTree.Range {
@@ -247,8 +305,10 @@ function getReportDescriptor(
node: TSESTree.Node,
operator: '&&' | '||',
options: PreferOptionalChainOptions,
- chain: ValidOperand[],
+ subChain: ValidOperand[],
+ lastChain: (LastChainOperand | ValidOperand) | undefined,
): ReportDescriptor {
+ const chain = lastChain ? [...subChain, lastChain] : subChain;
const lastOperand = chain[chain.length - 1];
let useSuggestionFixer: boolean;
@@ -264,6 +324,7 @@ function getReportDescriptor(
// `undefined`, or else we're going to change the final type - which is
// unsafe and might cause downstream type errors.
else if (
+ lastChain ||
lastOperand.comparisonType === NullishComparisonType.EqualNullOrUndefined ||
lastOperand.comparisonType ===
NullishComparisonType.NotEqualNullOrUndefined ||
@@ -521,10 +582,11 @@ export function analyzeChain(
node: TSESTree.Node,
operator: TSESTree.LogicalExpression['operator'],
chain: ValidOperand[],
+ lastChainOperand?: LastChainOperand,
): void {
// need at least 2 operands in a chain for it to be a chain
if (
- chain.length <= 1 ||
+ chain.length + (lastChainOperand ? 1 : 0) <= 1 ||
/* istanbul ignore next -- previous checks make this unreachable, but keep it for exhaustiveness check */
operator === '??'
) {
@@ -544,16 +606,20 @@ export function analyzeChain(
// Things like x !== null && x !== undefined have two nodes, but they are
// one logical unit here, so we'll allow them to be grouped.
let subChain: (readonly ValidOperand[] | ValidOperand)[] = [];
+ let lastChain: LastChainOperand | ValidOperand | undefined = undefined;
const maybeReportThenReset = (
newChainSeed?: readonly [ValidOperand, ...ValidOperand[]],
): void => {
- if (subChain.length > 1) {
+ if (subChain.length + (lastChain ? 1 : 0) > 1) {
const subChainFlat = subChain.flat();
+ const maybeNullishNodes = lastChain
+ ? subChainFlat.map(({ node }) => node)
+ : subChainFlat.slice(0, -1).map(({ node }) => node);
checkNullishAndReport(
context,
parserServices,
options,
- subChainFlat.slice(0, -1).map(({ node }) => node),
+ maybeNullishNodes,
getReportDescriptor(
context.sourceCode,
parserServices,
@@ -561,6 +627,7 @@ export function analyzeChain(
operator,
options,
subChainFlat,
+ lastChain,
),
);
}
@@ -578,6 +645,7 @@ export function analyzeChain(
// ^^^^^^^^^^^ newChainSeed
// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ second chain
subChain = newChainSeed ? [newChainSeed] : [];
+ lastChain = undefined;
};
for (let i = 0; i < chain.length; i += 1) {
@@ -595,6 +663,21 @@ export function analyzeChain(
// ^^^^^^^ invalid OR chain logical, but still part of
// the chain for combination purposes
+ if (lastOperand) {
+ const comparisonResult = compareNodes(
+ lastOperand.comparedName,
+ operand.comparedName,
+ );
+ switch (operand.comparisonType) {
+ case NullishComparisonType.StrictEqualUndefined:
+ case NullishComparisonType.NotStrictEqualUndefined: {
+ if (comparisonResult === NodeComparisonResult.Subset) {
+ lastChain = operand;
+ }
+ break;
+ }
+ }
+ }
maybeReportThenReset();
continue;
}
@@ -624,7 +707,28 @@ export function analyzeChain(
subChain.push(currentOperand);
}
}
+ const lastOperand = subChain.flat().at(-1);
+ if (lastOperand && lastChainOperand) {
+ const comparisonResult = compareNodes(
+ lastOperand.comparedName,
+ lastChainOperand.comparedName,
+ );
+ const isValidLastChainOperand =
+ operator === '&&'
+ ? isValidAndLastChainOperand
+ : isValidOrLastChainOperand;
+ if (
+ comparisonResult === NodeComparisonResult.Subset &&
+ isValidLastChainOperand(
+ lastChainOperand.comparisonValue,
+ lastChainOperand.comparisonType,
+ parserServices,
+ )
+ ) {
+ lastChain = lastChainOperand;
+ }
+ }
// check the leftovers
maybeReportThenReset();
}
diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts
index 174f8982cad8..9092e1e67a75 100644
--- a/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts
+++ b/packages/eslint-plugin/src/rules/prefer-optional-chain-utils/gatherLogicalOperands.ts
@@ -25,6 +25,7 @@ const enum ComparisonValueType {
}
export const enum OperandValidity {
Valid = 'Valid',
+ Last = 'Last',
Invalid = 'Invalid',
}
export const enum NullishComparisonType {
@@ -48,6 +49,12 @@ export const enum NullishComparisonType {
/** `x` */
Boolean = 'Boolean', // eslint-disable-line @typescript-eslint/internal/prefer-ast-types-enum
}
+export const enum ComparisonType {
+ NotEqual = 'NotEqual',
+ Equal = 'Equal',
+ NotStrictEqual = 'NotStrictEqual',
+ StrictEqual = 'StrictEqual',
+}
export interface ValidOperand {
comparedName: TSESTree.Node;
comparisonType: NullishComparisonType;
@@ -55,10 +62,18 @@ export interface ValidOperand {
node: TSESTree.Expression;
type: OperandValidity.Valid;
}
+export interface LastChainOperand {
+ comparedName: TSESTree.Node;
+ comparisonType: ComparisonType;
+ comparisonValue: TSESTree.Node;
+ isYoda: boolean;
+ node: TSESTree.BinaryExpression;
+ type: OperandValidity.Last;
+}
export interface InvalidOperand {
type: OperandValidity.Invalid;
}
-type Operand = InvalidOperand | ValidOperand;
+type Operand = InvalidOperand | LastChainOperand | ValidOperand;
const NULLISH_FLAGS = ts.TypeFlags.Null | ts.TypeFlags.Undefined;
function isValidFalseBooleanCheckType(
@@ -182,61 +197,101 @@ export function gatherLogicalOperands(
continue;
}
- switch (operand.operator) {
- case '!=':
- case '==':
- if (
- comparedValue === ComparisonValueType.Null ||
- comparedValue === ComparisonValueType.Undefined
- ) {
- // x == null, x == undefined
- result.push({
- comparedName: comparedExpression,
- comparisonType: operand.operator.startsWith('!')
- ? NullishComparisonType.NotEqualNullOrUndefined
- : NullishComparisonType.EqualNullOrUndefined,
- isYoda,
- node: operand,
- type: OperandValidity.Valid,
- });
- continue;
- }
- // x == something :(
- result.push({ type: OperandValidity.Invalid });
- continue;
-
- case '!==':
- case '===': {
- const comparedName = comparedExpression;
- switch (comparedValue) {
- case ComparisonValueType.Null:
+ if (operand.operator.startsWith('!') !== (node.operator === '||')) {
+ switch (operand.operator) {
+ case '!=':
+ case '==':
+ if (
+ comparedValue === ComparisonValueType.Null ||
+ comparedValue === ComparisonValueType.Undefined
+ ) {
+ // x == null, x == undefined
result.push({
- comparedName,
+ comparedName: comparedExpression,
comparisonType: operand.operator.startsWith('!')
- ? NullishComparisonType.NotStrictEqualNull
- : NullishComparisonType.StrictEqualNull,
+ ? NullishComparisonType.NotEqualNullOrUndefined
+ : NullishComparisonType.EqualNullOrUndefined,
isYoda,
node: operand,
type: OperandValidity.Valid,
});
continue;
+ }
+ break;
+
+ case '!==':
+ case '===': {
+ const comparedName = comparedExpression;
+ switch (comparedValue) {
+ case ComparisonValueType.Null:
+ result.push({
+ comparedName,
+ comparisonType: operand.operator.startsWith('!')
+ ? NullishComparisonType.NotStrictEqualNull
+ : NullishComparisonType.StrictEqualNull,
+ isYoda,
+ node: operand,
+ type: OperandValidity.Valid,
+ });
+ continue;
+
+ case ComparisonValueType.Undefined:
+ result.push({
+ comparedName,
+ comparisonType: operand.operator.startsWith('!')
+ ? NullishComparisonType.NotStrictEqualUndefined
+ : NullishComparisonType.StrictEqualUndefined,
+ isYoda,
+ node: operand,
+ type: OperandValidity.Valid,
+ });
+ continue;
+ }
+ }
+ }
+ }
- case ComparisonValueType.Undefined:
- result.push({
- comparedName,
- comparisonType: operand.operator.startsWith('!')
- ? NullishComparisonType.NotStrictEqualUndefined
- : NullishComparisonType.StrictEqualUndefined,
- isYoda,
- node: operand,
- type: OperandValidity.Valid,
- });
- continue;
+ // x == something :(
+ // x === something :(
+ // x != something :(
+ // x !== something :(
+ const binaryComparisonChain = getBinaryComparisonChain(operand);
+ if (binaryComparisonChain) {
+ const { comparedName, comparedValue, isYoda } = binaryComparisonChain;
+
+ switch (operand.operator) {
+ case '==':
+ case '===': {
+ const comparisonType =
+ operand.operator === '=='
+ ? ComparisonType.Equal
+ : ComparisonType.StrictEqual;
+ result.push({
+ comparedName,
+ comparisonType,
+ comparisonValue: comparedValue,
+ isYoda,
+ node: operand,
+ type: OperandValidity.Last,
+ });
+ continue;
+ }
- default:
- // x === something :(
- result.push({ type: OperandValidity.Invalid });
- continue;
+ case '!=':
+ case '!==': {
+ const comparisonType =
+ operand.operator === '!='
+ ? ComparisonType.NotEqual
+ : ComparisonType.NotStrictEqual;
+ result.push({
+ comparedName,
+ comparisonType,
+ comparisonValue: comparedValue,
+ isYoda,
+ node: operand,
+ type: OperandValidity.Last,
+ });
+ continue;
}
}
}
@@ -248,12 +303,13 @@ export function gatherLogicalOperands(
case AST_NODE_TYPES.UnaryExpression:
if (
operand.operator === '!' &&
- isValidFalseBooleanCheckType(
- operand.argument,
- areMoreOperands && node.operator === '||',
- parserServices,
- options,
- )
+ (!areMoreOperands ||
+ isValidFalseBooleanCheckType(
+ operand.argument,
+ node.operator === '||',
+ parserServices,
+ options,
+ ))
) {
result.push({
comparedName: operand.argument,
@@ -274,9 +330,10 @@ export function gatherLogicalOperands(
default:
if (
+ !areMoreOperands ||
isValidFalseBooleanCheckType(
operand,
- areMoreOperands && node.operator === '&&',
+ node.operator === '&&',
parserServices,
options,
)
@@ -372,4 +429,32 @@ export function gatherLogicalOperands(
return null;
}
+
+ function getBinaryComparisonChain(node: TSESTree.BinaryExpression) {
+ const { left, right } = node;
+ let isYoda = false;
+ const isLeftMemberExpression =
+ left.type === AST_NODE_TYPES.MemberExpression;
+ const isRightMemberExpression =
+ right.type === AST_NODE_TYPES.MemberExpression;
+ if (isLeftMemberExpression && !isRightMemberExpression) {
+ const [comparedName, comparedValue] = [left, right];
+ return {
+ comparedName,
+ comparedValue,
+ isYoda,
+ };
+ }
+ if (!isLeftMemberExpression && isRightMemberExpression) {
+ const [comparedName, comparedValue] = [right, left];
+
+ isYoda = true;
+ return {
+ comparedName,
+ comparedValue,
+ isYoda,
+ };
+ }
+ return null;
+ }
}
diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
index ffbcd213fedd..c3d61c0f0f70 100644
--- a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
+++ b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts
@@ -109,7 +109,6 @@ export default createRule<
const seenLogicals = new Set();
return {
- // specific handling for `(foo ?? {}).bar` / `(foo || {}).bar`
'LogicalExpression[operator!="??"]'(
node: TSESTree.LogicalExpression,
): void {
@@ -139,6 +138,17 @@ export default createRule<
currentChain,
);
currentChain = [];
+ } else if (operand.type === OperandValidity.Last) {
+ analyzeChain(
+ context,
+ parserServices,
+ options,
+ node,
+ node.operator,
+ currentChain,
+ operand,
+ );
+ currentChain = [];
} else {
currentChain.push(operand);
}
@@ -157,6 +167,7 @@ export default createRule<
}
},
+ // specific handling for `(foo ?? {}).bar` / `(foo || {}).bar`
'LogicalExpression[operator="||"], LogicalExpression[operator="??"]'(
node: TSESTree.LogicalExpression,
): void {
@@ -186,6 +197,7 @@ export default createRule<
return leftPrecedence < OperatorPrecedence.LeftHandSide;
}
+
checkNullishAndReport(context, parserServices, options, [leftNode], {
node: parentNode,
messageId: 'preferOptionalChain',
diff --git a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts
index 71e5efe2f74d..47c4dfaa023b 100644
--- a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts
+++ b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts
@@ -7,6 +7,7 @@ import type { TypeOrValueSpecifier } from '../util';
import {
createRule,
getParserServices,
+ isTypeBrandedLiteralLike,
isTypeReadonly,
readonlynessOptionsDefaults,
readonlynessOptionsSchema,
@@ -129,7 +130,7 @@ export default createRule({
treatMethodsAsReadonly: !!treatMethodsAsReadonly,
});
- if (!isReadOnly) {
+ if (!isReadOnly && !isTypeBrandedLiteralLike(type)) {
context.report({
node: actualParam,
messageId: 'shouldBeReadonly',
diff --git a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts
index 7d7b14044cfb..ef5733fd47ff 100644
--- a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts
+++ b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts
@@ -1,6 +1,7 @@
import type { TSESTree } from '@typescript-eslint/utils';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
+import { isUnionType } from 'ts-api-utils';
import * as ts from 'typescript';
import { createRule, forEachReturnStatement, getParserServices } from '../util';
@@ -116,6 +117,14 @@ export default createRule({
return;
}
+ if (
+ isUnionType(type) &&
+ type.types.some(typePart => typePart === classType)
+ ) {
+ hasReturnClassType = true;
+ return true;
+ }
+
return;
});
diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts
index ee946a4f85a0..8d15ad78e574 100644
--- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts
+++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts
@@ -1,4 +1,8 @@
-import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
+import type {
+ NodeWithParent,
+ TSESLint,
+ TSESTree,
+} from '@typescript-eslint/utils';
import { RegExpParser } from '@eslint-community/regexpp';
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
@@ -96,7 +100,7 @@ export default createRule({
value: number,
): node is TSESTree.Literal {
const evaluated = getStaticValue(node, globalScope);
- return evaluated != null && evaluated.value === value;
+ return evaluated?.value === value;
}
/**
@@ -376,13 +380,10 @@ export default createRule({
yield fixer.removeRange([callNode.range[1], node.range[1]]);
}
- function getParent(node: TSESTree.Node): TSESTree.Node {
- return nullThrows(
- node.parent?.type === AST_NODE_TYPES.ChainExpression
- ? node.parent.parent
- : node.parent,
- NullThrowsReasons.MissingParent,
- );
+ function getParent(node: NodeWithParent): TSESTree.Node {
+ return node.parent.type === AST_NODE_TYPES.ChainExpression
+ ? node.parent.parent
+ : node.parent;
}
return {
diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts
index 1739e1508937..aca8a2f924f7 100644
--- a/packages/eslint-plugin/src/rules/promise-function-async.ts
+++ b/packages/eslint-plugin/src/rules/promise-function-async.ts
@@ -208,14 +208,16 @@ export default createRule({
);
}
- // if current token is a keyword like `static` or `public` then skip it
+ // if current token is a keyword like `static` or `public`, or the `override` modifier, then skip it
while (
- keyToken.type === AST_TOKEN_TYPES.Keyword &&
+ (keyToken.type === AST_TOKEN_TYPES.Keyword ||
+ (keyToken.type === AST_TOKEN_TYPES.Identifier &&
+ keyToken.value === 'override')) &&
keyToken.range[0] < method.key.range[0]
) {
keyToken = nullThrows(
context.sourceCode.getTokenAfter(keyToken),
- NullThrowsReasons.MissingToken('token', 'keyword'),
+ NullThrowsReasons.MissingToken('token', 'modifier keyword'),
);
}
diff --git a/packages/eslint-plugin/src/rules/return-await.ts b/packages/eslint-plugin/src/rules/return-await.ts
index 0ee20eea92a8..f1312c9915f5 100644
--- a/packages/eslint-plugin/src/rules/return-await.ts
+++ b/packages/eslint-plugin/src/rules/return-await.ts
@@ -267,9 +267,9 @@ export default createRule({
function insertAwait(
fixer: TSESLint.RuleFixer,
node: TSESTree.Expression,
- isHighPrecendence: boolean,
+ isHighPrecedence: boolean,
): TSESLint.RuleFix | TSESLint.RuleFix[] {
- if (isHighPrecendence) {
+ if (isHighPrecedence) {
return fixer.insertTextBefore(node, 'await ');
}
return [
diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts
index c46ec9ff1e76..a952ef44fd24 100644
--- a/packages/eslint-plugin/src/rules/typedef.ts
+++ b/packages/eslint-plugin/src/rules/typedef.ts
@@ -23,6 +23,10 @@ export default createRule({
name: 'typedef',
meta: {
type: 'suggestion',
+ deprecated: {
+ deprecatedSince: '8.33.0',
+ message: 'This is an old rule that is no longer recommended for use.',
+ },
docs: {
description: 'Require type annotations in certain places',
},
diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts
index f92061f148d4..49f8dbe23802 100644
--- a/packages/eslint-plugin/src/rules/unbound-method.ts
+++ b/packages/eslint-plugin/src/rules/unbound-method.ts
@@ -100,8 +100,10 @@ const isNotImported = (
);
};
-const BASE_MESSAGE =
- 'Avoid referencing unbound methods which may cause unintentional scoping of `this`.';
+const BASE_MESSAGE = [
+ `A method that is not declared with \`this: void\` may cause unintentional scoping of \`this\` when separated from its object.`,
+ `Consider using an arrow function or explicitly \`.bind()\`ing the method to avoid calling the method with an unintended \`this\` value. `,
+].join('\n');
export default createRule({
name: 'unbound-method',
@@ -115,7 +117,7 @@ export default createRule({
},
messages: {
unbound: BASE_MESSAGE,
- unboundWithoutThisAnnotation: `${BASE_MESSAGE}\nIf your function does not access \`this\`, you can annotate it with \`this: void\`, or consider using an arrow function instead.`,
+ unboundWithoutThisAnnotation: `${BASE_MESSAGE}\nIf a function does not access \`this\`, it can be annotated with \`this: void\`.`,
},
schema: [
{
diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts
index 809b19dd1aa6..47e148197f1b 100644
--- a/packages/eslint-plugin/src/rules/unified-signatures.ts
+++ b/packages/eslint-plugin/src/rules/unified-signatures.ts
@@ -241,9 +241,8 @@ export default createRule({
}
if (ignoreOverloadsWithDifferentJSDoc) {
- const aComment = getBlockCommentForNode(getExportingNode(a) ?? a);
- const bComment = getBlockCommentForNode(getExportingNode(b) ?? b);
-
+ const aComment = getBlockCommentForNode(getCommentTargetNode(a));
+ const bComment = getBlockCommentForNode(getCommentTargetNode(b));
if (aComment?.value !== bComment?.value) {
return false;
}
@@ -657,6 +656,14 @@ export default createRule({
},
});
+function getCommentTargetNode(node: SignatureDefinition) {
+ if (node.type === AST_NODE_TYPES.TSEmptyBodyFunctionExpression) {
+ return node.parent;
+ }
+
+ return getExportingNode(node) ?? node;
+}
+
function getExportingNode(
node: SignatureDefinition,
):
diff --git a/packages/eslint-plugin/src/util/astUtils.ts b/packages/eslint-plugin/src/util/astUtils.ts
index c2450ae30130..1d8500052634 100644
--- a/packages/eslint-plugin/src/util/astUtils.ts
+++ b/packages/eslint-plugin/src/util/astUtils.ts
@@ -11,9 +11,9 @@ export * from '@typescript-eslint/utils/ast-utils';
// https://github.com/eslint/eslint/blob/145aec1ab9052fbca96a44d04927c595951b1536/lib/rules/utils/ast-utils.js#L1751-L1779
// Could be export { getNameLocationInGlobalDirectiveComment } from 'eslint/lib/rules/utils/ast-utils'
/**
- * Get the `loc` object of a given name in a `/*globals` directive comment.
+ * Get the `loc` object of a given name in a `/*globals` comment directive.
* @param sourceCode The source code to convert index to loc.
- * @param comment The `/*globals` directive comment which include the name.
+ * @param comment The `/*globals` comment directive which include the name.
* @param name The name to find.
* @returns The `loc` object.
*/
diff --git a/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts
index d61b121fa5ba..c98529f68a63 100644
--- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts
+++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts
@@ -188,7 +188,7 @@ class UnusedVarsVisitor extends Visitor {
// basic exported variables
isExported(variable) ||
// variables implicitly exported via a merged declaration
- isMergableExported(variable) ||
+ isMergeableExported(variable) ||
// used variables
isUsedVariable(variable)
) {
@@ -230,9 +230,7 @@ class UnusedVarsVisitor extends Visitor {
private markVariableAsUsed(
variableOrIdentifier: ScopeVariable | TSESTree.Identifier,
): void;
-
private markVariableAsUsed(name: string, parent: TSESTree.Node): void;
-
private markVariableAsUsed(
variableOrIdentifierOrName: string | ScopeVariable | TSESTree.Identifier,
parent?: TSESTree.Node,
@@ -417,7 +415,7 @@ function isSelfReference(
return false;
}
-const MERGABLE_TYPES = new Set([
+const MERGEABLE_TYPES = new Set([
AST_NODE_TYPES.ClassDeclaration,
AST_NODE_TYPES.FunctionDeclaration,
AST_NODE_TYPES.TSInterfaceDeclaration,
@@ -428,7 +426,7 @@ const MERGABLE_TYPES = new Set([
* Determine if the variable is directly exported
* @param variable the variable to check
*/
-function isMergableExported(variable: ScopeVariable): boolean {
+function isMergeableExported(variable: ScopeVariable): boolean {
// If all of the merged things are of the same type, TS will error if not all of them are exported - so we only need to find one
for (const def of variable.defs) {
// parameters can never be exported.
@@ -439,9 +437,9 @@ function isMergableExported(variable: ScopeVariable): boolean {
}
if (
- (MERGABLE_TYPES.has(def.node.type) &&
- def.node.parent?.type === AST_NODE_TYPES.ExportNamedDeclaration) ||
- def.node.parent?.type === AST_NODE_TYPES.ExportDefaultDeclaration
+ (MERGEABLE_TYPES.has(def.node.type) &&
+ def.node.parent.type === AST_NODE_TYPES.ExportNamedDeclaration) ||
+ def.node.parent.type === AST_NODE_TYPES.ExportDefaultDeclaration
) {
return true;
}
@@ -460,14 +458,12 @@ function isExported(variable: ScopeVariable): boolean {
let node = definition.node;
if (node.type === AST_NODE_TYPES.VariableDeclarator) {
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- node = node.parent!;
+ node = node.parent;
} else if (definition.type === TSESLint.Scope.DefinitionType.Parameter) {
return false;
}
- // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
- return node.parent!.type.startsWith('Export');
+ return node.parent.type.startsWith('Export');
});
}
diff --git a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
index 0e3b98ef7657..b9aeb65dbede 100644
--- a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
+++ b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts
@@ -1,10 +1,6 @@
import type { TSESLint, TSESTree } from '@typescript-eslint/utils';
-import {
- AST_NODE_TYPES,
- ASTUtils,
- ESLintUtils,
-} from '@typescript-eslint/utils';
+import { AST_NODE_TYPES, ASTUtils } from '@typescript-eslint/utils';
import { isConstructor, isSetter, isTypeAssertion } from './astUtils';
import { getFunctionHeadLoc } from './getFunctionHeadLoc';
@@ -210,19 +206,14 @@ export function isTypedFunctionExpression(
node: FunctionExpression,
options: Options,
): boolean {
- const parent = ESLintUtils.nullThrows(
- node.parent,
- ESLintUtils.NullThrowsReasons.MissingParent,
- );
-
if (!options.allowTypedFunctionExpressions) {
return false;
}
return (
- isTypedParent(parent, node) ||
- isPropertyOfObjectWithType(parent) ||
- isConstructorArgument(parent)
+ isTypedParent(node.parent, node) ||
+ isPropertyOfObjectWithType(node.parent) ||
+ isConstructorArgument(node.parent)
);
}
@@ -238,16 +229,12 @@ export function isValidFunctionExpressionReturnType(
return true;
}
- const parent = ESLintUtils.nullThrows(
- node.parent,
- ESLintUtils.NullThrowsReasons.MissingParent,
- );
if (
options.allowExpressions &&
- parent.type !== AST_NODE_TYPES.VariableDeclarator &&
- parent.type !== AST_NODE_TYPES.MethodDefinition &&
- parent.type !== AST_NODE_TYPES.ExportDefaultDeclaration &&
- parent.type !== AST_NODE_TYPES.PropertyDefinition
+ node.parent.type !== AST_NODE_TYPES.VariableDeclarator &&
+ node.parent.type !== AST_NODE_TYPES.MethodDefinition &&
+ node.parent.type !== AST_NODE_TYPES.ExportDefaultDeclaration &&
+ node.parent.type !== AST_NODE_TYPES.PropertyDefinition
) {
return true;
}
diff --git a/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts b/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts
index 49ab2b742dd9..53987cddc37b 100644
--- a/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts
+++ b/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts
@@ -154,8 +154,8 @@ export function getFunctionHeadLoc(
sourceCode: TSESLint.SourceCode,
): TSESTree.SourceLocation {
const parent = node.parent;
- let start: TSESTree.Position | null = null;
- let end: TSESTree.Position | null = null;
+ let start: TSESTree.Position;
+ let end: TSESTree.Position;
if (
parent.type === AST_NODE_TYPES.MethodDefinition ||
diff --git a/packages/eslint-plugin/src/util/getOperatorPrecedence.ts b/packages/eslint-plugin/src/util/getOperatorPrecedence.ts
index 950708015d89..54b40af26e28 100644
--- a/packages/eslint-plugin/src/util/getOperatorPrecedence.ts
+++ b/packages/eslint-plugin/src/util/getOperatorPrecedence.ts
@@ -198,6 +198,10 @@ export enum OperatorPrecedence {
Invalid = -1,
}
+/**
+ * Note that this does not take into account parenthesization. You should check
+ * for parenthesization separately if it's relevant to your usage.
+ */
export function getOperatorPrecedenceForNode(
node: TSESTree.Node,
): OperatorPrecedence {
diff --git a/packages/eslint-plugin/src/util/isPromiseAggregatorMethod.ts b/packages/eslint-plugin/src/util/isPromiseAggregatorMethod.ts
new file mode 100644
index 000000000000..e5f9e67617d6
--- /dev/null
+++ b/packages/eslint-plugin/src/util/isPromiseAggregatorMethod.ts
@@ -0,0 +1,41 @@
+import type {
+ ParserServicesWithTypeInformation,
+ TSESTree,
+} from '@typescript-eslint/utils';
+import type { RuleContext } from '@typescript-eslint/utils/ts-eslint';
+
+import {
+ getConstrainedTypeAtLocation,
+ isPromiseConstructorLike,
+} from '@typescript-eslint/type-utils';
+import { AST_NODE_TYPES } from '@typescript-eslint/utils';
+
+import { getStaticMemberAccessValue } from './misc';
+
+const PROMISE_CONSTRUCTOR_ARRAY_METHODS = new Set([
+ 'all',
+ 'allSettled',
+ 'race',
+ 'any',
+]);
+
+export function isPromiseAggregatorMethod(
+ context: RuleContext,
+ services: ParserServicesWithTypeInformation,
+ node: TSESTree.CallExpression,
+): boolean {
+ if (node.callee.type !== AST_NODE_TYPES.MemberExpression) {
+ return false;
+ }
+
+ const staticAccessValue = getStaticMemberAccessValue(node.callee, context);
+
+ if (!PROMISE_CONSTRUCTOR_ARRAY_METHODS.has(staticAccessValue)) {
+ return false;
+ }
+
+ return isPromiseConstructorLike(
+ services.program,
+ getConstrainedTypeAtLocation(services, node.callee.object),
+ );
+}
diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts
index bc0317c8a466..c2e314860ae3 100644
--- a/packages/eslint-plugin/tests/RuleTester.ts
+++ b/packages/eslint-plugin/tests/RuleTester.ts
@@ -1,85 +1,37 @@
-import type {
- InvalidTestCase,
- ValidTestCase,
-} from '@typescript-eslint/rule-tester';
+import type { ParserOptions } from '@typescript-eslint/utils/ts-eslint';
+import { RuleTester } from '@typescript-eslint/rule-tester';
import * as path from 'node:path';
-export function getFixturesRootDir(): string {
- return path.join(__dirname, 'fixtures');
+export function createRuleTesterWithTypes(
+ providedParserOptions: ParserOptions | undefined = {},
+): RuleTester {
+ const parserOptions = {
+ ...providedParserOptions,
+ tsconfigRootDir:
+ providedParserOptions.tsconfigRootDir ?? getFixturesRootDir(),
+ };
+
+ // If the test has requested a specific project, disable projectService
+ // (regardless of whether it's being switched to by TYPESCRIPT_ESLINT_PROJECT_SERVICE)
+ if (parserOptions.project) {
+ parserOptions.projectService = false;
+ }
+ // Otherwise, use the project service for types if requested in the env
+ else if (process.env.TYPESCRIPT_ESLINT_PROJECT_SERVICE) {
+ parserOptions.projectService = true;
+ }
+ // Finally, default to project: true as the standard (legacy) behavior
+ // See: https://github.com/typescript-eslint/typescript-eslint/issues/11676
+ else {
+ parserOptions.project = true;
+ }
+
+ return new RuleTester({
+ languageOptions: { parserOptions },
+ });
}
-/**
- * Converts a batch of single line tests into a number of separate test cases.
- * This makes it easier to write tests which use the same options.
- *
- * Why wouldn't you just leave them as one test?
- * Because it makes the test error messages harder to decipher.
- * This way each line will fail separately, instead of them all failing together.
- *
- * @deprecated - DO NOT USE THIS FOR NEW RULES
- */
-export function batchedSingleLineTests(
- test: ValidTestCase,
-): ValidTestCase[];
-/**
- * Converts a batch of single line tests into a number of separate test cases.
- * This makes it easier to write tests which use the same options.
- *
- * Why wouldn't you just leave them as one test?
- * Because it makes the test error messages harder to decipher.
- * This way each line will fail separately, instead of them all failing together.
- *
- * Make sure you have your line numbers correct for error reporting, as it will match
- * the line numbers up with the split tests!
- *
- * @deprecated - DO NOT USE THIS FOR NEW RULES
- */
-export function batchedSingleLineTests<
- MessageIds extends string,
- Options extends readonly unknown[],
->(
- test: InvalidTestCase,
-): InvalidTestCase[];
-export function batchedSingleLineTests<
- MessageIds extends string,
- Options extends readonly unknown[],
->(
- options:
- | ({
- output?: string | null;
- } & Omit, 'output'>)
- | ValidTestCase,
-): (InvalidTestCase | ValidTestCase)[] {
- // -- eslint counts lines from 1
- const lineOffset = options.code.startsWith('\n') ? 2 : 1;
- const output =
- 'output' in options && options.output
- ? options.output.trim().split('\n')
- : null;
- return options.code
- .trim()
- .split('\n')
- .map((code, i) => {
- const lineNum = i + lineOffset;
- const errors =
- 'errors' in options
- ? options.errors.filter(e => e.line === lineNum)
- : [];
- const returnVal = {
- ...options,
- code,
- errors: errors.map(e => ({
- ...e,
- line: 1,
- })),
- };
- if (output?.[i]) {
- return {
- ...returnVal,
- output: output[i],
- };
- }
- return returnVal;
- });
+export function getFixturesRootDir(): string {
+ return path.join(__dirname, 'fixtures');
}
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-base-to-string.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-base-to-string.shot
index ac8bfaecc474..ae8614ebe762 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-base-to-string.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-base-to-string.shot
@@ -56,3 +56,9 @@ let value = /regex/;
value.toString();
let text = `${value}`;
String(/regex/);
+
+Options: { "checkUnknown": true }
+
+declare const x: unknown;
+String(x);
+ ~ 'x' may use Object's default stringification format ('[object Object]') when stringified.
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-floating-promises.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-floating-promises.shot
index 8cdd60d375d6..9a5130ce0c07 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-floating-promises.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-floating-promises.shot
@@ -135,4 +135,3 @@ Options: {"allowForKnownSafeCalls":[{"from":"file","name":"safe","path":"input.t
declare function safe(...args: unknown[]): Promise;
safe('...', () => {});
-~~~~~~~~~~~~~~~~~~~~~~ Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler or be explicitly marked as ignored with the `void` operator.
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot
index 3d0a679af53c..4eca533783eb 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-promises.shot
@@ -130,14 +130,14 @@ Options: { "checksSpreads": true }
const getData = () => fetch('/');
console.log({ foo: 42, ...getData() });
- ~~~~~~~~~ Expected a non-Promise value to be spreaded in an object.
+ ~~~~~~~~~ Expected a non-Promise value to be spread in an object.
const awaitData = async () => {
await fetch('/');
};
console.log({ foo: 42, ...awaitData() });
- ~~~~~~~~~~~ Expected a non-Promise value to be spreaded in an object.
+ ~~~~~~~~~~~ Expected a non-Promise value to be spread in an object.
Correct
Options: { "checksSpreads": true }
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot
index 591c08061e87..78c83f38a361 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-misused-spread.shot
@@ -4,7 +4,7 @@ declare const promise: Promise;
const spreadPromise = { ...promise };
~~~~~~~~~~ Using the spread operator on Promise in an object can cause unexpected behavior. Did you forget to await the promise?
-declare function getObject(): Record;
+declare function getObject(): Record;
const getObjectSpread = { ...getObject };
~~~~~~~~~~~~ Using the spread operator on a function without additional properties can cause unexpected behavior. Did you forget to call the function?
@@ -37,7 +37,7 @@ Correct
declare const promise: Promise;
const spreadPromise = { ...(await promise) };
-declare function getObject(): Record;
+declare function getObject(): Record;
const getObjectSpread = { ...getObject() };
declare const map: Map;
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unnecessary-type-conversion.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unnecessary-type-conversion.shot
index 1231d273a43f..7d55981cea0f 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unnecessary-type-conversion.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unnecessary-type-conversion.shot
@@ -14,7 +14,7 @@ Number(123);
+123;
~ Using the unary + operator on a number does not change the type or value of the number.
~~123;
-~~ Using ~~ on a number does not change the type or value of the number.
+~~ Using ~~ on an integer does not change the type or value of the number.
Boolean(true);
~~~~~~~ Passing a boolean to Boolean() does not change the type or value of the boolean.
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot
index fee1bc00f418..91a7260593f1 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/no-unsafe-member-access.shot
@@ -43,3 +43,20 @@ arr[1];
let idx = 1;
arr[idx];
arr[idx++];
+
+Incorrect
+
+declare const outer: any;
+
+outer.inner;
+ ~~~~~ Unsafe member access .inner on an `any` value.
+outer.middle.inner;
+ ~~~~~~ Unsafe member access .middle on an `any` value.
+
+Correct
+Options: { "allowOptionalChaining": true }
+
+declare const outer: any;
+
+outer?.inner;
+outer?.middle?.inner;
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/only-throw-error.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/only-throw-error.shot
index a80221b72f8e..b91ec3c08a90 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/only-throw-error.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/only-throw-error.shot
@@ -9,32 +9,24 @@ throw 0;
throw undefined;
~~~~~~~~~ Do not throw undefined.
-throw null;
- ~~~~ Expected an error object to be thrown.
-
-const err = new Error();
-throw 'an ' + err;
- ~~~~~~~~~~~ Expected an error object to be thrown.
-
-const err = new Error();
-throw `${err}`;
- ~~~~~~~~ Expected an error object to be thrown.
-
-const err = '';
-throw err;
-
-function getError() {
+function getErrorString(): string {
return '';
}
-throw getError();
- ~~~~~~~~~~ Expected an error object to be thrown.
+throw getErrorString();
+ ~~~~~~~~~~~~~~~~ Expected an error object to be thrown.
const foo = {
- bar: '',
+ bar: 'error string',
};
throw foo.bar;
~~~~~~~ Expected an error object to be thrown.
+class SomeClass {
+ // ...
+}
+throw new SomeClass();
+ ~~~~~~~~~~~~~~~ Expected an error object to be thrown.
+
Correct
throw new Error();
@@ -44,15 +36,6 @@ throw new Error('error');
const e = new Error('error');
throw e;
-try {
- throw new Error('error');
-} catch (e) {
- throw e;
-}
-
-const err = new Error();
-throw err;
-
function getError() {
return new Error();
}
@@ -67,3 +50,71 @@ class CustomError extends Error {
// ...
}
throw new CustomError();
+
+Options: { "allowThrowingAny": true }
+
+function throwAny(value: any) {
+ throw value;
+}
+
+Options: { "allowThrowingUnknown": true }
+
+function throwUnknown(value: unknown) {
+ throw value;
+}
+
+Options: { "allowRethrowing": true, "allowThrowingAny": false, "allowThrowingUnknown": false }
+
+declare function mightThrow(): void;
+declare class SomeSpecificError extends Error {
+ // ...
+}
+
+function foo() {
+ try {
+ mightThrow();
+ } catch (e) {
+ if (e instanceof SomeSpecificError) {
+ // handle specific error ...
+ return;
+ }
+
+ // unexpected error that we shouldn't catch.
+ throw e;
+ }
+}
+
+declare function mightReject(): Promise;
+
+mightReject().catch(e => {
+ if (e instanceof SomeSpecificError) {
+ // handle specific error ...
+ return;
+ }
+
+ // unexpected error that we can't handle
+ throw e;
+});
+
+declare function log(message: string): void;
+
+function bar() {
+ log('starting bar()');
+ let wasError = false;
+ try {
+ // ...
+ } catch (e) {
+ wasError = true;
+ throw e;
+ } finally {
+ log(`completed bar() ${wasError ? 'with error' : 'successfully'}`);
+ }
+}
+
+Options: { "allow": [{ "from": "file", "name": "CustomError" }] }
+
+class CustomError /* does NOT extend Error */ {
+ // ...
+}
+
+throw new CustomError();
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot
index 8607ddca5bca..657b431aa542 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/prefer-optional-chain.shot
@@ -26,14 +26,8 @@ foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Prefer using an optional chain expression instead, as it's more concise and easier to read.
// this rule also supports converting chained strict nullish checks:
-foo &&
-~~~~~~ Prefer using an optional chain expression instead, as it's more concise and easier to read.
- foo.a != null &&
-~~~~~~~~~~~~~~~
- foo.a.b !== null &&
- foo.a.b.c != undefined &&
- foo.a.b.c.d !== undefined &&
- foo.a.b.c.d.e;
+foo.a !== null && foo.a !== undefined && foo.a.b;
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Prefer using an optional chain expression instead, as it's more concise and easier to read.
Correct
@@ -47,6 +41,8 @@ foo?.a?.b?.c?.d?.e;
!foo?.[bar];
!foo?.bar?.baz?.();
+foo?.a != null;
+
Options: { "allowPotentiallyUnsafeFixesThatModifyTheReturnTypeIKnowWhatImDoing": true }
declare const foo: { bar: boolean } | null | undefined;
diff --git a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot
index 13afc36a6e62..54db9a5b5cb7 100644
--- a/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot
+++ b/packages/eslint-plugin/tests/docs-eslint-output-snapshots/unbound-method.shot
@@ -10,14 +10,16 @@ const instance = new MyClass();
// This logs the global scope (`window`/`global`), not the class instance
const myLog = instance.log;
- ~~~~~~~~~~~~ Avoid referencing unbound methods which may cause unintentional scoping of `this`.
- If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead.
+ ~~~~~~~~~~~~ A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.
+ Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value.
+ If a function does not access `this`, it can be annotated with `this: void`.
myLog();
// This log might later be called with an incorrect scope
const { log } = instance;
- ~~~ Avoid referencing unbound methods which may cause unintentional scoping of `this`.
- If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead.
+ ~~~ A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.
+ Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value.
+ If a function does not access `this`, it can be annotated with `this: void`.
// arith.double may refer to `this` internally
const arith = {
@@ -26,8 +28,9 @@ const arith = {
},
};
const { double } = arith;
- ~~~~~~ Avoid referencing unbound methods which may cause unintentional scoping of `this`.
- If your function does not access `this`, you can annotate it with `this: void`, or consider using an arrow function instead.
+ ~~~~~~ A method that is not declared with `this: void` may cause unintentional scoping of `this` when separated from its object.
+ Consider using an arrow function or explicitly `.bind()`ing the method to avoid calling the method with an unintended `this` value.
+ If a function does not access `this`, it can be annotated with `this: void`.
Correct
diff --git a/packages/eslint-plugin/tests/docs.test.mts b/packages/eslint-plugin/tests/docs.test.mts
index ea12c3e02179..20693dd21762 100644
--- a/packages/eslint-plugin/tests/docs.test.mts
+++ b/packages/eslint-plugin/tests/docs.test.mts
@@ -428,6 +428,7 @@ describe('Validating rule docs', () => {
parserOptions: {
disallowAutomaticSingleRunInference: true,
project: './tsconfig.json',
+ projectService: false,
tsconfigRootDir: FIXTURES_DIR,
},
rules: Object.fromEntries(ruleEntries),
diff --git a/packages/eslint-plugin/tests/fixtures/deprecated.ts b/packages/eslint-plugin/tests/fixtures/deprecated.ts
index 2302eabd3f54..b8dc49fcf16d 100644
--- a/packages/eslint-plugin/tests/fixtures/deprecated.ts
+++ b/packages/eslint-plugin/tests/fixtures/deprecated.ts
@@ -36,6 +36,11 @@ export {
ClassWithDeprecatedConstructor as ReexportedClassWithDeprecatedConstructor,
};
+/** @deprecated Reason */
+export type T = { a: string };
+
+export type U = { b: string };
+
/** @deprecated */
export default {
foo: 1,
diff --git a/packages/eslint-plugin/tests/rules/array-type.test.ts b/packages/eslint-plugin/tests/rules/array-type.test.ts
index 0293bb97763b..65714e2928ea 100644
--- a/packages/eslint-plugin/tests/rules/array-type.test.ts
+++ b/packages/eslint-plugin/tests/rules/array-type.test.ts
@@ -1648,19 +1648,6 @@ function fooFunction(foo: ArrayClass[]) {
options: [{ default: 'array' }],
output: 'let x: any[];',
},
- {
- code: 'let x: Array<>;',
- errors: [
- {
- column: 8,
- data: { className: 'Array', readonlyPrefix: '', type: 'any' },
- line: 1,
- messageId: 'errorStringArray',
- },
- ],
- options: [{ default: 'array' }],
- output: 'let x: any[];',
- },
{
code: 'let x: Array;',
errors: [
@@ -1674,18 +1661,6 @@ function fooFunction(foo: ArrayClass[]) {
options: [{ default: 'array-simple' }],
output: 'let x: any[];',
},
- {
- code: 'let x: Array<>;',
- errors: [
- {
- column: 8,
- line: 1,
- messageId: 'errorStringArraySimple',
- },
- ],
- options: [{ default: 'array-simple' }],
- output: 'let x: any[];',
- },
{
code: 'let x: Array = [1] as number[];',
errors: [
@@ -2125,7 +2100,6 @@ type BrokenArray = {
'let yy: number[][] = [[4, 5], [6]];',
'let yy: Array> = [[4, 5], [6]];',
);
- testOutput('array', 'let a: Array<>[] = [];', 'let a: any[][] = [];');
testOutput('array', 'let a: Array = [];', 'let a: any[][] = [];');
testOutput(
'array',
@@ -2133,11 +2107,6 @@ type BrokenArray = {
'let a: any[][][] = [];',
);
- testOutput(
- 'generic',
- 'let a: Array<>[] = [];',
- 'let a: Array> = [];',
- );
testOutput(
'generic',
'let a: Array = [];',
diff --git a/packages/eslint-plugin/tests/rules/await-thenable.test.ts b/packages/eslint-plugin/tests/rules/await-thenable.test.ts
index e64f0a5f1f3c..f0dca2e02f5f 100644
--- a/packages/eslint-plugin/tests/rules/await-thenable.test.ts
+++ b/packages/eslint-plugin/tests/rules/await-thenable.test.ts
@@ -1,18 +1,9 @@
-import { noFormat, RuleTester } from '@typescript-eslint/rule-tester';
+import { noFormat } from '@typescript-eslint/rule-tester';
import rule from '../../src/rules/await-thenable';
-import { getFixturesRootDir } from '../RuleTester';
+import { createRuleTesterWithTypes } from '../RuleTester';
-const rootDir = getFixturesRootDir();
-
-const ruleTester = new RuleTester({
- languageOptions: {
- parserOptions: {
- project: './tsconfig.json',
- tsconfigRootDir: rootDir,
- },
- },
-});
+const ruleTester = createRuleTesterWithTypes();
ruleTester.run('await-thenable', rule, {
valid: [
@@ -339,6 +330,365 @@ class C {
}
`,
},
+
+ {
+ code: `
+// @ts-expect-error
+Promise.all();
+ `,
+ },
+ {
+ code: `
+Promise.all([,]);
+ `,
+ },
+ {
+ code: `
+declare const x: unknown;
+
+// @ts-expect-error
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: any;
+Promise.all(x);
+ `,
+ },
+
+ {
+ code: `
+declare const x: Array>;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: Array> | Array>;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: Array | Promise>;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+function f(x: Array>) {
+ Promise.all(x);
+}
+ `,
+ },
+ {
+ code: `
+function f>(x: Array) {
+ Promise.all(x);
+}
+ `,
+ },
+ {
+ code: `
+declare const x: Array;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: Array;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: number | Array>;
+
+// @ts-expect-error
+Promise.all(x);
+ `,
+ },
+
+ {
+ code: `
+declare const x: [Promise, Promise];
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: [Promise] | [Promise];
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: [Promise | Promise];
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+function f(x: [Promise]) {
+ Promise.all(x);
+}
+ `,
+ },
+ {
+ code: `
+function f>(x: [T]) {
+ Promise.all(x);
+}
+ `,
+ },
+ {
+ code: `
+declare const x: [unknown, any];
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: number | [Promise];
+
+// @ts-expect-error
+Promise.all(x);
+ `,
+ },
+
+ {
+ code: `
+declare const x: Iterable>;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: Iterable> | Iterable>;
+
+// @ts-expect-error
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: Iterable>;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+function f(x: Iterable>) {
+ Promise.all(x);
+}
+ `,
+ },
+ {
+ code: `
+function f>(x: Iterable) {
+ Promise.all(x);
+}
+ `,
+ },
+ {
+ code: `
+declare const x: Iterable;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: Iterable;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: number | Iterable>;
+
+// @ts-expect-error
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: Iterable, number>;
+Promise.all(x);
+ `,
+ },
+
+ {
+ code: `
+declare const x: Iterable> | Array>;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x:
+ | Iterable>
+ | [Promise, Promise];
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: Array> | [Promise, Promise];
+Promise.all(x);
+ `,
+ },
+
+ {
+ code: `
+// @ts-expect-error
+Promise.all(1);
+ `,
+ },
+ {
+ code: `
+declare const x: Promise;
+
+// @ts-expect-error
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+interface MyArray extends Array {}
+declare const x: MyArray>;
+
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+function* x() {
+ yield Promise.resolve(1);
+ yield Promise.resolve(2);
+ yield Promise.resolve(3);
+}
+
+Promise.all(x());
+ `,
+ },
+ {
+ code: `
+function* x() {
+ yield 1 as unknown;
+}
+
+Promise.all(x());
+ `,
+ },
+ {
+ code: `
+function* x() {
+ yield 1 as any;
+}
+
+Promise.all(x());
+ `,
+ },
+ {
+ code: `
+declare const x: Generator>;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: Generator;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: Generator;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: ReadonlyArray>;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: ReadonlyArray;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+declare const x: ReadonlyArray;
+Promise.all(x);
+ `,
+ },
+ {
+ code: `
+Promise.all([Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)]);
+ `,
+ },
+ {
+ code: `
+declare const _unknown_: unknown;
+
+Promise.all([
+ _unknown_,
+ Promise.resolve(1),
+ Promise.resolve(2),
+ Promise.resolve(3),
+]);
+ `,
+ },
+ {
+ code: `
+declare const _any_: any;
+
+Promise.all([
+ _any_,
+ Promise.resolve(1),
+ Promise.resolve(2),
+ Promise.resolve(3),
+]);
+ `,
+ },
+ {
+ code: `
+declare const _promise_: Promise;
+
+Promise.all([
+ _promise_,
+ Promise.resolve(1),
+ Promise.resolve(2),
+ Promise.resolve(3),
+]);
+ `,
+ },
+ {
+ code: `
+Promise.all([
+ Promise.resolve(1),
+ Promise.resolve(2),
+ Promise.resolve(3),
+ ...[Promise.resolve(4), Promise.resolve(5), Promise.resolve(6)],
+]);
+ `,
+ },
+ {
+ code: `
+declare const maybePromise: Promise | number;
+
+Promise.all([
+ maybePromise,
+ Promise.resolve(1),
+ Promise.resolve(2),
+ Promise.resolve(3),
+]);
+ `,
+ },
],
invalid: [
@@ -786,5 +1136,309 @@ class C {
},
],
},
+
+ {
+ code: `
+declare const x: Array;
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: Array | Array>;
+Promise.race(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: Array | Array;
+Promise.allSettled(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: Array>;
+Promise.any(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+
+ {
+ code: `
+declare const x: [number];
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: [number] | [Promise];
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: [number | Promise];
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: [Promise, number];
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+
+ {
+ code: `
+declare const x: Iterable;
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: Iterable | Iterable>;
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: Iterable>;
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+
+ {
+ code: `
+declare const x: Iterable | Array>;
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: Iterable> | [string, Promise];
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: Array | [Promise, Promise];
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: Array>>;
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+interface MyArray extends Array {}
+declare const x: MyArray, null>;
+
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+function* x() {
+ yield 1;
+ yield 2;
+ yield 3;
+}
+
+Promise.all(x());
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+function* x() {
+ yield 1 as number;
+}
+
+Promise.all(x());
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+function* x() {
+ yield 1 as number | Promise;
+}
+
+Promise.all(x());
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: Generator;
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: ReadonlyArray;
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+declare const x: ReadonlyArray>;
+Promise.all(x);
+ `,
+ errors: [
+ {
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+Promise.all([Promise.resolve(1), 2, Promise.resolve(3)]);
+ `,
+ errors: [
+ {
+ column: 34,
+ endColumn: 35,
+ line: 2,
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+Promise.all([1, 2, Promise.resolve(3)]);
+ `,
+ errors: [
+ {
+ column: 14,
+ endColumn: 15,
+ line: 2,
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ {
+ column: 17,
+ endColumn: 18,
+ line: 2,
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
+ {
+ code: `
+Promise.all([...[1, 2, 3]]);
+ `,
+ errors: [
+ {
+ column: 14,
+ endColumn: 26,
+ line: 2,
+ messageId: 'invalidPromiseAggregatorInput',
+ },
+ ],
+ },
],
});
diff --git a/packages/eslint-plugin/tests/rules/ban-tslint-comment.test.ts b/packages/eslint-plugin/tests/rules/ban-tslint-comment.test.ts
index 70ebf3d6f107..227d4f3ab3d8 100644
--- a/packages/eslint-plugin/tests/rules/ban-tslint-comment.test.ts
+++ b/packages/eslint-plugin/tests/rules/ban-tslint-comment.test.ts
@@ -2,50 +2,6 @@ import { RuleTester } from '@typescript-eslint/rule-tester';
import rule from '../../src/rules/ban-tslint-comment';
-interface Testable {
- code: string;
- column?: number;
- line?: number;
- output?: string;
- text?: string;
-}
-
-const PALANTIR_EXAMPLES: Testable[] = [
- { code: '/* tslint:disable */' }, // Disable all rules for the rest of the file
- { code: '/* tslint:enable */' }, // Enable all rules for the rest of the file
- {
- code: '/* tslint:disable:rule1 rule2 rule3... */',
- }, // Disable the listed rules for the rest of the file
- {
- code: '/* tslint:enable:rule1 rule2 rule3... */',
- }, // Enable the listed rules for the rest of the file
- { code: '// tslint:disable-next-line' }, // Disables all rules for the following line
- {
- code: 'someCode(); // tslint:disable-line',
- column: 13,
- output: 'someCode();',
- text: '// tslint:disable-line',
- }, // Disables all rules for the current line
- {
- code: '// tslint:disable-next-line:rule1 rule2 rule3...',
- }, // Disables the listed rules for the next line
-];
-
-// prettier-ignore
-const MORE_EXAMPLES: Testable[] = [
- {
- code: `const woah = doSomeStuff();
-// tslint:disable-line
-console.log(woah);
-`,
- line: 2,
- output: `const woah = doSomeStuff();
-console.log(woah);
-`,
- text: '// tslint:disable-line',
- },
-]
-
const ruleTester = new RuleTester();
ruleTester.run('ban-tslint-comment', rule, {
@@ -66,18 +22,123 @@ ruleTester.run('ban-tslint-comment', rule, {
code: '/* another comment that mentions tslint */',
},
],
- invalid: [...PALANTIR_EXAMPLES, ...MORE_EXAMPLES].map(
- ({ code, column, line, output, text }) => ({
- code,
+ invalid: [
+ {
+ code: '/* tslint:disable */',
+ errors: [
+ {
+ column: 1,
+ data: {
+ text: '/* tslint:disable */',
+ },
+ line: 1,
+ messageId: 'commentDetected',
+ },
+ ],
+ output: '',
+ },
+ {
+ code: '/* tslint:enable */',
+ errors: [
+ {
+ column: 1,
+ data: {
+ text: '/* tslint:enable */',
+ },
+ line: 1,
+ messageId: 'commentDetected',
+ },
+ ],
+ output: '',
+ },
+ {
+ code: '/* tslint:disable:rule1 rule2 rule3... */',
+ errors: [
+ {
+ column: 1,
+ data: {
+ text: '/* tslint:disable:rule1 rule2 rule3... */',
+ },
+ line: 1,
+ messageId: 'commentDetected',
+ },
+ ],
+ output: '',
+ },
+ {
+ code: '/* tslint:enable:rule1 rule2 rule3... */',
+ errors: [
+ {
+ column: 1,
+ data: {
+ text: '/* tslint:enable:rule1 rule2 rule3... */',
+ },
+ line: 1,
+ messageId: 'commentDetected',
+ },
+ ],
+ output: '',
+ },
+ {
+ code: '// tslint:disable-next-line',
+ errors: [
+ {
+ column: 1,
+ data: {
+ text: '// tslint:disable-next-line',
+ },
+ line: 1,
+ messageId: 'commentDetected',
+ },
+ ],
+ output: '',
+ },
+ {
+ code: 'someCode(); // tslint:disable-line',
errors: [
{
- column: column ?? 1,
- data: { text: text ?? code },
- line: line ?? 1,
- messageId: 'commentDetected' as const,
+ column: 13,
+ data: {
+ text: '// tslint:disable-line',
+ },
+ line: 1,
+ messageId: 'commentDetected',
},
],
- output: output ?? '',
- }),
- ),
+ output: 'someCode();',
+ },
+ {
+ code: '// tslint:disable-next-line:rule1 rule2 rule3...',
+ errors: [
+ {
+ column: 1,
+ data: { text: '// tslint:disable-next-line:rule1 rule2 rule3...' },
+ line: 1,
+ messageId: 'commentDetected',
+ },
+ ],
+ output: '',
+ },
+ {
+ code: `
+const woah = doSomeStuff();
+// tslint:disable-line
+console.log(woah);
+ `,
+ errors: [
+ {
+ column: 1,
+ data: {
+ text: '// tslint:disable-line',
+ },
+ line: 3,
+ messageId: 'commentDetected',
+ },
+ ],
+ output: `
+const woah = doSomeStuff();
+console.log(woah);
+ `,
+ },
+ ],
});
diff --git a/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts b/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts
index d0193efdc99d..e07263df6e98 100644
--- a/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts
+++ b/packages/eslint-plugin/tests/rules/class-methods-use-this/class-methods-use-this-core.test.ts
@@ -1,7 +1,6 @@
/* eslint-disable @typescript-eslint/internal/plugin-test-formatting --
keeping eslint core formatting on purpose to make upstream diffing easier and so we don't need to edit line/cols */
import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
import rule from '../../../src/rules/class-methods-use-this';
@@ -17,7 +16,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -30,7 +28,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -43,7 +40,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -56,7 +52,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -69,7 +64,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -82,7 +76,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -95,7 +88,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -108,7 +100,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -122,7 +113,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'hasOwnProperty'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -136,7 +126,6 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: 'method' },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
@@ -150,14 +139,12 @@ ruleTester.run('class-methods-use-this', rule, {
data: { name: "method 'foo'" },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 31,
data: { name: 'private method #bar' },
line: 1,
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 2022 } },
@@ -170,55 +157,46 @@ ruleTester.run('class-methods-use-this', rule, {
column: 11,
data: { name: "method 'foo'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 19,
data: { name: "method 'bar'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 29,
data: { name: "method '123'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 37,
data: { name: "method 'baz'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 49,
data: { name: 'method' },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 57,
data: { name: 'method' },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 68,
data: { name: "getter 'quux'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 81,
data: { name: 'setter' },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
{
column: 93,
data: { name: "generator method 'quuux'" },
messageId: 'missingThis',
- type: AST_NODE_TYPES.FunctionExpression,
},
],
languageOptions: { parserOptions: { ecmaVersion: 6 } },
diff --git a/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts b/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts
index 4d0403a85a87..1a573186b1ae 100644
--- a/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts
+++ b/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts
@@ -45,6 +45,16 @@ class A {
`
const a = function (a: Foo = new Foo()) {};
`,
+ {
+ code: `
+const foo: Foo = new Foo();
+ `,
+ languageOptions: {
+ parserOptions: {
+ isolatedDeclarations: true,
+ },
+ },
+ },
// type-annotation
{
code: 'const a = new Foo();',
diff --git a/packages/eslint-plugin/tests/rules/consistent-return.test.ts b/packages/eslint-plugin/tests/rules/consistent-return.test.ts
index e62345932396..0ee2908ef5b0 100644
--- a/packages/eslint-plugin/tests/rules/consistent-return.test.ts
+++ b/packages/eslint-plugin/tests/rules/consistent-return.test.ts
@@ -1,18 +1,7 @@
-import { RuleTester } from '@typescript-eslint/rule-tester';
-import { AST_NODE_TYPES } from '@typescript-eslint/utils';
-
import rule from '../../src/rules/consistent-return';
-import { getFixturesRootDir } from '../RuleTester';
+import { createRuleTesterWithTypes } from '../RuleTester';
-const rootDir = getFixturesRootDir();
-const ruleTester = new RuleTester({
- languageOptions: {
- parserOptions: {
- project: './tsconfig.json',
- tsconfigRootDir: rootDir,
- },
- },
-});
+const ruleTester = createRuleTesterWithTypes();
ruleTester.run('consistent-return', rule, {
valid: [
@@ -226,7 +215,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -246,7 +234,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 5,
line: 5,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -270,7 +257,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 6,
line: 6,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
{
column: 11,
@@ -279,7 +265,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 9,
line: 9,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -298,7 +283,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -317,7 +301,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -336,7 +319,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -355,7 +337,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -374,7 +355,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 4,
line: 4,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -396,7 +376,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 7,
line: 7,
messageId: 'missingReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
},
@@ -417,7 +396,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 6,
line: 6,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
options: [
@@ -444,7 +422,6 @@ ruleTester.run('consistent-return', rule, {
endLine: 7,
line: 7,
messageId: 'unexpectedReturnValue',
- type: AST_NODE_TYPES.ReturnStatement,
},
],
options: [
diff --git a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts
index bbefaa06f4c3..c11949c1e39c 100644
--- a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts
+++ b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts
@@ -1,322 +1,405 @@
-/* eslint-disable @typescript-eslint/no-deprecated -- TODO - migrate this test away from `batchedSingleLineTests` */
-
import type { TSESTree } from '@typescript-eslint/utils';
import * as parser from '@typescript-eslint/parser';
import { RuleTester } from '@typescript-eslint/rule-tester';
-import type {
- MessageIds,
- Options,
-} from '../../src/rules/consistent-type-assertions';
-
import rule from '../../src/rules/consistent-type-assertions';
-import { dedupeTestCases } from '../dedupeTestCases';
-import { batchedSingleLineTests } from '../RuleTester';
const ruleTester = new RuleTester();
-const ANGLE_BRACKET_TESTS_EXCEPT_CONST_CASE = `
-const x = new Generic();
-const x = b;
-const x = [1];
-const x = ('string');
-const x = !'string';
-const x = a + b;
-const x = <(A)>a + (b);
-const x = (new Generic());
-const x = new (Generic)();
-const x = new (Generic)('string');
-const x = () => { bar: 5 };
-const x = () => ({ bar: 5 });
-const x = () => bar;
-const x = bar\`\${"baz"}\`;`;
-
-const ANGLE_BRACKET_TESTS = `${ANGLE_BRACKET_TESTS_EXCEPT_CONST_CASE}
-const x = { key: 'value' };
-`;
-
-// Intentionally contains a duplicate in order to mirror ANGLE_BRACKET_TESTS_EXCEPT_CONST_CASE
-const AS_TESTS_EXCEPT_CONST_CASE = `
-const x = new Generic() as Foo;
-const x = b as A;
-const x = [1] as readonly number[];
-const x = 'string' as a | b;
-const x = !'string' as A;
-const x = (a as A) + b;
-const x = (a as A) + (b);
-const x = new Generic() as Foo;
-const x = new ((Generic) as Foo)();
-const x = new ((Generic) as Foo)('string');
-const x = () => ({ bar: 5 } as Foo);
-const x = () => ({ bar: 5 } as Foo);
-const x = () => (bar as Foo);
-const x = bar\`\${"baz"}\` as Foo;`;
-
-const AS_TESTS = `${AS_TESTS_EXCEPT_CONST_CASE}
-const x = { key: 'value' } as const;
-`;
-
-const OBJECT_LITERAL_AS_CASTS = `
-const x = {} as Foo;
-const x = ({}) as a | b;
-const x = {} as A + b;
-`;
-const OBJECT_LITERAL_ANGLE_BRACKET_CASTS = `
-const x = >{};
-const x = ({});
-const x = {} + b;
-`;
-const OBJECT_LITERAL_ARGUMENT_AS_CASTS = `
-print({ bar: 5 } as Foo)
-new print({ bar: 5 } as Foo)
-function foo() { throw { bar: 5 } as Foo }
-function b(x = {} as Foo.Bar) {}
-function c(x = {} as Foo) {}
-print?.({ bar: 5 } as Foo)
-print?.call({ bar: 5 } as Foo)
-print\`\${{ bar: 5 } as Foo}\`
-`;
-const OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS = `
-print({ bar: 5 })
-new print({ bar: 5 })
-function foo() { throw { bar: 5 } }
-print?.({ bar: 5 })
-print?.call({ bar: 5 })
-print\`\${{ bar: 5 }}\`
-`;
-
ruleTester.run('consistent-type-assertions', rule, {
valid: [
- ...dedupeTestCases(
- batchedSingleLineTests({
- code: AS_TESTS,
- options: [
- { assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' },
- ],
- }),
- ),
- ...batchedSingleLineTests({
- code: ANGLE_BRACKET_TESTS,
+ {
+ code: 'const x = new Generic() as Foo;',
options: [
{
- assertionStyle: 'angle-bracket',
+ assertionStyle: 'as',
objectLiteralTypeAssertions: 'allow',
},
],
- }),
- ...batchedSingleLineTests({
- code: `${OBJECT_LITERAL_AS_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`,
- options: [{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow' }],
- }),
- ...batchedSingleLineTests({
- code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`,
+ },
+ {
+ code: 'const x = b as A;',
options: [
{
- assertionStyle: 'angle-bracket',
+ assertionStyle: 'as',
objectLiteralTypeAssertions: 'allow',
},
],
- }),
- ...batchedSingleLineTests({
- code: OBJECT_LITERAL_ARGUMENT_AS_CASTS,
+ },
+ {
+ code: 'const x = [1] as readonly number[];',
options: [
{
assertionStyle: 'as',
- objectLiteralTypeAssertions: 'allow-as-parameter',
+ objectLiteralTypeAssertions: 'allow',
},
],
- }),
- ...batchedSingleLineTests({
- code: OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS,
+ },
+ {
+ code: "const x = 'string' as a | b;",
options: [
{
- assertionStyle: 'angle-bracket',
- objectLiteralTypeAssertions: 'allow-as-parameter',
+ assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow',
},
],
- }),
+ },
{
- code: 'const x = [] as string[];',
+ code: "const x = !'string' as A;",
options: [
{
assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: "const x = ['a'] as Array;",
+ code: 'const x = (a as A) + b;',
options: [
{
assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: 'const x = [];',
+ code: 'const x = new Generic() as Foo;',
options: [
{
- assertionStyle: 'angle-bracket',
+ assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: 'const x = >[];',
+ code: 'const x = new (Generic as Foo)();',
options: [
{
- assertionStyle: 'angle-bracket',
+ assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: 'print([5] as Foo);',
+ code: "const x = new (Generic as Foo)('string');",
options: [
{
- arrayLiteralTypeAssertions: 'allow-as-parameter',
assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: `
-function foo() {
- throw [5] as Foo;
-}
- `,
+ code: 'const x = () => ({ bar: 5 }) as Foo;',
options: [
{
- arrayLiteralTypeAssertions: 'allow-as-parameter',
assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: 'function b(x = [5] as Foo.Bar) {}',
+ code: 'const x = () => bar as Foo;',
options: [
{
- arrayLiteralTypeAssertions: 'allow-as-parameter',
assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: 'print?.([5] as Foo);',
+ code: "const x = bar`${'baz'}` as Foo;",
options: [
{
- arrayLiteralTypeAssertions: 'allow-as-parameter',
assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: 'print?.call([5] as Foo);',
+ code: "const x = { key: 'value' } as const;",
options: [
{
- arrayLiteralTypeAssertions: 'allow-as-parameter',
assertionStyle: 'as',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: 'print`${[5] as Foo}`;',
+ code: 'const x = new Generic();',
options: [
{
- arrayLiteralTypeAssertions: 'allow-as-parameter',
- assertionStyle: 'as',
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: 'new Print([5] as Foo);',
+ code: 'const x = b;',
options: [
{
- arrayLiteralTypeAssertions: 'allow-as-parameter',
- assertionStyle: 'as',
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: 'const bar = ;',
- languageOptions: { parserOptions: { ecmaFeatures: { jsx: true } } },
+ code: 'const x = [1];',
options: [
{
- arrayLiteralTypeAssertions: 'allow-as-parameter',
- assertionStyle: 'as',
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
},
],
},
{
- code: 'print([5]);',
+ code: "const x = 'string';",
+ options: [
+ {
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
+ },
+ ],
+ },
+ {
+ code: "const x = !'string';",
+ options: [
+ {
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
+ },
+ ],
+ },
+ {
+ code: 'const x = a + b;',
+ options: [
+ {
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
+ },
+ ],
+ },
+ {
+ code: 'const x = new Generic();',
+ options: [
+ {
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
+ },
+ ],
+ },
+ {
+ code: 'const x = new (Generic)();',
+ options: [
+ {
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
+ },
+ ],
+ },
+ {
+ code: "const x = new (Generic)('string');",
+ options: [
+ {
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
+ },
+ ],
+ },
+ {
+ code: 'const x = () => { bar: 5 };',
+ options: [
+ {
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
+ },
+ ],
+ },
+ {
+ code: 'const x = () => bar;',
+ options: [
+ {
+ assertionStyle: 'angle-bracket',
+ objectLiteralTypeAssertions: 'allow',
+ },
+ ],
+ },
+ {
+ code: "const x =