diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index ed3d277f03cc..a1eb95ebcfbd 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,3 +1,2 @@ -# Critical workflow files require approval from core maintainers -.github/workflows/release.yml @JamesHenry @bradzacher @JoshuaKGoldberg -.github/workflows/ci.yml @JamesHenry @bradzacher @JoshuaKGoldberg +# All files in the .github directory require approval from core maintainers +.github/** @JamesHenry @bradzacher @JoshuaKGoldberg diff --git a/.github/actions/breaking-pr-check/action.yml b/.github/actions/breaking-pr-check/action.yml deleted file mode 100644 index c132bb404d8c..000000000000 --- a/.github/actions/breaking-pr-check/action.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Validate Breaking Change PR -description: Validate breaking change PR title and description - -runs: - using: 'composite' - steps: - - name: Check PR title and body using github-script - uses: actions/github-script@v7 - with: - github-token: ${{ env.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/a11y-alt-bot.yml b/.github/workflows/a11y-alt-bot.yml index 10afa17f6b1b..f59ac53a8dc6 100644 --- a/.github/workflows/a11y-alt-bot.yml +++ b/.github/workflows/a11y-alt-bot.yml @@ -2,6 +2,7 @@ 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: @@ -13,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 d4ec153d22dd..91e78e2a606a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: push: branches: - main + # NOTE: Never use pull_request_target here because that would populate secrets for forks pull_request: branches: - '**' 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 6eb61b7714cb..5b0d8db9f9d4 100644 --- a/.github/workflows/nx-migrate.yml +++ b/.github/workflows/nx-migrate.yml @@ -7,6 +7,8 @@ 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 77% rename from .github/workflows/semantic-pr-titles.yml rename to .github/workflows/pr-title-validation.yml index b206297b3896..175ce9457a5e 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: 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/semantic-breaking-change-pr-test.yml b/.github/workflows/semantic-breaking-change-pr-test.yml deleted file mode 100644 index 46d4627b3fdc..000000000000 --- a/.github/workflows/semantic-breaking-change-pr-test.yml +++ /dev/null @@ -1,20 +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/breaking-pr-check - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 1001310182fb..3565665f1cb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,36 @@ +## 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 diff --git a/eslint.config.mjs b/eslint.config.mjs index 3e5efbf853cd..6f0bc78c5100 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -242,6 +242,7 @@ export default defineConfig( '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', diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 49423544d22b..7ed7bba831d0 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -1,3 +1,15 @@ +## 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. diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 3fa74192b434..dc67c399e45d 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "8.42.0", + "version": "8.43.0", "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ 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/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/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/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/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/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/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/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/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/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/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/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/fixture.ts b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/fixture.ts new file mode 100644 index 000000000000..1b6ae87f6359 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/fixture.ts @@ -0,0 +1,3 @@ +// TODO: This fixture might be too large, and if so should be split up. + +foo< /* empty */ >(); diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/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 new file mode 100644 index 000000000000..4992c1bda8ba --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/1-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression Babel - Error 1`] = `[SyntaxError: Unexpected token (3:4)]`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-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-arguments-in-call-expression-with-comment/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 new file mode 100644 index 000000000000..c7ddaf4d3507 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/2-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures legacy-fixtures errorRecovery _error_ empty-type-arguments-in-call-expression Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-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-arguments-in-call-expression-with-comment/snapshots/3-Alignment-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 new file mode 100644 index 000000000000..6e7b21bf1776 --- /dev/null +++ b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-arguments-in-call-expression-with-comment/snapshots/3-Alignment-Error.shot @@ -0,0 +1,4 @@ +// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html + +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/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/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/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/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..4f12d12b51de 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,9 @@ // 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 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | function f1<>() {} + | ^^ Type parameter list cannot be empty. + 4 | 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/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-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..fa912f209747 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,9 @@ // 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 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | const foo = function<>() {} + | ^^ Type parameter list cannot be empty. + 4 | 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/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/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/1-TSESTree-Error.shot b/packages/ast-spec/src/legacy-fixtures/errorRecovery/fixtures/_error_/empty-type-parameters/snapshots/1-TSESTree-Error.shot index c1b25cba23a7..5bf4050773dc 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-parameters/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-parameters > TSESTree - Error`] -NO ERROR +TSError + 1 | // TODO: This fixture might be too large, and if so should be split up. + 2 | +> 3 | function f1<>() {} + | ^^ Type parameter list cannot be empty. + 4 | 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/snapshots/3-Alignment-Error.shot index 4fd1ec55af88..a525062b1e95 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/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 +Both errored diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index 04b14e7a3730..303daa8ed915 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -4,15 +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/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", @@ -30,15 +24,6 @@ exports[`AST Fixtures > List fixtures with Error differences`] "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-with-optional-index-signature/fixture.ts", diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 6553f6fdfe46..ce4b358cad1b 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,3 +1,33 @@ +## 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 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/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/package.json b/packages/eslint-plugin/package.json index 283b912e44ce..e86d12562509 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "8.42.0", + "version": "8.43.0", "description": "TypeScript plugin for ESLint", "files": [ "dist", @@ -59,10 +59,10 @@ }, "dependencies": { "@eslint-community/regexpp": "^4.10.0", - "@typescript-eslint/scope-manager": "8.42.0", - "@typescript-eslint/type-utils": "8.42.0", - "@typescript-eslint/utils": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0", + "@typescript-eslint/scope-manager": "8.43.0", + "@typescript-eslint/type-utils": "8.43.0", + "@typescript-eslint/utils": "8.43.0", + "@typescript-eslint/visitor-keys": "8.43.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", @@ -71,8 +71,8 @@ "devDependencies": { "@types/mdast": "^4.0.3", "@types/natural-compare": "*", - "@typescript-eslint/rule-schema-to-typescript-types": "8.42.0", - "@typescript-eslint/rule-tester": "8.42.0", + "@typescript-eslint/rule-schema-to-typescript-types": "8.43.0", + "@typescript-eslint/rule-tester": "8.43.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "cross-fetch": "*", @@ -92,7 +92,7 @@ "vitest": "^3.1.3" }, "peerDependencies": { - "@typescript-eslint/parser": "^8.42.0", + "@typescript-eslint/parser": "^8.43.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <6.0.0" }, 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/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 82e164df1cf5..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, }, 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..f930292bf3f2 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: diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 839f3e0a1c98..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: { 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 880708a866c3..71b333488b55 100644 --- a/packages/eslint-plugin/src/rules/no-deprecated.ts +++ b/packages/eslint-plugin/src/rules/no-deprecated.ts @@ -162,17 +162,17 @@ export default createRule({ } } - 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: @@ -366,11 +366,12 @@ 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; } @@ -440,7 +441,33 @@ 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; + } + + 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-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts index 50965093ee98..32ecbe741681 100644 --- a/packages/eslint-plugin/src/rules/no-floating-promises.ts +++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts @@ -16,6 +16,7 @@ import { readonlynessOptionsSchema, skipChainExpression, typeMatchesSomeSpecifier, + valueMatchesSomeSpecifier, } from '../util'; import { parseCatchCall, @@ -142,7 +143,7 @@ export default createRule({ const expression = skipChainExpression(node.expression); - if (isKnownSafePromiseReturn(expression)) { + if (isKnownSafePromiseCall(expression)) { return; } @@ -235,13 +236,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, 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-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-unnecessary-type-conversion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts index 09af31518b11..088b8768b3af 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-conversion.ts @@ -57,7 +57,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); @@ -351,13 +351,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/prefer-destructuring.ts b/packages/eslint-plugin/src/rules/prefer-destructuring.ts index a3afb125a301..40c0de88ba40 100644 --- a/packages/eslint-plugin/src/rules/prefer-destructuring.ts +++ b/packages/eslint-plugin/src/rules/prefer-destructuring.ts @@ -76,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-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/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts index 983eb1472c14..3e7172e2ca45 100644 --- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts +++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts @@ -438,8 +438,8 @@ 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 + def.node.parent.type === AST_NODE_TYPES.ExportNamedDeclaration) || + def.node.parent.type === AST_NODE_TYPES.ExportDefaultDeclaration ) { return true; } @@ -458,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/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-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/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/consistent-type-exports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts index 8508cd75ae77..b513411d676d 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts @@ -64,6 +64,11 @@ export { NonTypeNS }; "export type * as foo from './consistent-type-exports/type-only-exports';", "export type * as foo from './consistent-type-exports/type-only-reexport';", "export * as foo from './consistent-type-exports/value-reexport';", + ` +import * as Foo from './consistent-type-exports'; +type Foo = 1; +export { Foo } + `, ], invalid: [ { @@ -483,5 +488,26 @@ export { export type * as foo from './consistent-type-exports/type-only-reexport'; `, }, + { + code: ` + import type * as Foo from './consistent-type-exports'; + type Foo = 1; + export { Foo }; + `, + errors: [ + { + column: 9, + endColumn: 24, + endLine: 4, + line: 4, + messageId: 'typeOverValue', + }, + ], + output: ` + import type * as Foo from './consistent-type-exports'; + type Foo = 1; + export type { Foo }; + `, + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/method-signature-style.test.ts b/packages/eslint-plugin/tests/rules/method-signature-style.test.ts index 2e60818a6064..9a7ab2b345c2 100644 --- a/packages/eslint-plugin/tests/rules/method-signature-style.test.ts +++ b/packages/eslint-plugin/tests/rules/method-signature-style.test.ts @@ -28,7 +28,7 @@ interface Test { `, ` interface Test { - 'f!': (/* b */ x: any /* c */) => void; + 'f!': (/* b */ x: any /* c */) => void; } `, ` @@ -82,7 +82,7 @@ interface Test { { code: ` interface Test { - 'f!'(/* b */ x: any /* c */): void; + 'f!'(/* b */ x: any /* c */): void; } `, options: ['method'], @@ -190,13 +190,13 @@ interface Test { { code: ` interface Test { - 'f!'(/* b */ x: any /* c */): void; + 'f!'(/* b */ x: any /* c */): void; } `, errors: [{ messageId: 'errorMethod' }], output: ` interface Test { - 'f!': (/* b */ x: any /* c */) => void; + 'f!': (/* b */ x: any /* c */) => void; } `, }, @@ -295,14 +295,14 @@ interface Test { { code: ` interface Test { - 'f!': (/* b */ x: any /* c */) => void; + 'f!': (/* b */ x: any /* c */) => void; } `, errors: [{ messageId: 'errorProperty' }], options: ['method'], output: ` interface Test { - 'f!'(/* b */ x: any /* c */): void; + 'f!'(/* b */ x: any /* c */): void; } `, }, diff --git a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts index 6231f9404944..e5a0937f4264 100644 --- a/packages/eslint-plugin/tests/rules/no-deprecated.test.ts +++ b/packages/eslint-plugin/tests/rules/no-deprecated.test.ts @@ -222,6 +222,12 @@ ruleTester.run('no-deprecated', rule, { default as ts, } from 'typescript'; `, + ` + export { deprecatedFunction as 'bur' } from './deprecated'; + `, + ` + export { 'deprecatedFunction' } from './deprecated'; + `, ` namespace A { /** @deprecated */ @@ -329,6 +335,12 @@ ruleTester.run('no-deprecated', rule, { } ; `, + ` + export { + /** @deprecated */ + foo, + }; + `, { code: ` /** @deprecated */ @@ -3274,5 +3286,77 @@ exists('/foo'); }, ], }, + { + code: ` + import { deprecatedFunction } from './deprecated'; + + export { deprecatedFunction }; + `, + errors: [ + { + column: 18, + endColumn: 36, + endLine: 4, + line: 4, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + export { deprecatedFunction } from './deprecated'; + `, + errors: [ + { + column: 18, + endColumn: 36, + endLine: 2, + line: 2, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + export type { T, U } from './deprecated'; + `, + errors: [ + { + column: 23, + endColumn: 24, + endLine: 2, + line: 2, + messageId: 'deprecatedWithReason', + }, + ], + }, + { + code: ` + export { default as foo } from './deprecated'; + `, + errors: [ + { + column: 29, + endColumn: 32, + endLine: 2, + line: 2, + messageId: 'deprecated', + }, + ], + }, + { + code: ` + export { deprecatedFunction as bar } from './deprecated'; + `, + errors: [ + { + column: 40, + endColumn: 43, + endLine: 2, + line: 2, + messageId: 'deprecated', + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts index 3c5dc458476d..e2a272f6f3dc 100644 --- a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts @@ -868,6 +868,34 @@ declare function createMyThenable(): MyThenable; createMyThenable(); `, + { + code: ` +const randomAsyncFunction = async () => { + return Promise.resolve(true); +}; + +randomAsyncFunction(); + `, + options: [ + { + allowForKnownSafeCalls: ['randomAsyncFunction'], + }, + ], + }, + { + code: ` +async function myAsyncFunction() { + return Promise.resolve('test'); +} + +myAsyncFunction(); + `, + options: [ + { + allowForKnownSafeCalls: ['myAsyncFunction'], + }, + ], + }, ], invalid: [ diff --git a/packages/eslint-plugin/tests/rules/no-non-null-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-non-null-assertion.test.ts index 98dde42f9943..137effe702cc 100644 --- a/packages/eslint-plugin/tests/rules/no-non-null-assertion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-non-null-assertion.test.ts @@ -387,5 +387,39 @@ x?. }, ], }, + { + code: ` +document.querySelector('input')!.files = new FileList(); + `, + errors: [ + { + column: 1, + endColumn: 33, + line: 2, + messageId: 'noNonNull', + }, + ], + }, + { + code: ` +hoge.files = document.querySelector('input')!.files; + `, + errors: [ + { + column: 14, + endColumn: 46, + line: 2, + messageId: 'noNonNull', + suggestions: [ + { + messageId: 'suggestOptionalChain', + output: ` +hoge.files = document.querySelector('input')?.files; + `, + }, + ], + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts index 18e74325d7b6..9c2ab4fe84e8 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts @@ -16,12 +16,11 @@ const ruleTester = new RuleTester({ ruleTester.run('no-unnecessary-type-arguments', rule, { valid: [ - 'f<>();', + 'f();', 'f();', - 'expect().toBe<>();', - 'class Foo extends Bar<> {}', + 'class Foo extends Bar {}', 'class Foo extends Bar {}', - 'class Foo implements Bar<> {}', + 'class Foo implements Bar {}', 'class Foo implements Bar {}', ` function f() {} diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts index e0aaadacee2d..50995fb3a90d 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-conversion.test.ts @@ -29,6 +29,10 @@ ruleTester.run('no-unnecessary-type-conversion', rule, { "Number('2');", "+'2';", "~~'2';", + '~~1.1;', + '~~-1.1;', + '~~(1.5 + 2.3);', + '~~(1 / 3);', 'Boolean(0);', '!!0;', 'BigInt(3);', @@ -578,26 +582,6 @@ let str = 'asdf'; }, ], }, - { - code: '2 * ~~(2 + 2);', - errors: [ - { - column: 5, - endColumn: 7, - messageId: 'unnecessaryTypeConversion', - suggestions: [ - { - messageId: 'suggestRemove', - output: '2 * (2 + 2);', - }, - { - messageId: 'suggestSatisfies', - output: '2 * ((2 + 2) satisfies number);', - }, - ], - }, - ], - }, { code: 'false && !!(false || true);', errors: [ @@ -720,5 +704,75 @@ let str = 'asdf'; }, ], }, + { + code: '~~1;', + errors: [ + { + column: 1, + endColumn: 3, + messageId: 'unnecessaryTypeConversion', + suggestions: [ + { + messageId: 'suggestRemove', + output: '1;', + }, + { + messageId: 'suggestSatisfies', + output: '1 satisfies number;', + }, + ], + }, + ], + }, + { + code: '~~-1;', + errors: [ + { + column: 1, + endColumn: 3, + messageId: 'unnecessaryTypeConversion', + suggestions: [ + { + messageId: 'suggestRemove', + output: '(-1);', + }, + { + messageId: 'suggestSatisfies', + output: '(-1) satisfies number;', + }, + ], + }, + ], + }, + { + code: ` + declare const threeOrFour: 3 | 4; + ~~threeOrFour; + `, + errors: [ + { + column: 9, + endColumn: 11, + line: 3, + messageId: 'unnecessaryTypeConversion', + suggestions: [ + { + messageId: 'suggestRemove', + output: ` + declare const threeOrFour: 3 | 4; + threeOrFour; + `, + }, + { + messageId: 'suggestSatisfies', + output: ` + declare const threeOrFour: 3 | 4; + threeOrFour satisfies number; + `, + }, + ], + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/only-throw-error.test.ts b/packages/eslint-plugin/tests/rules/only-throw-error.test.ts index 6f60f01b8405..500454d0a9cb 100644 --- a/packages/eslint-plugin/tests/rules/only-throw-error.test.ts +++ b/packages/eslint-plugin/tests/rules/only-throw-error.test.ts @@ -191,6 +191,19 @@ throw new Map(); }, { code: ` +function func() { + let err: Promise | Promise; + throw err; +} + `, + options: [ + { + allow: ['Promise'], + }, + ], + }, + { + code: ` try { } catch (e) { throw e; @@ -615,6 +628,24 @@ function fun(t: T): void { }, { code: ` +function func() { + let err: Promise | Promise | void; + throw err; +} + `, + errors: [ + { + messageId: 'object', + }, + ], + options: [ + { + allow: ['Promise'], + }, + ], + }, + { + code: ` class UnknownError implements Error {} throw new UnknownError(); `, diff --git a/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts b/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts index 5b372350059f..d0ed5d1a9c9b 100644 --- a/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-return-this-type.test.ts @@ -98,6 +98,19 @@ class Foo { ` class Foo { f?: string; +} + `, + ` +declare const valueUnion: BaseUnion | string; + +class BaseUnion { + f(): BaseUnion | string { + if (Math.random()) { + return this; + } + + return valueUnion; + } } `, ], @@ -395,6 +408,42 @@ class Animal { console.log("I'm moving!"); return this; } +} + `, + }, + { + code: ` +declare const valueUnion: number | string; + +class BaseUnion { + f(): BaseUnion | string { + if (Math.random()) { + return this; + } + + return valueUnion; + } +} + `, + errors: [ + { + column: 8, + endColumn: 17, + line: 5, + messageId: 'useThisType', + }, + ], + output: ` +declare const valueUnion: number | string; + +class BaseUnion { + f(): this | string { + if (Math.random()) { + return this; + } + + return valueUnion; + } } `, }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index f0699726e8d7..80efaa535cbf 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.43.0 (2025-09-08) + +This was a version bump only for parser 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.42.0 (2025-09-02) This was a version bump only for parser to align it with other projects, there were no code changes. diff --git a/packages/parser/package.json b/packages/parser/package.json index 25b9494e7bb5..b152070d6d7d 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "8.42.0", + "version": "8.43.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "files": [ "dist", @@ -51,10 +51,10 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "8.42.0", - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0", + "@typescript-eslint/scope-manager": "8.43.0", + "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/typescript-estree": "8.43.0", + "@typescript-eslint/visitor-keys": "8.43.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/project-service/CHANGELOG.md b/packages/project-service/CHANGELOG.md index 874fb6a1cb4f..1f306a50c759 100644 --- a/packages/project-service/CHANGELOG.md +++ b/packages/project-service/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.43.0 (2025-09-08) + +This was a version bump only for project-service 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.42.0 (2025-09-02) This was a version bump only for project-service to align it with other projects, there were no code changes. diff --git a/packages/project-service/package.json b/packages/project-service/package.json index 213c332c8818..97b05cd5eed0 100644 --- a/packages/project-service/package.json +++ b/packages/project-service/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/project-service", - "version": "8.42.0", + "version": "8.43.0", "description": "Standalone TypeScript project service wrapper for linting.", "files": [ "dist", @@ -49,8 +49,8 @@ "typescript": ">=4.8.4 <6.0.0" }, "dependencies": { - "@typescript-eslint/tsconfig-utils": "^8.42.0", - "@typescript-eslint/types": "^8.42.0", + "@typescript-eslint/tsconfig-utils": "^8.43.0", + "@typescript-eslint/types": "^8.43.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/rule-schema-to-typescript-types/CHANGELOG.md b/packages/rule-schema-to-typescript-types/CHANGELOG.md index 5f273061627d..070d93a9ffa4 100644 --- a/packages/rule-schema-to-typescript-types/CHANGELOG.md +++ b/packages/rule-schema-to-typescript-types/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.43.0 (2025-09-08) + +This was a version bump only for rule-schema-to-typescript-types 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.42.0 (2025-09-02) This was a version bump only for rule-schema-to-typescript-types to align it with other projects, there were no code changes. diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index d9a9c1a9d62d..202c5811ec11 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-schema-to-typescript-types", - "version": "8.42.0", + "version": "8.43.0", "private": true, "type": "commonjs", "exports": { @@ -32,8 +32,8 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/type-utils": "8.42.0", - "@typescript-eslint/utils": "8.42.0", + "@typescript-eslint/type-utils": "8.43.0", + "@typescript-eslint/utils": "8.43.0", "natural-compare": "^1.4.0", "prettier": "3.6.2" }, diff --git a/packages/rule-tester/CHANGELOG.md b/packages/rule-tester/CHANGELOG.md index 3382f5b61dc8..d3d95f8f405a 100644 --- a/packages/rule-tester/CHANGELOG.md +++ b/packages/rule-tester/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **rule-tester:** normalize paths before checking if they escape cwd ([#11525](https://github.com/typescript-eslint/typescript-eslint/pull/11525)) + +### ❤️ Thank You + +- Dima @dbarabashh + +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 rule-tester to align it with other projects, there were no code changes. diff --git a/packages/rule-tester/package.json b/packages/rule-tester/package.json index 3e8f7d2e624e..1f93b49b727a 100644 --- a/packages/rule-tester/package.json +++ b/packages/rule-tester/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/rule-tester", - "version": "8.42.0", + "version": "8.43.0", "description": "Tooling to test ESLint rules", "files": [ "dist", @@ -44,9 +44,9 @@ }, "//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70", "dependencies": { - "@typescript-eslint/parser": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0", - "@typescript-eslint/utils": "8.42.0", + "@typescript-eslint/parser": "8.43.0", + "@typescript-eslint/typescript-estree": "8.43.0", + "@typescript-eslint/utils": "8.43.0", "ajv": "^6.12.6", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "4.6.2", diff --git a/packages/rule-tester/src/RuleTester.ts b/packages/rule-tester/src/RuleTester.ts index ccf143c1f506..bd0d8cede4eb 100644 --- a/packages/rule-tester/src/RuleTester.ts +++ b/packages/rule-tester/src/RuleTester.ts @@ -210,7 +210,7 @@ export class RuleTester extends TestFramework { // file name (`foo.ts`), don't change the base path. if ( filename != null && - (path.isAbsolute(filename) || filename.startsWith('..')) + (path.isAbsolute(filename) || path.normalize(filename).startsWith('..')) ) { basePath = path.parse( path.resolve(basePath ?? process.cwd(), filename), diff --git a/packages/rule-tester/tests/filename.test.ts b/packages/rule-tester/tests/filename.test.ts index 0e9656702e95..8f3442cf670a 100644 --- a/packages/rule-tester/tests/filename.test.ts +++ b/packages/rule-tester/tests/filename.test.ts @@ -57,6 +57,42 @@ describe('rule tester filename', () => { errors: [{ messageId: 'foo' }], filename: '../foo.js', }, + { + name: 'non-normalized relative path starting with ./', + code: '_', + errors: [{ messageId: 'foo' }], + filename: './../../escaped/cwd/file.ts', + }, + { + name: 'non-normalized relative path ./../', + code: '_', + errors: [{ messageId: 'foo' }], + filename: './../foo.js', + }, + { + name: 'non-normalized relative path with multiple ./', + code: '_', + errors: [{ messageId: 'foo' }], + filename: '././../foo.js', + }, + { + name: 'non-normalized path a/../../', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/../../file.ts', + }, + { + name: 'non-normalized path a/b/../c', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/b/../c', + }, + { + name: 'non-normalized path with multiple slashes', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/////////////../../../b', + }, ], valid: [], }); @@ -81,6 +117,42 @@ describe('rule tester filename', () => { errors: [{ messageId: 'foo' }], filename: '../foo.js', }, + { + name: 'non-normalized relative path starting with ./', + code: '_', + errors: [{ messageId: 'foo' }], + filename: './../../escaped/cwd/file.ts', + }, + { + name: 'non-normalized relative path ./../', + code: '_', + errors: [{ messageId: 'foo' }], + filename: './../foo.js', + }, + { + name: 'non-normalized relative path with multiple ./', + code: '_', + errors: [{ messageId: 'foo' }], + filename: '././../foo.js', + }, + { + name: 'non-normalized path a/../../', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/../../file.ts', + }, + { + name: 'non-normalized path a/b/../c', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/b/../c', + }, + { + name: 'non-normalized path with multiple slashes', + code: '_', + errors: [{ messageId: 'foo' }], + filename: 'a/////////////../../../b', + }, ], valid: [], }); diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 6f66a69047d6..b2fc59f25ead 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **scope-manager:** exclude Program from DefinitionBase node types ([#11469](https://github.com/typescript-eslint/typescript-eslint/pull/11469)) + +### ❤️ Thank You + +- Dima @dbarabashh + +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 scope-manager to align it with other projects, there were no code changes. diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 4bddb0326989..e3416d621b3c 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "8.42.0", + "version": "8.43.0", "description": "TypeScript scope analyser for ESLint", "files": [ "dist", @@ -47,11 +47,11 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0" + "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/visitor-keys": "8.43.0" }, "devDependencies": { - "@typescript-eslint/typescript-estree": "8.42.0", + "@typescript-eslint/typescript-estree": "8.43.0", "@vitest/coverage-v8": "^3.1.3", "@vitest/pretty-format": "^3.1.3", "eslint": "*", diff --git a/packages/scope-manager/src/definition/DefinitionBase.ts b/packages/scope-manager/src/definition/DefinitionBase.ts index de4260ea888d..87b9cfb0eea4 100644 --- a/packages/scope-manager/src/definition/DefinitionBase.ts +++ b/packages/scope-manager/src/definition/DefinitionBase.ts @@ -1,4 +1,4 @@ -import type { TSESTree } from '@typescript-eslint/types'; +import type { NodeWithParent, TSESTree } from '@typescript-eslint/types'; import type { DefinitionType } from './DefinitionType'; @@ -8,7 +8,7 @@ const generator = createIdGenerator(); export abstract class DefinitionBase< Type extends DefinitionType, - Node extends TSESTree.Node, + Node extends NodeWithParent, Parent extends TSESTree.Node | null, Name extends TSESTree.Node, > { diff --git a/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts b/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts index fa36527502c4..23bc4dedfd30 100644 --- a/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts +++ b/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts @@ -1,11 +1,11 @@ -import type { TSESTree } from '@typescript-eslint/types'; +import type { NodeWithParent, TSESTree } from '@typescript-eslint/types'; import { DefinitionBase } from './DefinitionBase'; import { DefinitionType } from './DefinitionType'; export class ImplicitGlobalVariableDefinition extends DefinitionBase< DefinitionType.ImplicitGlobalVariable, - TSESTree.Node, + NodeWithParent, null, TSESTree.BindingName > { diff --git a/packages/scope-manager/src/referencer/Reference.ts b/packages/scope-manager/src/referencer/Reference.ts index 6487f8ff36e4..f5d1d3549d9e 100644 --- a/packages/scope-manager/src/referencer/Reference.ts +++ b/packages/scope-manager/src/referencer/Reference.ts @@ -1,4 +1,4 @@ -import type { TSESTree } from '@typescript-eslint/types'; +import type { NodeWithParent, TSESTree } from '@typescript-eslint/types'; import type { Scope } from '../scope'; import type { Variable } from '../variable'; @@ -12,7 +12,7 @@ export enum ReferenceFlag { } export interface ReferenceImplicitGlobal { - node: TSESTree.Node; + node: NodeWithParent; pattern: TSESTree.BindingName; ref?: Reference; } diff --git a/packages/tsconfig-utils/CHANGELOG.md b/packages/tsconfig-utils/CHANGELOG.md index 6702a80306ee..91bede7256f5 100644 --- a/packages/tsconfig-utils/CHANGELOG.md +++ b/packages/tsconfig-utils/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.43.0 (2025-09-08) + +This was a version bump only for tsconfig-utils 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.42.0 (2025-09-02) This was a version bump only for tsconfig-utils to align it with other projects, there were no code changes. diff --git a/packages/tsconfig-utils/package.json b/packages/tsconfig-utils/package.json index 581a2ac87076..fc5f1f667245 100644 --- a/packages/tsconfig-utils/package.json +++ b/packages/tsconfig-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/tsconfig-utils", - "version": "8.42.0", + "version": "8.43.0", "description": "Utilities for collecting TSConfigs for linting scenarios.", "files": [ "dist", diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index cc2def818109..f76b267d9ee7 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **type-utils:** add union type support to TypeOrValueSpecifier ([#11526](https://github.com/typescript-eslint/typescript-eslint/pull/11526)) + +### ❤️ Thank You + +- 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.42.0 (2025-09-02) This was a version bump only for type-utils to align it with other projects, there were no code changes. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 6b5a34063b08..7f95c6572b5d 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "8.42.0", + "version": "8.43.0", "description": "Type utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -44,9 +44,9 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0", - "@typescript-eslint/utils": "8.42.0", + "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/typescript-estree": "8.43.0", + "@typescript-eslint/utils": "8.43.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, @@ -55,7 +55,7 @@ "typescript": ">=4.8.4 <6.0.0" }, "devDependencies": { - "@typescript-eslint/parser": "8.42.0", + "@typescript-eslint/parser": "8.43.0", "@vitest/coverage-v8": "^3.1.3", "ajv": "^6.12.6", "eslint": "*", diff --git a/packages/type-utils/src/TypeOrValueSpecifier.ts b/packages/type-utils/src/TypeOrValueSpecifier.ts index bbfb99ddcc78..553c8a4225bf 100644 --- a/packages/type-utils/src/TypeOrValueSpecifier.ts +++ b/packages/type-utils/src/TypeOrValueSpecifier.ts @@ -169,6 +169,10 @@ export function typeMatchesSpecifier( specifier: TypeOrValueSpecifier, program: ts.Program, ): boolean { + if (tsutils.isUnionType(type)) { + return type.types.every(t => typeMatchesSpecifier(t, specifier, program)); + } + const wholeTypeMatches = ((): boolean => { if (tsutils.isIntrinsicErrorType(type)) { return false; diff --git a/packages/type-utils/tests/TypeOrValueSpecifier.test.ts b/packages/type-utils/tests/TypeOrValueSpecifier.test.ts index a28d22f36b71..3d3429fbb3d1 100644 --- a/packages/type-utils/tests/TypeOrValueSpecifier.test.ts +++ b/packages/type-utils/tests/TypeOrValueSpecifier.test.ts @@ -179,6 +179,7 @@ describe('TypeOrValueSpecifier', () => { ['interface Foo {prop: string}; type Test = Foo;', 'RegExp'], ['type Test = RegExp;', 'Foo'], ['type Test = RegExp;', 'BigInt'], + ['type Test = RegExp | BigInt;', 'BigInt'], ] as const satisfies [string, TypeOrValueSpecifier][])( "doesn't match a mismatched universal string specifier: %s\n\t%s", ([code, typeOrValueSpecifier], { expect }) => { @@ -267,6 +268,10 @@ describe('TypeOrValueSpecifier', () => { 'interface Foo {prop: string}; type Test = Foo;', { from: 'file', name: 'Bar' }, ], + [ + 'interface Foo {prop: string}; type Test = Foo | string;', + { from: 'file', name: 'Foo' }, + ], [ 'interface Foo {prop: string}; type Test = Foo;', { from: 'file', name: ['Bar', 'Baz'] }, @@ -306,6 +311,7 @@ describe('TypeOrValueSpecifier', () => { it.for([ ['type Test = RegExp;', { from: 'lib', name: 'BigInt' }], + ['type Test = RegExp | BigInt;', { from: 'lib', name: 'BigInt' }], ['type Test = RegExp;', { from: 'lib', name: ['BigInt', 'Date'] }], ] as const satisfies [string, TypeOrValueSpecifier][])( "doesn't match a mismatched lib specifier: %s\n\t%s", @@ -326,6 +332,7 @@ describe('TypeOrValueSpecifier', () => { it.for([ ['type Test = string;', { from: 'lib', name: 'number' }], + ['type Test = string | number;', { from: 'lib', name: 'number' }], ['type Test = string;', { from: 'lib', name: ['number', 'boolean'] }], ] as const satisfies [string, TypeOrValueSpecifier][])( "doesn't match a mismatched intrinsic type specifier: %s\n\t%s", @@ -545,6 +552,10 @@ describe('TypeOrValueSpecifier', () => { 'import type {Node} from "typescript"; type Test = Node;', { from: 'package', name: 'Symbol', package: 'typescript' }, ], + [ + 'import type {Node} from "typescript"; type Test = Node | Symbol;', + { from: 'package', name: 'Node', package: 'typescript' }, + ], [ 'import type {Node} from "typescript"; type Test = Node;', { from: 'package', name: ['Symbol', 'Checker'], package: 'typescript' }, diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index c23735280c72..25d996362475 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **scope-manager:** exclude Program from DefinitionBase node types ([#11469](https://github.com/typescript-eslint/typescript-eslint/pull/11469)) + +### ❤️ Thank You + +- Dima @dbarabashh + +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 types to align it with other projects, there were no code changes. diff --git a/packages/types/package.json b/packages/types/package.json index 6f791504315b..890b838e2549 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "8.42.0", + "version": "8.43.0", "description": "Types for the TypeScript-ESTree AST spec", "files": [ "dist", diff --git a/packages/types/src/ts-estree.ts b/packages/types/src/ts-estree.ts index 1a43962b0231..33092006c987 100644 --- a/packages/types/src/ts-estree.ts +++ b/packages/types/src/ts-estree.ts @@ -251,3 +251,4 @@ declare module './generated/ast-spec' { } export * as TSESTree from './generated/ast-spec'; +export type NodeWithParent = Exclude; diff --git a/packages/typescript-eslint/CHANGELOG.md b/packages/typescript-eslint/CHANGELOG.md index fbc52575d507..1ffe823277da 100644 --- a/packages/typescript-eslint/CHANGELOG.md +++ b/packages/typescript-eslint/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **eslint-plugin:** [no-deprecated] should report deprecated exports and reexports ([#11359](https://github.com/typescript-eslint/typescript-eslint/pull/11359)) + +### ❤️ Thank You + +- 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.42.0 (2025-09-02) ### 🚀 Features diff --git a/packages/typescript-eslint/package.json b/packages/typescript-eslint/package.json index f4d605563c98..b7ec11091d60 100644 --- a/packages/typescript-eslint/package.json +++ b/packages/typescript-eslint/package.json @@ -1,6 +1,6 @@ { "name": "typescript-eslint", - "version": "8.42.0", + "version": "8.43.0", "description": "Tooling which enables you to use TypeScript with ESLint", "files": [ "dist", @@ -50,10 +50,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "8.42.0", - "@typescript-eslint/parser": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0", - "@typescript-eslint/utils": "8.42.0" + "@typescript-eslint/eslint-plugin": "8.43.0", + "@typescript-eslint/parser": "8.43.0", + "@typescript-eslint/typescript-estree": "8.43.0", + "@typescript-eslint/utils": "8.43.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/typescript-eslint/src/index.ts b/packages/typescript-eslint/src/index.ts index 02197940789a..c369d3605d2c 100644 --- a/packages/typescript-eslint/src/index.ts +++ b/packages/typescript-eslint/src/index.ts @@ -223,6 +223,7 @@ export default { }; export { + // eslint-disable-next-line @typescript-eslint/no-deprecated config, type ConfigWithExtends, type InfiniteDepthConfigWithExtends, diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index c11a9eed239e..e0d097bc0f88 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -1,3 +1,20 @@ +## 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 + +- **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 + +- Kirk Waiblinger @kirkwaiblinger +- Nicolas Le Cam + +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 typescript-estree to align it with other projects, there were no code changes. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index ff47e8b02713..283697eb4486 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "8.42.0", + "version": "8.43.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "files": [ "dist", @@ -52,10 +52,10 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/project-service": "8.42.0", - "@typescript-eslint/tsconfig-utils": "8.42.0", - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/visitor-keys": "8.42.0", + "@typescript-eslint/project-service": "8.43.0", + "@typescript-eslint/tsconfig-utils": "8.43.0", + "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/visitor-keys": "8.43.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 150c0ee950ea..0ffc735c3a14 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -401,10 +401,12 @@ export class Converter { } } - #throwError(node: number | ts.Node, message: string): asserts node is never { + #throwError(node: number | ts.Node | TSESTree.Range, message: string): never { let start; let end; - if (typeof node === 'number') { + if (Array.isArray(node)) { + [start, end] = node; + } else if (typeof node === 'number') { start = end = node; } else { start = node.getStart(this.ast); @@ -415,7 +417,7 @@ export class Converter { } #throwUnlessAllowInvalidAST( - node: number | ts.Node, + node: number | ts.Node | TSESTree.Range, message: string, ): asserts node is never { if (!this.options.allowInvalidAST) { @@ -691,10 +693,15 @@ export class Converter { node: TSESTreeToTSNode, ): TSESTree.TSTypeParameterInstantiation { const greaterThanToken = findNextToken(typeArguments, this.ast, this.ast)!; + const range: TSESTree.Range = [typeArguments.pos - 1, greaterThanToken.end]; + + if (typeArguments.length === 0) { + this.#throwError(range, 'Type argument list cannot be empty.'); + } return this.createNode(node, { type: AST_NODE_TYPES.TSTypeParameterInstantiation, - range: [typeArguments.pos - 1, greaterThanToken.end], + range, params: typeArguments.map(typeArgument => this.convertChild(typeArgument), ), @@ -715,6 +722,10 @@ export class Converter { greaterThanToken.end, ]; + if (typeParameters.length === 0) { + this.#throwError(range, 'Type parameter list cannot be empty.'); + } + return { type: AST_NODE_TYPES.TSTypeParameterDeclaration, loc: getLocFor(range, this.ast), diff --git a/packages/typescript-estree/src/useProgramFromProjectService.ts b/packages/typescript-estree/src/useProgramFromProjectService.ts index 9a046ee2c907..9a365029de02 100644 --- a/packages/typescript-estree/src/useProgramFromProjectService.ts +++ b/packages/typescript-estree/src/useProgramFromProjectService.ts @@ -1,4 +1,4 @@ -import type { ProjectServiceAndMetadata as ProjectServiceAndMetadata } from '@typescript-eslint/project-service'; +import type { ProjectServiceAndMetadata } from '@typescript-eslint/project-service'; import debug from 'debug'; import { minimatch } from 'minimatch'; @@ -316,5 +316,7 @@ function filePathMatchedBy( filePath: string, allowDefaultProject: string[] | undefined, ): boolean { - return !!allowDefaultProject?.some(pattern => minimatch(filePath, pattern)); + return !!allowDefaultProject?.some(pattern => + minimatch(filePath, pattern, { dot: true }), + ); } diff --git a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts index e07add99d30e..48e62e1c39b6 100644 --- a/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts +++ b/packages/typescript-estree/tests/lib/useProgramFromProjectService.test.ts @@ -624,4 +624,31 @@ If you absolutely need more files included, set parserOptions.projectService.max )}\`) is non-standard. It should be added to your existing \`parserOptions.extraFileExtensions\`.`, ); }); + + it('matches filenames starting with a period', () => { + const { service } = createMockProjectService(); + + const filePath = `.prettierrc.js`; + + const program = { getSourceFile: vi.fn() }; + + mockGetProgram.mockReturnValueOnce(program); + + service.openClientFile.mockReturnValueOnce({ + configFileName: 'tsconfig.json', + }); + mockCreateProjectProgram.mockReturnValueOnce(program); + + const actual = useProgramFromProjectService( + createProjectServiceSettings({ + allowDefaultProject: ['*.js'], + service, + }), + { ...mockParseSettings, filePath }, + false, + new Set(), + ); + + expect(actual).toBe(program); + }); }); diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index c6af51658d4b..e6029c9e5864 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -1,3 +1,15 @@ +## 8.43.0 (2025-09-08) + +### 🩹 Fixes + +- **scope-manager:** exclude Program from DefinitionBase node types ([#11469](https://github.com/typescript-eslint/typescript-eslint/pull/11469)) + +### ❤️ Thank You + +- Dima @dbarabashh + +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 utils to align it with other projects, there were no code changes. diff --git a/packages/utils/package.json b/packages/utils/package.json index 3e8d5744d499..37c4c66a1aff 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "8.42.0", + "version": "8.43.0", "description": "Utilities for working with TypeScript + ESLint together", "files": [ "dist", @@ -62,9 +62,9 @@ }, "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", - "@typescript-eslint/scope-manager": "8.42.0", - "@typescript-eslint/types": "8.42.0", - "@typescript-eslint/typescript-estree": "8.42.0" + "@typescript-eslint/scope-manager": "8.43.0", + "@typescript-eslint/types": "8.43.0", + "@typescript-eslint/typescript-estree": "8.43.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 3b40254b0a6e..49e461b89934 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -25,6 +25,11 @@ export interface RuleMetaDataDocs { * The URL of the rule's docs. */ url?: string; + + /** + * Mark this rule as feature-frozen. + */ + frozen?: boolean; } export interface ExternalSpecifier { diff --git a/packages/utils/src/ts-estree.ts b/packages/utils/src/ts-estree.ts index 6c61253a1f05..41cb2bf119b9 100644 --- a/packages/utils/src/ts-estree.ts +++ b/packages/utils/src/ts-estree.ts @@ -1,11 +1,11 @@ // for convenience's sake - export the types directly from here so consumers // don't need to reference/install both packages in their code - export { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree, } from '@typescript-eslint/types'; +export type { NodeWithParent } from '@typescript-eslint/types'; export type { ParserServices, diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index f18689f963b1..34e4a4bbe64c 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -1,3 +1,9 @@ +## 8.43.0 (2025-09-08) + +This was a version bump only for visitor-keys 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.42.0 (2025-09-02) This was a version bump only for visitor-keys to align it with other projects, there were no code changes. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 04e6678f79d6..69ad03182abe 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "8.42.0", + "version": "8.43.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "files": [ "dist", @@ -45,7 +45,7 @@ "typecheck": "yarn run -BT nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "8.42.0", + "@typescript-eslint/types": "8.43.0", "eslint-visitor-keys": "^4.2.1" }, "devDependencies": { diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx index 6f25e27e951d..68315eb926c9 100644 --- a/packages/website/src/components/RulesTable/index.tsx +++ b/packages/website/src/components/RulesTable/index.tsx @@ -55,9 +55,12 @@ function RuleRow({ return ( - - @typescript-eslint/{rule.name} - +
+ + @typescript-eslint/{rule.name} + + {rule.docs.frozen && ❄️} +

