Skip to content

[typedef] False positive errors on deep destructuring #4505

Closed
@gultyayev

Description

@gultyayev
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro

{
  "rules": {
    "@typescript-eslint/typedef": [
      "warn",
          {
            "arrayDestructuring": true,
            "arrowParameter": true,
            "memberVariableDeclaration": true,
            "objectDestructuring": true,
            "parameter": true,
            "propertyDeclaration": true,
            "variableDeclaration": true,
            "variableDeclarationIgnoreFunction": true
          }
    ]
  }
}
const {
      user: { name }, // <-- It complains about type annotation for { name }
      email,
    }: User = await this.getUser();

Expected Result

Should not print any warnings

Actual Result

Shows a warning (because of that I cannot switch the rule to "error" instead of "warn")

Versions

package version
@typescript-eslint/eslint-plugin ^5.9.1
@typescript-eslint/parser ^5.9.1
TypeScript ~4.3.5
ESLint ^8.6.0
node 16.13.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issuebugSomething isn't workinggood first issueGood for newcomerspackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions