Skip to content

New Rule: prefer-destructuring #1931

Closed
Closed
@0xCLARITY

Description

@0xCLARITY

I'd like to use the prefer-destructuring rule from ESLint, however, when I try to use array destructuring with an Express request object, I get the following TypeScript Error:

Type 'ParamsDictionary' must have a '[Symbol.iterator]()' method that returns an iterator.ts(2488).

That seems reasonable, but then the base ESLint prefer-destructuring rule gives me a warning, even though TypeScript claims I'm not allowed to use array destructuring here.

I think having a type-aware version of this rule would be beneficial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    accepting prsGo ahead, send a pull request that resolves this issueenhancement: new base rule extensionNew base rule extension required to handle a TS specific casepackage: 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