{interpolateCode(rule.docs.description)} diff --git a/packages/website/src/components/RulesTable/styles.module.css b/packages/website/src/components/RulesTable/styles.module.css index 3ffcec037609..606453e07ac6 100644 --- a/packages/website/src/components/RulesTable/styles.module.css +++ b/packages/website/src/components/RulesTable/styles.module.css @@ -145,3 +145,9 @@ text-align: center; cursor: default; } + +.ruleNameWrapper { + display: inline-flex; + align-items: center; + gap: 0.5rem; +} diff --git a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx index 0465e126aaad..ec1aa2d1d7d0 100644 --- a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx +++ b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx @@ -155,6 +155,18 @@ export function RuleAttributes({ name }: { name: string }): React.ReactNode { }); } + if (rule.docs.frozen) { + features.push({ + children: ( + <> + This rule is currently frozen{' '} + and is not accepting feature requests. + + ), + emoji: '❄️', + }); + } + return (
{features.map(feature => ( diff --git a/yarn.lock b/yarn.lock index b1c732c57839..f041745c50c5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5599,11 +5599,11 @@ __metadata: linkType: hard "@types/node@npm:^22.0.0": - version: 22.17.2 - resolution: "@types/node@npm:22.17.2" + version: 22.18.0 + resolution: "@types/node@npm:22.18.0" dependencies: undici-types: ~6.21.0 - checksum: 2a82f96abcf25104efa6e9b8231616e039e5e0854f07e9ce4fdf821d30eaac30a80ec3cafefb36d2af8bd7c9594cfda337887bd85bb5c2031ba0f7e23a3d588d + checksum: a110b66f079ea882be1e300e72978cd3a5e7be8217b362b72152e09f64087731a235a0557fca72d621912a8ba1347d9ba49468c35755dd2581edb7f3f6e016e2 languageName: node linkType: hard @@ -5830,19 +5830,19 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/eslint-plugin@8.42.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": +"@typescript-eslint/eslint-plugin@8.43.0, @typescript-eslint/eslint-plugin@workspace:*, @typescript-eslint/eslint-plugin@workspace:^, @typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin": version: 0.0.0-use.local resolution: "@typescript-eslint/eslint-plugin@workspace:packages/eslint-plugin" dependencies: "@eslint-community/regexpp": ^4.10.0 "@types/mdast": ^4.0.3 "@types/natural-compare": "*" - "@typescript-eslint/rule-schema-to-typescript-types": 8.42.0 - "@typescript-eslint/rule-tester": 8.42.0 - "@typescript-eslint/scope-manager": 8.42.0 - "@typescript-eslint/type-utils": 8.42.0 - "@typescript-eslint/utils": 8.42.0 - "@typescript-eslint/visitor-keys": 8.42.0 + "@typescript-eslint/rule-schema-to-typescript-types": 8.43.0 + "@typescript-eslint/rule-tester": 8.43.0 + "@typescript-eslint/scope-manager": 8.43.0 + "@typescript-eslint/type-utils": 8.43.0 + "@typescript-eslint/utils": 8.43.0 + "@typescript-eslint/visitor-keys": 8.43.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 cross-fetch: "*" @@ -5865,7 +5865,7 @@ __metadata: unist-util-visit: ^5.0.0 vitest: ^3.1.3 peerDependencies: - "@typescript-eslint/parser": ^8.42.0 + "@typescript-eslint/parser": ^8.43.0 eslint: ^8.57.0 || ^9.0.0 typescript: ">=4.8.4 <6.0.0" languageName: unknown @@ -5881,14 +5881,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/parser@8.42.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": +"@typescript-eslint/parser@8.43.0, @typescript-eslint/parser@workspace:*, @typescript-eslint/parser@workspace:^, @typescript-eslint/parser@workspace:packages/parser": version: 0.0.0-use.local resolution: "@typescript-eslint/parser@workspace:packages/parser" dependencies: - "@typescript-eslint/scope-manager": 8.42.0 - "@typescript-eslint/types": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 - "@typescript-eslint/visitor-keys": 8.42.0 + "@typescript-eslint/scope-manager": 8.43.0 + "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/visitor-keys": 8.43.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -5902,12 +5902,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/project-service@8.42.0, @typescript-eslint/project-service@workspace:packages/project-service": +"@typescript-eslint/project-service@8.43.0, @typescript-eslint/project-service@workspace:packages/project-service": version: 0.0.0-use.local resolution: "@typescript-eslint/project-service@workspace:packages/project-service" dependencies: - "@typescript-eslint/tsconfig-utils": ^8.42.0 - "@typescript-eslint/types": ^8.42.0 + "@typescript-eslint/tsconfig-utils": ^8.43.0 + "@typescript-eslint/types": ^8.43.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 rimraf: "*" @@ -5918,12 +5918,12 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-schema-to-typescript-types@8.42.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": +"@typescript-eslint/rule-schema-to-typescript-types@8.43.0, @typescript-eslint/rule-schema-to-typescript-types@workspace:*, @typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-schema-to-typescript-types@workspace:packages/rule-schema-to-typescript-types" dependencies: - "@typescript-eslint/type-utils": 8.42.0 - "@typescript-eslint/utils": 8.42.0 + "@typescript-eslint/type-utils": 8.43.0 + "@typescript-eslint/utils": 8.43.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" natural-compare: ^1.4.0 @@ -5934,15 +5934,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/rule-tester@8.42.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": +"@typescript-eslint/rule-tester@8.43.0, @typescript-eslint/rule-tester@workspace:*, @typescript-eslint/rule-tester@workspace:packages/rule-tester": version: 0.0.0-use.local resolution: "@typescript-eslint/rule-tester@workspace:packages/rule-tester" dependencies: "@types/json-stable-stringify-without-jsonify": ^1.0.2 "@types/lodash.merge": 4.6.9 - "@typescript-eslint/parser": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 - "@typescript-eslint/utils": 8.42.0 + "@typescript-eslint/parser": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/utils": 8.43.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 eslint: "*" @@ -5957,13 +5957,13 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/scope-manager@8.42.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": +"@typescript-eslint/scope-manager@8.43.0, @typescript-eslint/scope-manager@workspace:*, @typescript-eslint/scope-manager@workspace:^, @typescript-eslint/scope-manager@workspace:packages/scope-manager": version: 0.0.0-use.local resolution: "@typescript-eslint/scope-manager@workspace:packages/scope-manager" dependencies: - "@typescript-eslint/types": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 - "@typescript-eslint/visitor-keys": 8.42.0 + "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/visitor-keys": 8.43.0 "@vitest/coverage-v8": ^3.1.3 "@vitest/pretty-format": ^3.1.3 eslint: "*" @@ -5974,7 +5974,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/tsconfig-utils@8.42.0, @typescript-eslint/tsconfig-utils@^8.42.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": +"@typescript-eslint/tsconfig-utils@8.43.0, @typescript-eslint/tsconfig-utils@^8.43.0, @typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/tsconfig-utils@workspace:packages/tsconfig-utils" dependencies: @@ -5987,14 +5987,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/type-utils@8.42.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": +"@typescript-eslint/type-utils@8.43.0, @typescript-eslint/type-utils@workspace:*, @typescript-eslint/type-utils@workspace:packages/type-utils": version: 0.0.0-use.local resolution: "@typescript-eslint/type-utils@workspace:packages/type-utils" dependencies: - "@typescript-eslint/parser": 8.42.0 - "@typescript-eslint/types": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 - "@typescript-eslint/utils": 8.42.0 + "@typescript-eslint/parser": 8.43.0 + "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/utils": 8.43.0 "@vitest/coverage-v8": ^3.1.3 ajv: ^6.12.6 debug: ^4.3.4 @@ -6009,7 +6009,7 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/types@8.42.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.42.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": +"@typescript-eslint/types@8.43.0, @typescript-eslint/types@^8.11.0, @typescript-eslint/types@^8.34.1, @typescript-eslint/types@^8.43.0, @typescript-eslint/types@workspace:*, @typescript-eslint/types@workspace:^, @typescript-eslint/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: @@ -6082,15 +6082,15 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/typescript-estree@8.42.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": +"@typescript-eslint/typescript-estree@8.43.0, @typescript-eslint/typescript-estree@workspace:*, @typescript-eslint/typescript-estree@workspace:^, @typescript-eslint/typescript-estree@workspace:packages/typescript-estree": version: 0.0.0-use.local resolution: "@typescript-eslint/typescript-estree@workspace:packages/typescript-estree" dependencies: "@types/is-glob": ^4.0.4 - "@typescript-eslint/project-service": 8.42.0 - "@typescript-eslint/tsconfig-utils": 8.42.0 - "@typescript-eslint/types": 8.42.0 - "@typescript-eslint/visitor-keys": 8.42.0 + "@typescript-eslint/project-service": 8.43.0 + "@typescript-eslint/tsconfig-utils": 8.43.0 + "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/visitor-keys": 8.43.0 "@vitest/coverage-v8": ^3.1.3 debug: ^4.3.4 eslint: "*" @@ -6108,14 +6108,14 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/utils@8.42.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": +"@typescript-eslint/utils@8.43.0, @typescript-eslint/utils@^8.24.1, @typescript-eslint/utils@^8.34.1, @typescript-eslint/utils@workspace:*, @typescript-eslint/utils@workspace:^, @typescript-eslint/utils@workspace:packages/utils": version: 0.0.0-use.local resolution: "@typescript-eslint/utils@workspace:packages/utils" dependencies: "@eslint-community/eslint-utils": ^4.7.0 - "@typescript-eslint/scope-manager": 8.42.0 - "@typescript-eslint/types": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 + "@typescript-eslint/scope-manager": 8.43.0 + "@typescript-eslint/types": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*" @@ -6127,11 +6127,11 @@ __metadata: languageName: unknown linkType: soft -"@typescript-eslint/visitor-keys@8.42.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": +"@typescript-eslint/visitor-keys@8.43.0, @typescript-eslint/visitor-keys@workspace:*, @typescript-eslint/visitor-keys@workspace:packages/visitor-keys": version: 0.0.0-use.local resolution: "@typescript-eslint/visitor-keys@workspace:packages/visitor-keys" dependencies: - "@typescript-eslint/types": 8.42.0 + "@typescript-eslint/types": 8.43.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" eslint-visitor-keys: ^4.2.1 @@ -19359,10 +19359,10 @@ __metadata: version: 0.0.0-use.local resolution: "typescript-eslint@workspace:packages/typescript-eslint" dependencies: - "@typescript-eslint/eslint-plugin": 8.42.0 - "@typescript-eslint/parser": 8.42.0 - "@typescript-eslint/typescript-estree": 8.42.0 - "@typescript-eslint/utils": 8.42.0 + "@typescript-eslint/eslint-plugin": 8.43.0 + "@typescript-eslint/parser": 8.43.0 + "@typescript-eslint/typescript-estree": 8.43.0 + "@typescript-eslint/utils": 8.43.0 "@vitest/coverage-v8": ^3.1.3 eslint: "*" rimraf: "*"